summaryrefslogtreecommitdiffstats
path: root/vppinfra/vppinfra/bihash_8_8.h
diff options
context:
space:
mode:
Diffstat (limited to 'vppinfra/vppinfra/bihash_8_8.h')
-rw-r--r--vppinfra/vppinfra/bihash_8_8.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/vppinfra/vppinfra/bihash_8_8.h b/vppinfra/vppinfra/bihash_8_8.h
index 9b5da5a2b89..4087d4dd568 100644
--- a/vppinfra/vppinfra/bihash_8_8.h
+++ b/vppinfra/vppinfra/bihash_8_8.h
@@ -25,6 +25,10 @@
#include <vppinfra/pool.h>
#include <vppinfra/xxhash.h>
+#if __SSE4_2__
+#include <x86intrin.h>
+#endif
+
/** 8 octet key, 8 octet key value pair */
typedef struct
{
@@ -49,7 +53,11 @@ clib_bihash_is_free_8_8 (clib_bihash_kv_8_8_t * v)
static inline u64
clib_bihash_hash_8_8 (clib_bihash_kv_8_8_t * v)
{
+#if __SSE4_2__
+ return _mm_crc32_u64 (v->key, 0);
+#else
return clib_xxhash (v->key);
+#endif
}
/** Format a clib_bihash_kv_8_8_t instance