summaryrefslogtreecommitdiff
path: root/lib/librte_table/rte_table_hash_func_arm64.h
blob: eb04c1ff54f7e930ef8b6e9028a51d5a4ecce6f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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