diff options
author | Damjan Marion <dmarion@me.com> | 2021-12-15 10:17:04 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-12-15 16:33:45 +0000 |
commit | 88019c40725704e6998625937c764d1d0c827975 (patch) | |
tree | e8fb855ab122e902d5eec559c751025f51050f70 /src/vppinfra/vector_avx2.h | |
parent | b7e4e6d1d24685cec2b1b8c72998661ae237fe94 (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_avx2.h')
-rw-r--r-- | src/vppinfra/vector_avx2.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vppinfra/vector_avx2.h b/src/vppinfra/vector_avx2.h index 59857182a93..6a363ccfa92 100644 --- a/src/vppinfra/vector_avx2.h +++ b/src/vppinfra/vector_avx2.h @@ -203,6 +203,16 @@ u32x8_hadd (u32x8 v1, u32x8 v2) return (u32x8) _mm256_hadd_epi32 ((__m256i) v1, (__m256i) v2); } +static_always_inline u32 +u32x8_hxor (u32x8 v) +{ + u32x4 v4; + v4 = u32x8_extract_lo (v) ^ u32x8_extract_hi (v); + v4 ^= (u32x4) u8x16_align_right (v4, v4, 8); + v4 ^= (u32x4) u8x16_align_right (v4, v4, 4); + return v4[0]; +} + static_always_inline u16x16 u16x16_mask_last (u16x16 v, u8 n_last) { |