From 0f68c79a9d8533d492c8221f924b14cf4e222136 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 26 Apr 2017 13:05:05 +0200 Subject: Add crc32c inline function, allows compilation on 32-bit systems 32-bit code still can use crc32c instructions, but it operates on 32 registers Change-Id: I9bb6b0b59635d6ea6a753584676ebcf59c8f6584 Signed-off-by: Damjan Marion --- src/vppinfra/bihash_24_8.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/vppinfra/bihash_24_8.h') diff --git a/src/vppinfra/bihash_24_8.h b/src/vppinfra/bihash_24_8.h index 353f06bf11f..655dab8015f 100644 --- a/src/vppinfra/bihash_24_8.h +++ b/src/vppinfra/bihash_24_8.h @@ -24,6 +24,7 @@ #include #include #include +#include typedef struct { @@ -44,11 +45,7 @@ static inline u64 clib_bihash_hash_24_8 (const clib_bihash_kv_24_8_t * v) { #if __SSE4_2__ - u32 value = 0; - value = _mm_crc32_u64 (value, v->key[0]); - value = _mm_crc32_u64 (value, v->key[1]); - value = _mm_crc32_u64 (value, v->key[2]); - return value; + return clib_crc32c ((u8 *) v->key, 24); #else u64 tmp = v->key[0] ^ v->key[1] ^ v->key[2]; return clib_xxhash (tmp); -- cgit 1.2.3-korg