X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fcuckoo_8_8.h;h=ace535b58f6d26725c8db99753d8b9f327b890c8;hb=39d0285fca412ea2921fe1ae98a231894cd193cf;hp=127e4e5b76d89d36a6b7923d2f77d64775f6adfc;hpb=470a011511a41dcb893df12b33261030717d1e08;p=vpp.git diff --git a/src/vppinfra/cuckoo_8_8.h b/src/vppinfra/cuckoo_8_8.h index 127e4e5b76d..ace535b58f6 100644 --- a/src/vppinfra/cuckoo_8_8.h +++ b/src/vppinfra/cuckoo_8_8.h @@ -39,7 +39,9 @@ #define CLIB_CUCKOO_OPTIMIZE_UNROLL 1 #define CLIB_CUCKOO_OPTIMIZE_USE_COUNT_LIMITS_SEARCH 1 +#if __SSE4_2__ && !defined (__i386__) #include +#endif /** 8 octet key, 8 octet key value pair */ typedef struct @@ -62,7 +64,7 @@ clib_cuckoo_kv_is_free_8_8 (const clib_cuckoo_kv_8_8_t * v) always_inline void clib_cuckoo_kv_set_free_8_8 (clib_cuckoo_kv_8_8_t * v) { - memset (v, 0xff, sizeof (*v)); + clib_memset (v, 0xff, sizeof (*v)); } /** Format a clib_cuckoo_kv_8_8_t instance @@ -77,7 +79,7 @@ format_cuckoo_kvp_8_8 (u8 * s, va_list * args) if (clib_cuckoo_kv_is_free_8_8 (v)) { - s = format (s, " -- empty -- ", v->key, v->value); + s = format (s, " -- empty -- "); } else { @@ -89,8 +91,8 @@ format_cuckoo_kvp_8_8 (u8 * s, va_list * args) always_inline u64 clib_cuckoo_hash_8_8 (clib_cuckoo_kv_8_8_t * v) { -#if __SSE4_2__ && !defined (__i386__) - return _mm_crc32_u64 (0, v->key); +#if defined(clib_crc32c_uses_intrinsics) && !defined (__i386__) + return crc32_u64 (0, v->key); #else return clib_xxhash (v->key); #endif @@ -106,10 +108,8 @@ clib_cuckoo_key_compare_8_8 (u64 a, u64 b) return a == b; } -#if 0 #undef __included_cuckoo_template_h__ #include -#endif #endif /* __included_cuckoo_8_8_h__ */