5#ifndef __RTE_LRU_ARM64_H__
6#define __RTE_LRU_ARM64_H__
16#ifndef RTE_TABLE_HASH_LRU_STRATEGY
18#define RTE_TABLE_HASH_LRU_STRATEGY 3
20#define RTE_TABLE_HASH_LRU_STRATEGY 1
24#if RTE_TABLE_HASH_LRU_STRATEGY == 3
26#define lru_init(bucket) \
27 { bucket->lru_list = ~0LLU; }
30f_lru_pos(uint64_t lru_list)
33 uint16x4_t lru_vec = vld1_u16((uint16_t *)&lru_list);
34 uint16x4_t min_vec = vmov_n_u16(vminv_u16(lru_vec));
35 uint64_t mask = vget_lane_u64(vreinterpret_u64_u16(
36 vceq_u16(min_vec, lru_vec)), 0);
39#define lru_pos(bucket) f_lru_pos(bucket->lru_list)
41#define lru_update(bucket, mru_val) \
43 const uint64_t orvals[] = {0xFFFFLLU, 0xFFFFLLU << 16, \
44 0xFFFFLLU << 32, 0xFFFFLLU << 48, 0LLU}; \
45 const uint64_t decs[] = {0x1000100010001LLU, 0}; \
46 uint64x1_t lru = vdup_n_u64(bucket->lru_list); \
47 uint64x1_t vdec = vdup_n_u64(decs[mru_val>>2]); \
48 bucket->lru_list = vget_lane_u64(vreinterpret_u64_u16( \
49 vsub_u16(vreinterpret_u16_u64(lru), \
50 vreinterpret_u16_u64(vdec))), \
52 bucket->lru_list |= orvals[mru_val]; \
static unsigned int rte_clz64(uint64_t v)