X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_common_vect.h;h=54ec70f506fc65891274aa3726d5c853e960554c;hb=a0e3310e7a4f92622f7d86369c8f8e3c389edf18;hp=95bf4b1a34809e19f4d53736bbd03e7e23be737f;hpb=3440438c5d4749371be8c9c2abace4793af495b9;p=dpdk.git diff --git a/lib/librte_eal/common/include/rte_common_vect.h b/lib/librte_eal/common/include/rte_common_vect.h index 95bf4b1a34..54ec70f506 100644 --- a/lib/librte_eal/common/include/rte_common_vect.h +++ b/lib/librte_eal/common/include/rte_common_vect.h @@ -54,6 +54,10 @@ #include #endif +#if defined(__AVX__) +#include +#endif + #else #include @@ -70,7 +74,7 @@ typedef __m128i xmm_t; #define XMM_MASK (XMM_SIZE - 1) typedef union rte_xmm { - xmm_t m; + xmm_t x; uint8_t u8[XMM_SIZE / sizeof(uint8_t)]; uint16_t u16[XMM_SIZE / sizeof(uint16_t)]; uint32_t u32[XMM_SIZE / sizeof(uint32_t)]; @@ -78,14 +82,45 @@ typedef union rte_xmm { double pd[XMM_SIZE / sizeof(double)]; } rte_xmm_t; +#ifdef __AVX__ + +typedef __m256i ymm_t; + +#define YMM_SIZE (sizeof(ymm_t)) +#define YMM_MASK (YMM_SIZE - 1) + +typedef union rte_ymm { + ymm_t y; + xmm_t x[YMM_SIZE / sizeof(xmm_t)]; + uint8_t u8[YMM_SIZE / sizeof(uint8_t)]; + uint16_t u16[YMM_SIZE / sizeof(uint16_t)]; + uint32_t u32[YMM_SIZE / sizeof(uint32_t)]; + uint64_t u64[YMM_SIZE / sizeof(uint64_t)]; + double pd[YMM_SIZE / sizeof(double)]; +} rte_ymm_t; + +#endif /* __AVX__ */ + #ifdef RTE_ARCH_I686 #define _mm_cvtsi128_si64(a) ({ \ rte_xmm_t m; \ - m.m = (a); \ + m.x = (a); \ (m.u64[0]); \ }) #endif +/* + * Prior to version 12.1 icc doesn't support _mm_set_epi64x. + */ +#if (defined(__ICC) && __ICC < 1210) +#define _mm_set_epi64x(a, b) ({ \ + rte_xmm_t m; \ + m.u64[0] = b; \ + m.u64[1] = a; \ + (m.x); \ +}) +#endif /* (defined(__ICC) && __ICC < 1210) */ + #ifdef __cplusplus } #endif