aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vhash.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-05-19 00:04:23 +0200
committerDamjan Marion <damarion@cisco.com>2018-05-20 14:52:39 +0200
commita52e1668c9976bd5cdd20d02b668df41ea41f16f (patch)
tree75ed44c2df7a88e0e3af39ae1c4de4cc49f36ad7 /src/vppinfra/vhash.h
parent3b854a5cb876b5af4e69c56028e2c2824100f4b2 (diff)
vector functions cleanup and improvements
Remove functions which have native C equivalent (i.e. _is_equal can be replaced with ==, _add with +) Add SSE4.2, AVX-512 implementations of splat, load_unaligned, store_unaligned, is_all_zero, is_equal, is_all_equal Change-Id: Ie80b0e482e7a76248ad79399c2576468532354cd Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/vhash.h')
-rw-r--r--src/vppinfra/vhash.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vppinfra/vhash.h b/src/vppinfra/vhash.h
index 5ab42292001..85dfb788308 100644
--- a/src/vppinfra/vhash.h
+++ b/src/vppinfra/vhash.h
@@ -412,7 +412,7 @@ vhash_bucket_compare (vhash_t * h,
{
u32 k = vhash_get_key_word (h, key_word_index, vi);
u32x4 x = { k, k, k, k };
- return u32x4_is_equal (bucket[key_word_index].as_u32x4, x);
+ return (bucket[key_word_index].as_u32x4 == x);
}
#define vhash_bucket_compare_4(h,wi,vi,b0,b1,b2,b3,cmp0,cmp1,cmp2,cmp3) \
@@ -423,10 +423,10 @@ do { \
u32x4 _k2 = u32x4_splat_word (_k4, 2); \
u32x4 _k3 = u32x4_splat_word (_k4, 3); \
\
- cmp0 = u32x4_is_equal (b0->key[wi].as_u32x4, _k0); \
- cmp1 = u32x4_is_equal (b1->key[wi].as_u32x4, _k1); \
- cmp2 = u32x4_is_equal (b2->key[wi].as_u32x4, _k2); \
- cmp3 = u32x4_is_equal (b3->key[wi].as_u32x4, _k3); \
+ cmp0 = (b0->key[wi].as_u32x4 == _k0); \
+ cmp1 = (b1->key[wi].as_u32x4 == _k1); \
+ cmp2 = (b2->key[wi].as_u32x4 == _k2); \
+ cmp3 = (b3->key[wi].as_u32x4 == _k3); \
} while (0)
u32 vhash_get_overflow (vhash_t * h, u32 key_hash, u32 vi, u32 n_key_u32s);