aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_table/rte_table_hash_func_arm64.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librte_table/rte_table_hash_func_arm64.h')
-rw-r--r--lib/librte_table/rte_table_hash_func_arm64.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/librte_table/rte_table_hash_func_arm64.h b/lib/librte_table/rte_table_hash_func_arm64.h
new file mode 100644
index 00000000..eb04c1ff
--- /dev/null
+++ b/lib/librte_table/rte_table_hash_func_arm64.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Linaro Limited
+ */
+
+#ifndef __INCLUDE_RTE_TABLE_HASH_FUNC_ARM64_H__
+#define __INCLUDE_RTE_TABLE_HASH_FUNC_ARM64_H__
+
+#define _CRC32CX(crc, val) \
+ __asm__("crc32cx %w[c], %w[c], %x[v]":[c] "+r" (crc):[v] "r" (val))
+
+static inline uint64_t
+rte_crc32_u64(uint64_t crc, uint64_t v)
+{
+ uint32_t crc32 = crc;
+
+ _CRC32CX(crc32, v);
+
+ return crc32;
+}
+
+#endif