Use crc32 wrapper (VPP-1086)
This allows arm platforms to also take advantage of crc32 hardware
acceleration.
* add a wrapper for crc32_u64. It's the only one really used. Using it
instead of a call to clib_crc32c() eases building symmetrical hash
functions.
* replace #ifdef on SSE4 by a test on clib_crc32c_uses_intrinsics.
Note: keep the test on i386
* fix typo in lb test log
Change-Id: I03a0897b70f6c1717e6901d93cf0fe024d5facb5
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
diff --git a/src/vppinfra/cuckoo_8_8.h b/src/vppinfra/cuckoo_8_8.h
index 608cb0e..6fe334d 100644
--- a/src/vppinfra/cuckoo_8_8.h
+++ b/src/vppinfra/cuckoo_8_8.h
@@ -91,8 +91,8 @@
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