aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/crc32.h5
-rw-r--r--src/vppinfra/cuckoo_8_8.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/vppinfra/crc32.h b/src/vppinfra/crc32.h
index 242278ff241..340b539558e 100644
--- a/src/vppinfra/crc32.h
+++ b/src/vppinfra/crc32.h
@@ -22,6 +22,8 @@
#define clib_crc32c_uses_intrinsics
#include <x86intrin.h>
+#define crc32_u64 _mm_crc32_u64
+
static_always_inline u32
clib_crc32c (u8 * s, int len)
{
@@ -52,6 +54,9 @@ clib_crc32c (u8 * s, int len)
#define clib_crc32c_uses_intrinsics
#include <arm_acle.h>
+
+#define crc32_u64 __crc32cd
+
static_always_inline u32
clib_crc32c (u8 * s, int len)
{
diff --git a/src/vppinfra/cuckoo_8_8.h b/src/vppinfra/cuckoo_8_8.h
index 608cb0e943c..6fe334da32d 100644
--- a/src/vppinfra/cuckoo_8_8.h
+++ b/src/vppinfra/cuckoo_8_8.h
@@ -91,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