ea7be0a038
This commit adds rte_table_hash_func.h and rte_table_hash_func_arm64.h to librte_table. This reduces code duplication by removing duplicate header files within two folders and consolidating them into a single one. This also adds a scalar implementation of the x86_64 intrinsic for crc32 as a generic fallback. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Gavin Hu <gavin.hu@arm.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
22 lines
419 B
C
22 lines
419 B
C
/* 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
|