xxhash calculation takes 10 clock cycles on Haswell so it makes sense
to use crc32q insutrction when available.
Change-Id: Iab5e7d9c8ec0125626bbcd067e5dc30574c8febc
Signed-off-by: Damjan Marion <damarion@cisco.com>
CLIB_CORE = \
vppinfra/asm_x86.c \
vppinfra/backtrace.c \
+ vppinfra/bihash_8_8.h \
+ vppinfra/bihash_24_8.h \
+ vppinfra/bihash_template.h \
vppinfra/cpu.c \
vppinfra/elf.c \
vppinfra/elog.c \
#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
{
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