Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(c) 2015 Intel Corporation 3 : : */ 4 : : 5 : : #include <rte_vect.h> 6 : : 7 : : /* Function to compare multiple of 16 byte keys */ 8 : : static inline int 9 : 11434502 : rte_hash_k16_cmp_eq(const void *key1, const void *key2, size_t key_len __rte_unused) 10 : : { 11 : : const __m128i k1 = _mm_loadu_si128((const __m128i *) key1); 12 : : const __m128i k2 = _mm_loadu_si128((const __m128i *) key2); 13 : : const __m128i x = _mm_xor_si128(k1, k2); 14 : : 15 [ # # ]: 11434873 : return !_mm_test_all_zeros(x, x); 16 : : } 17 : : 18 : : static inline int 19 : 164 : rte_hash_k32_cmp_eq(const void *key1, const void *key2, size_t key_len __rte_unused) 20 : : { 21 : 164 : return rte_hash_k16_cmp_eq(key1, key2, 16) | 22 : : rte_hash_k16_cmp_eq((const uint8_t *) key1 + 16, 23 : : (const uint8_t *) key2 + 16, 16); 24 : : }