1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2015 Intel Corporation
5 #ifndef _RTE_VECT_X86_H_
6 #define _RTE_VECT_X86_H_
11 * RTE SSE/AVX related header.
15 #include <rte_config.h>
16 #include "generic/rte_vect.h"
18 #if (defined(__ICC) || \
19 (defined(_WIN64)) || \
20 (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
22 #include <smmintrin.h> /* SSE4 */
25 #include <immintrin.h>
30 #include <x86intrin.h>
38 typedef __m128i xmm_t;
40 #define XMM_SIZE (sizeof(xmm_t))
41 #define XMM_MASK (XMM_SIZE - 1)
43 typedef union rte_xmm {
45 uint8_t u8[XMM_SIZE / sizeof(uint8_t)];
46 uint16_t u16[XMM_SIZE / sizeof(uint16_t)];
47 uint32_t u32[XMM_SIZE / sizeof(uint32_t)];
48 uint64_t u64[XMM_SIZE / sizeof(uint64_t)];
49 double pd[XMM_SIZE / sizeof(double)];
54 typedef __m256i ymm_t;
56 #define YMM_SIZE (sizeof(ymm_t))
57 #define YMM_MASK (YMM_SIZE - 1)
59 typedef union rte_ymm {
61 xmm_t x[YMM_SIZE / sizeof(xmm_t)];
62 uint8_t u8[YMM_SIZE / sizeof(uint8_t)];
63 uint16_t u16[YMM_SIZE / sizeof(uint16_t)];
64 uint32_t u32[YMM_SIZE / sizeof(uint32_t)];
65 uint64_t u64[YMM_SIZE / sizeof(uint64_t)];
66 double pd[YMM_SIZE / sizeof(double)];
72 #define _mm_cvtsi128_si64(a) \
81 * Prior to version 12.1 icc doesn't support _mm_set_epi64x.
83 #if (defined(__ICC) && __ICC < 1210)
84 #define _mm_set_epi64x(a, b) \
91 #endif /* (defined(__ICC) && __ICC < 1210) */
97 #endif /* _RTE_VECT_X86_H_ */