aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vector_avx512.h
diff options
context:
space:
mode:
authorDamjan Marion <dmarion@me.com>2021-12-15 10:17:04 +0000
committerDamjan Marion <dmarion@me.com>2021-12-15 16:33:45 +0000
commit88019c40725704e6998625937c764d1d0c827975 (patch)
treee8fb855ab122e902d5eec559c751025f51050f70 /src/vppinfra/vector_avx512.h
parentb7e4e6d1d24685cec2b1b8c72998661ae237fe94 (diff)
vppinfra: toeplitz hash four in parallel
Type: improvement Change-Id: Icb3f39f42d01c51d7b03543cb7d6b5dabad11866 Signed-off-by: Damjan Marion <dmarion@me.com>
Diffstat (limited to 'src/vppinfra/vector_avx512.h')
-rw-r--r--src/vppinfra/vector_avx512.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/vppinfra/vector_avx512.h b/src/vppinfra/vector_avx512.h
index 3505961dca5..e71a8a70aa9 100644
--- a/src/vppinfra/vector_avx512.h
+++ b/src/vppinfra/vector_avx512.h
@@ -322,9 +322,16 @@ u8x64_mask_blend (u8x64 a, u8x64 b, u64 mask)
}
static_always_inline u8x64
-u8x64_permute (u8x64 v, u8x64 idx)
+u8x64_permute (u8x64 idx, u8x64 a)
{
- return (u8x64) _mm512_permutexvar_epi8 ((__m512i) v, (__m512i) idx);
+ return (u8x64) _mm512_permutexvar_epi8 ((__m512i) idx, (__m512i) a);
+}
+
+static_always_inline u8x64
+u8x64_permute2 (u8x64 idx, u8x64 a, u8x64 b)
+{
+ return (u8x64) _mm512_permutex2var_epi8 ((__m512i) a, (__m512i) idx,
+ (__m512i) b);
}
#define _(t, m, e, p, it) \
@@ -436,6 +443,14 @@ u16x8_compress (u16x8 v, u8 mask)
}
#endif
+static_always_inline u64
+u64x8_hxor (u64x8 v)
+{
+ v ^= u64x8_align_right (v, v, 4);
+ v ^= u64x8_align_right (v, v, 2);
+ return v[0] ^ v[1];
+}
+
static_always_inline void
u32x16_transpose (u32x16 m[16])
{