diff options
author | Damjan Marion <damarion@cisco.com> | 2018-05-23 20:21:51 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-05-25 11:44:43 +0000 |
commit | 1cf9a165fc80b2f8109f85d5bd121e0c7c397e58 (patch) | |
tree | 207e20914dc9edab3f2f225377e2c1af9d476190 /src/vppinfra/vector_avx512.h | |
parent | d57f63698f99fad0288ac040d83b3ecd380d4bfd (diff) |
Vectorized bihash_{48,40,24,16}_8 key compare
bihash_48_8 case:
Scalar code: 6 clocks
SSE4.2 code: 3 clocks
AVX2 code: 2.27 clocks
AVX512 code: 1.5 clocks
Change-Id: I40700175835a1e7321276e47eadbf9771d3c5a68
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/vector_avx512.h')
-rw-r--r-- | src/vppinfra/vector_avx512.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vppinfra/vector_avx512.h b/src/vppinfra/vector_avx512.h index 4aee8d1170a..f69c67e697c 100644 --- a/src/vppinfra/vector_avx512.h +++ b/src/vppinfra/vector_avx512.h @@ -28,7 +28,7 @@ _(f,32,8,ps) _(f,64,4,pd) /* splat, load_unaligned, store_unaligned, is_all_zero, is_equal, - is_all_equal */ + is_all_equal, is_zero_mask */ #define _(t, s, c, i) \ static_always_inline t##s##x##c \ t##s##x##c##_splat (t##s x) \ @@ -53,6 +53,11 @@ t##s##x##c##_is_equal (t##s##x##c a, t##s##x##c b) \ static_always_inline int \ t##s##x##c##_is_all_equal (t##s##x##c v, t##s x) \ { return t##s##x##c##_is_equal (v, t##s##x##c##_splat (x)); } \ +\ +static_always_inline u##c \ +t##s##x##c##_is_zero_mask (t##s##x##c v) \ +{ return _mm512_test_##i##_mask ((__m512i) v, (__m512i) v); } \ + foreach_avx512_vec512i foreach_avx512_vec512u #undef _ |