5 #ifndef _RTE_CRC_X86_H_ 6 #define _RTE_CRC_X86_H_ 10 static inline uint32_t
11 crc32c_sse42_u8(uint8_t data, uint32_t init_val)
13 return _mm_crc32_u8(init_val, data);
16 static inline uint32_t
17 crc32c_sse42_u16(uint16_t data, uint32_t init_val)
19 return _mm_crc32_u16(init_val, data);
22 static inline uint32_t
23 crc32c_sse42_u32(uint32_t data, uint32_t init_val)
25 return _mm_crc32_u32(init_val, data);
28 #ifdef RTE_ARCH_X86_64 29 static inline uint32_t
30 crc32c_sse42_u64(uint64_t data, uint64_t init_val)
32 return _mm_crc32_u64(init_val, data);
36 static inline uint32_t
37 crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val)
45 init_val = crc32c_sse42_u32(d.u32[0], (uint32_t)init_val);
46 init_val = crc32c_sse42_u32(d.u32[1], (uint32_t)init_val);
47 return (uint32_t)init_val;
55 static inline uint32_t
58 if (
likely(rte_hash_crc32_alg & CRC32_SSE42))
59 return crc32c_sse42_u8(data, init_val);
61 return crc32c_1byte(data, init_val);
69 static inline uint32_t
72 if (
likely(rte_hash_crc32_alg & CRC32_SSE42))
73 return crc32c_sse42_u16(data, init_val);
75 return crc32c_2bytes(data, init_val);
83 static inline uint32_t
86 if (
likely(rte_hash_crc32_alg & CRC32_SSE42))
87 return crc32c_sse42_u32(data, init_val);
89 return crc32c_1word(data, init_val);
97 static inline uint32_t
100 #ifdef RTE_ARCH_X86_64 101 if (
likely(rte_hash_crc32_alg == CRC32_SSE42_x64))
102 return crc32c_sse42_u64(data, init_val);
105 if (
likely(rte_hash_crc32_alg & CRC32_SSE42))
106 return crc32c_sse42_u64_mimic(data, init_val);
108 return crc32c_2words(data, init_val);
static uint32_t rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
static uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val)
static uint32_t rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
static uint32_t rte_hash_crc_4byte(uint32_t data, uint32_t init_val)