aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorHongyu Wang <hongyu.wang@intel.com>2022-02-25 15:09:03 +0800
committerHongyu Wang <hongyu.wang@intel.com>2022-02-28 09:37:25 +0800
commit50d9ca7104d40f0a331d0dd01e3c069ecf7f6c97 (patch)
tree3d665e8ae8b734f13e033e5ed20fb0eba22c8639 /gcc/config
parent88c1b0385aab2d83836bbd814fbb6abb72259d80 (diff)
downloadgcc-50d9ca7104d40f0a331d0dd01e3c069ecf7f6c97.zip
gcc-50d9ca7104d40f0a331d0dd01e3c069ecf7f6c97.tar.gz
gcc-50d9ca7104d40f0a331d0dd01e3c069ecf7f6c97.tar.bz2
AVX512F: Add helper enumeration for ternary logic intrinsics.
Sync with llvm change in https://reviews.llvm.org/D120307 to add enumeration and truncate imm to unsigned char, so users could use ~ on immediates. gcc/ChangeLog: * config/i386/avx512fintrin.h (_MM_TERNLOG_ENUM): New enum. (_mm512_ternarylogic_epi64): Truncate imm to unsigned char to avoid error when using ~enum as parameter. (_mm512_mask_ternarylogic_epi64): Likewise. (_mm512_maskz_ternarylogic_epi64): Likewise. (_mm512_ternarylogic_epi32): Likewise. (_mm512_mask_ternarylogic_epi32): Likewise. (_mm512_maskz_ternarylogic_epi32): Likewise. * config/i386/avx512vlintrin.h (_mm256_ternarylogic_epi64): Adjust imm param type to unsigned char. (_mm256_mask_ternarylogic_epi64): Likewise. (_mm256_maskz_ternarylogic_epi64): Likewise. (_mm256_ternarylogic_epi32): Likewise. (_mm256_mask_ternarylogic_epi32): Likewise. (_mm256_maskz_ternarylogic_epi32): Likewise. (_mm_ternarylogic_epi64): Likewise. (_mm_mask_ternarylogic_epi64): Likewise. (_mm_maskz_ternarylogic_epi64): Likewise. (_mm_ternarylogic_epi32): Likewise. (_mm_mask_ternarylogic_epi32): Likewise. (_mm_maskz_ternarylogic_epi32): Likewise. gcc/testsuite/ChangeLog: * gcc.target/i386/avx512f-vpternlogd-1.c: Use new enum. * gcc.target/i386/avx512f-vpternlogq-1.c: Likewise. * gcc.target/i386/avx512vl-vpternlogd-1.c: Likewise. * gcc.target/i386/avx512vl-vpternlogq-1.c: Likewise. * gcc.target/i386/testimm-10.c: Remove imm check for vpternlog insns since the imm has been truncated in intrinsic.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/avx512fintrin.h132
-rw-r--r--gcc/config/i386/avx512vlintrin.h278
2 files changed, 262 insertions, 148 deletions
diff --git a/gcc/config/i386/avx512fintrin.h b/gcc/config/i386/avx512fintrin.h
index bc10c82..29511fd 100644
--- a/gcc/config/i386/avx512fintrin.h
+++ b/gcc/config/i386/avx512fintrin.h
@@ -1639,16 +1639,27 @@ _mm_maskz_sub_round_ss (__mmask8 __U, __m128 __A, __m128 __B,
#endif
+/* Constant helper to represent the ternary logic operations among
+ vector A, B and C. */
+typedef enum
+{
+ _MM_TERNLOG_A = 0xF0,
+ _MM_TERNLOG_B = 0xCC,
+ _MM_TERNLOG_C = 0xAA
+} _MM_TERNLOG_ENUM;
+
#ifdef __OPTIMIZE__
extern __inline __m512i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_ternarylogic_epi64 (__m512i __A, __m512i __B, __m512i __C,
const int __imm)
{
- return (__m512i) __builtin_ia32_pternlogq512_mask ((__v8di) __A,
- (__v8di) __B,
- (__v8di) __C, __imm,
- (__mmask8) -1);
+ return (__m512i)
+ __builtin_ia32_pternlogq512_mask ((__v8di) __A,
+ (__v8di) __B,
+ (__v8di) __C,
+ (unsigned char) __imm,
+ (__mmask8) -1);
}
extern __inline __m512i
@@ -1656,10 +1667,12 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_ternarylogic_epi64 (__m512i __A, __mmask8 __U, __m512i __B,
__m512i __C, const int __imm)
{
- return (__m512i) __builtin_ia32_pternlogq512_mask ((__v8di) __A,
- (__v8di) __B,
- (__v8di) __C, __imm,
- (__mmask8) __U);
+ return (__m512i)
+ __builtin_ia32_pternlogq512_mask ((__v8di) __A,
+ (__v8di) __B,
+ (__v8di) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m512i
@@ -1667,10 +1680,12 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_maskz_ternarylogic_epi64 (__mmask8 __U, __m512i __A, __m512i __B,
__m512i __C, const int __imm)
{
- return (__m512i) __builtin_ia32_pternlogq512_maskz ((__v8di) __A,
- (__v8di) __B,
- (__v8di) __C,
- __imm, (__mmask8) __U);
+ return (__m512i)
+ __builtin_ia32_pternlogq512_maskz ((__v8di) __A,
+ (__v8di) __B,
+ (__v8di) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m512i
@@ -1678,10 +1693,12 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_ternarylogic_epi32 (__m512i __A, __m512i __B, __m512i __C,
const int __imm)
{
- return (__m512i) __builtin_ia32_pternlogd512_mask ((__v16si) __A,
- (__v16si) __B,
- (__v16si) __C,
- __imm, (__mmask16) -1);
+ return (__m512i)
+ __builtin_ia32_pternlogd512_mask ((__v16si) __A,
+ (__v16si) __B,
+ (__v16si) __C,
+ (unsigned char) __imm,
+ (__mmask16) -1);
}
extern __inline __m512i
@@ -1689,10 +1706,12 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_ternarylogic_epi32 (__m512i __A, __mmask16 __U, __m512i __B,
__m512i __C, const int __imm)
{
- return (__m512i) __builtin_ia32_pternlogd512_mask ((__v16si) __A,
- (__v16si) __B,
- (__v16si) __C,
- __imm, (__mmask16) __U);
+ return (__m512i)
+ __builtin_ia32_pternlogd512_mask ((__v16si) __A,
+ (__v16si) __B,
+ (__v16si) __C,
+ (unsigned char) __imm,
+ (__mmask16) __U);
}
extern __inline __m512i
@@ -1700,33 +1719,56 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_maskz_ternarylogic_epi32 (__mmask16 __U, __m512i __A, __m512i __B,
__m512i __C, const int __imm)
{
- return (__m512i) __builtin_ia32_pternlogd512_maskz ((__v16si) __A,
- (__v16si) __B,
- (__v16si) __C,
- __imm, (__mmask16) __U);
+ return (__m512i)
+ __builtin_ia32_pternlogd512_maskz ((__v16si) __A,
+ (__v16si) __B,
+ (__v16si) __C,
+ (unsigned char) __imm,
+ (__mmask16) __U);
}
#else
-#define _mm512_ternarylogic_epi64(A, B, C, I) \
- ((__m512i) __builtin_ia32_pternlogq512_mask ((__v8di)(__m512i)(A), \
- (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), (int)(I), (__mmask8)-1))
-#define _mm512_mask_ternarylogic_epi64(A, U, B, C, I) \
- ((__m512i) __builtin_ia32_pternlogq512_mask ((__v8di)(__m512i)(A), \
- (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), (int)(I), (__mmask8)(U)))
-#define _mm512_maskz_ternarylogic_epi64(U, A, B, C, I) \
- ((__m512i) __builtin_ia32_pternlogq512_maskz ((__v8di)(__m512i)(A), \
- (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), (int)(I), (__mmask8)(U)))
-#define _mm512_ternarylogic_epi32(A, B, C, I) \
- ((__m512i) __builtin_ia32_pternlogd512_mask ((__v16si)(__m512i)(A), \
- (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), (int)(I), \
- (__mmask16)-1))
-#define _mm512_mask_ternarylogic_epi32(A, U, B, C, I) \
- ((__m512i) __builtin_ia32_pternlogd512_mask ((__v16si)(__m512i)(A), \
- (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), (int)(I), \
- (__mmask16)(U)))
-#define _mm512_maskz_ternarylogic_epi32(U, A, B, C, I) \
- ((__m512i) __builtin_ia32_pternlogd512_maskz ((__v16si)(__m512i)(A), \
- (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), (int)(I), \
- (__mmask16)(U)))
+#define _mm512_ternarylogic_epi64(A, B, C, I) \
+ ((__m512i) \
+ __builtin_ia32_pternlogq512_mask ((__v8di) (__m512i) (A), \
+ (__v8di) (__m512i) (B), \
+ (__v8di) (__m512i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) -1))
+#define _mm512_mask_ternarylogic_epi64(A, U, B, C, I) \
+ ((__m512i) \
+ __builtin_ia32_pternlogq512_mask ((__v8di) (__m512i) (A), \
+ (__v8di) (__m512i) (B), \
+ (__v8di) (__m512i) (C), \
+ (unsigned char)(I), \
+ (__mmask8) (U)))
+#define _mm512_maskz_ternarylogic_epi64(U, A, B, C, I) \
+ ((__m512i) \
+ __builtin_ia32_pternlogq512_maskz ((__v8di) (__m512i) (A), \
+ (__v8di) (__m512i) (B), \
+ (__v8di) (__m512i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+#define _mm512_ternarylogic_epi32(A, B, C, I) \
+ ((__m512i) \
+ __builtin_ia32_pternlogd512_mask ((__v16si) (__m512i) (A), \
+ (__v16si) (__m512i) (B), \
+ (__v16si) (__m512i) (C), \
+ (unsigned char) (I), \
+ (__mmask16) -1))
+#define _mm512_mask_ternarylogic_epi32(A, U, B, C, I) \
+ ((__m512i) \
+ __builtin_ia32_pternlogd512_mask ((__v16si) (__m512i) (A), \
+ (__v16si) (__m512i) (B), \
+ (__v16si) (__m512i) (C), \
+ (unsigned char) (I), \
+ (__mmask16) (U)))
+#define _mm512_maskz_ternarylogic_epi32(U, A, B, C, I) \
+ ((__m512i) \
+ __builtin_ia32_pternlogd512_maskz ((__v16si) (__m512i) (A), \
+ (__v16si) (__m512i) (B), \
+ (__v16si) (__m512i) (C), \
+ (unsigned char) (I), \
+ (__mmask16) (U)))
#endif
extern __inline __m512d
diff --git a/gcc/config/i386/avx512vlintrin.h b/gcc/config/i386/avx512vlintrin.h
index bbced24..26b286e 100644
--- a/gcc/config/i386/avx512vlintrin.h
+++ b/gcc/config/i386/avx512vlintrin.h
@@ -10575,10 +10575,12 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_ternarylogic_epi64 (__m256i __A, __m256i __B, __m256i __C,
const int __imm)
{
- return (__m256i) __builtin_ia32_pternlogq256_mask ((__v4di) __A,
- (__v4di) __B,
- (__v4di) __C, __imm,
- (__mmask8) -1);
+ return (__m256i)
+ __builtin_ia32_pternlogq256_mask ((__v4di) __A,
+ (__v4di) __B,
+ (__v4di) __C,
+ (unsigned char) __imm,
+ (__mmask8) -1);
}
extern __inline __m256i
@@ -10587,10 +10589,12 @@ _mm256_mask_ternarylogic_epi64 (__m256i __A, __mmask8 __U,
__m256i __B, __m256i __C,
const int __imm)
{
- return (__m256i) __builtin_ia32_pternlogq256_mask ((__v4di) __A,
- (__v4di) __B,
- (__v4di) __C, __imm,
- (__mmask8) __U);
+ return (__m256i)
+ __builtin_ia32_pternlogq256_mask ((__v4di) __A,
+ (__v4di) __B,
+ (__v4di) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m256i
@@ -10599,11 +10603,12 @@ _mm256_maskz_ternarylogic_epi64 (__mmask8 __U, __m256i __A,
__m256i __B, __m256i __C,
const int __imm)
{
- return (__m256i) __builtin_ia32_pternlogq256_maskz ((__v4di) __A,
- (__v4di) __B,
- (__v4di) __C,
- __imm,
- (__mmask8) __U);
+ return (__m256i)
+ __builtin_ia32_pternlogq256_maskz ((__v4di) __A,
+ (__v4di) __B,
+ (__v4di) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m256i
@@ -10611,10 +10616,12 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_ternarylogic_epi32 (__m256i __A, __m256i __B, __m256i __C,
const int __imm)
{
- return (__m256i) __builtin_ia32_pternlogd256_mask ((__v8si) __A,
- (__v8si) __B,
- (__v8si) __C, __imm,
- (__mmask8) -1);
+ return (__m256i)
+ __builtin_ia32_pternlogd256_mask ((__v8si) __A,
+ (__v8si) __B,
+ (__v8si) __C,
+ (unsigned char) __imm,
+ (__mmask8) -1);
}
extern __inline __m256i
@@ -10623,10 +10630,12 @@ _mm256_mask_ternarylogic_epi32 (__m256i __A, __mmask8 __U,
__m256i __B, __m256i __C,
const int __imm)
{
- return (__m256i) __builtin_ia32_pternlogd256_mask ((__v8si) __A,
- (__v8si) __B,
- (__v8si) __C, __imm,
- (__mmask8) __U);
+ return (__m256i)
+ __builtin_ia32_pternlogd256_mask ((__v8si) __A,
+ (__v8si) __B,
+ (__v8si) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m256i
@@ -10635,11 +10644,12 @@ _mm256_maskz_ternarylogic_epi32 (__mmask8 __U, __m256i __A,
__m256i __B, __m256i __C,
const int __imm)
{
- return (__m256i) __builtin_ia32_pternlogd256_maskz ((__v8si) __A,
- (__v8si) __B,
- (__v8si) __C,
- __imm,
- (__mmask8) __U);
+ return (__m256i)
+ __builtin_ia32_pternlogd256_maskz ((__v8si) __A,
+ (__v8si) __B,
+ (__v8si) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m128i
@@ -10647,33 +10657,40 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_ternarylogic_epi64 (__m128i __A, __m128i __B, __m128i __C,
const int __imm)
{
- return (__m128i) __builtin_ia32_pternlogq128_mask ((__v2di) __A,
- (__v2di) __B,
- (__v2di) __C, __imm,
- (__mmask8) -1);
+ return (__m128i)
+ __builtin_ia32_pternlogq128_mask ((__v2di) __A,
+ (__v2di) __B,
+ (__v2di) __C,
+ (unsigned char) __imm,
+ (__mmask8) -1);
}
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mask_ternarylogic_epi64 (__m128i __A, __mmask8 __U,
- __m128i __B, __m128i __C, const int __imm)
+ __m128i __B, __m128i __C,
+ const int __imm)
{
- return (__m128i) __builtin_ia32_pternlogq128_mask ((__v2di) __A,
- (__v2di) __B,
- (__v2di) __C, __imm,
- (__mmask8) __U);
+ return (__m128i)
+ __builtin_ia32_pternlogq128_mask ((__v2di) __A,
+ (__v2di) __B,
+ (__v2di) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_maskz_ternarylogic_epi64 (__mmask8 __U, __m128i __A,
- __m128i __B, __m128i __C, const int __imm)
+ __m128i __B, __m128i __C,
+ const int __imm)
{
- return (__m128i) __builtin_ia32_pternlogq128_maskz ((__v2di) __A,
- (__v2di) __B,
- (__v2di) __C,
- __imm,
- (__mmask8) __U);
+ return (__m128i)
+ __builtin_ia32_pternlogq128_maskz ((__v2di) __A,
+ (__v2di) __B,
+ (__v2di) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m128i
@@ -10681,33 +10698,40 @@ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_ternarylogic_epi32 (__m128i __A, __m128i __B, __m128i __C,
const int __imm)
{
- return (__m128i) __builtin_ia32_pternlogd128_mask ((__v4si) __A,
- (__v4si) __B,
- (__v4si) __C, __imm,
- (__mmask8) -1);
+ return (__m128i)
+ __builtin_ia32_pternlogd128_mask ((__v4si) __A,
+ (__v4si) __B,
+ (__v4si) __C,
+ (unsigned char) __imm,
+ (__mmask8) -1);
}
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_mask_ternarylogic_epi32 (__m128i __A, __mmask8 __U,
- __m128i __B, __m128i __C, const int __imm)
+ __m128i __B, __m128i __C,
+ const int __imm)
{
- return (__m128i) __builtin_ia32_pternlogd128_mask ((__v4si) __A,
- (__v4si) __B,
- (__v4si) __C, __imm,
- (__mmask8) __U);
+ return (__m128i)
+ __builtin_ia32_pternlogd128_mask ((__v4si) __A,
+ (__v4si) __B,
+ (__v4si) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m128i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_maskz_ternarylogic_epi32 (__mmask8 __U, __m128i __A,
- __m128i __B, __m128i __C, const int __imm)
+ __m128i __B, __m128i __C,
+ const int __imm)
{
- return (__m128i) __builtin_ia32_pternlogd128_maskz ((__v4si) __A,
- (__v4si) __B,
- (__v4si) __C,
- __imm,
- (__mmask8) __U);
+ return (__m128i)
+ __builtin_ia32_pternlogd128_maskz ((__v4si) __A,
+ (__v4si) __B,
+ (__v4si) __C,
+ (unsigned char) __imm,
+ (__mmask8) __U);
}
extern __inline __m256
@@ -12910,53 +12934,101 @@ _mm256_permutex_pd (__m256d __X, const int __M)
(__v2di)(__m128i)_mm_setzero_si128 (),\
(__mmask8)(U)))
-#define _mm256_ternarylogic_epi64(A, B, C, I) \
- ((__m256i) __builtin_ia32_pternlogq256_mask ((__v4di)(__m256i)(A), \
- (__v4di)(__m256i)(B), (__v4di)(__m256i)(C), (int)(I), (__mmask8)-1))
-
-#define _mm256_mask_ternarylogic_epi64(A, U, B, C, I) \
- ((__m256i) __builtin_ia32_pternlogq256_mask ((__v4di)(__m256i)(A), \
- (__v4di)(__m256i)(B), (__v4di)(__m256i)(C), (int)(I), (__mmask8)(U)))
-
-#define _mm256_maskz_ternarylogic_epi64(U, A, B, C, I) \
- ((__m256i) __builtin_ia32_pternlogq256_maskz ((__v4di)(__m256i)(A), \
- (__v4di)(__m256i)(B), (__v4di)(__m256i)(C), (int)(I), (__mmask8)(U)))
-
-#define _mm256_ternarylogic_epi32(A, B, C, I) \
- ((__m256i) __builtin_ia32_pternlogd256_mask ((__v8si)(__m256i)(A), \
- (__v8si)(__m256i)(B), (__v8si)(__m256i)(C), (int)(I), (__mmask8)-1))
-
-#define _mm256_mask_ternarylogic_epi32(A, U, B, C, I) \
- ((__m256i) __builtin_ia32_pternlogd256_mask ((__v8si)(__m256i)(A), \
- (__v8si)(__m256i)(B), (__v8si)(__m256i)(C), (int)(I), (__mmask8)(U)))
-
-#define _mm256_maskz_ternarylogic_epi32(U, A, B, C, I) \
- ((__m256i) __builtin_ia32_pternlogd256_maskz ((__v8si)(__m256i)(A), \
- (__v8si)(__m256i)(B), (__v8si)(__m256i)(C), (int)(I), (__mmask8)(U)))
-
-#define _mm_ternarylogic_epi64(A, B, C, I) \
- ((__m128i) __builtin_ia32_pternlogq128_mask ((__v2di)(__m128i)(A), \
- (__v2di)(__m128i)(B), (__v2di)(__m128i)(C), (int)(I), (__mmask8)-1))
-
-#define _mm_mask_ternarylogic_epi64(A, U, B, C, I) \
- ((__m128i) __builtin_ia32_pternlogq128_mask ((__v2di)(__m128i)(A), \
- (__v2di)(__m128i)(B), (__v2di)(__m128i)(C), (int)(I), (__mmask8)(U)))
-
-#define _mm_maskz_ternarylogic_epi64(U, A, B, C, I) \
- ((__m128i) __builtin_ia32_pternlogq128_maskz ((__v2di)(__m128i)(A), \
- (__v2di)(__m128i)(B), (__v2di)(__m128i)(C), (int)(I), (__mmask8)(U)))
-
-#define _mm_ternarylogic_epi32(A, B, C, I) \
- ((__m128i) __builtin_ia32_pternlogd128_mask ((__v4si)(__m128i)(A), \
- (__v4si)(__m128i)(B), (__v4si)(__m128i)(C), (int)(I), (__mmask8)-1))
-
-#define _mm_mask_ternarylogic_epi32(A, U, B, C, I) \
- ((__m128i) __builtin_ia32_pternlogd128_mask ((__v4si)(__m128i)(A), \
- (__v4si)(__m128i)(B), (__v4si)(__m128i)(C), (int)(I), (__mmask8)(U)))
-
-#define _mm_maskz_ternarylogic_epi32(U, A, B, C, I) \
- ((__m128i) __builtin_ia32_pternlogd128_maskz ((__v4si)(__m128i)(A), \
- (__v4si)(__m128i)(B), (__v4si)(__m128i)(C), (int)(I), (__mmask8)(U)))
+#define _mm256_ternarylogic_epi64(A, B, C, I) \
+ ((__m256i) \
+ __builtin_ia32_pternlogq256_mask ((__v4di) (__m256i) (A), \
+ (__v4di) (__m256i) (B), \
+ (__v4di) (__m256i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) -1))
+
+#define _mm256_mask_ternarylogic_epi64(A, U, B, C, I) \
+ ((__m256i) \
+ __builtin_ia32_pternlogq256_mask ((__v4di) (__m256i) (A), \
+ (__v4di) (__m256i) (B), \
+ (__v4di) (__m256i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+
+#define _mm256_maskz_ternarylogic_epi64(U, A, B, C, I) \
+ ((__m256i) \
+ __builtin_ia32_pternlogq256_maskz ((__v4di) (__m256i) (A), \
+ (__v4di) (__m256i) (B), \
+ (__v4di) (__m256i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+
+#define _mm256_ternarylogic_epi32(A, B, C, I) \
+ ((__m256i) \
+ __builtin_ia32_pternlogd256_mask ((__v8si) (__m256i) (A), \
+ (__v8si) (__m256i) (B), \
+ (__v8si) (__m256i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) -1))
+
+#define _mm256_mask_ternarylogic_epi32(A, U, B, C, I) \
+ ((__m256i) \
+ __builtin_ia32_pternlogd256_mask ((__v8si) (__m256i) (A), \
+ (__v8si) (__m256i) (B), \
+ (__v8si) (__m256i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+
+#define _mm256_maskz_ternarylogic_epi32(U, A, B, C, I) \
+ ((__m256i) \
+ __builtin_ia32_pternlogd256_maskz ((__v8si) (__m256i) (A), \
+ (__v8si) (__m256i) (B), \
+ (__v8si) (__m256i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+
+#define _mm_ternarylogic_epi64(A, B, C, I) \
+ ((__m128i) \
+ __builtin_ia32_pternlogq128_mask ((__v2di) (__m128i) (A), \
+ (__v2di) (__m128i) (B), \
+ (__v2di) (__m128i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) -1))
+
+#define _mm_mask_ternarylogic_epi64(A, U, B, C, I) \
+ ((__m128i) \
+ __builtin_ia32_pternlogq128_mask ((__v2di) (__m128i) (A), \
+ (__v2di) (__m128i) (B), \
+ (__v2di) (__m128i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+
+#define _mm_maskz_ternarylogic_epi64(U, A, B, C, I) \
+ ((__m128i) \
+ __builtin_ia32_pternlogq128_maskz ((__v2di) (__m128i) (A), \
+ (__v2di) (__m128i) (B), \
+ (__v2di) (__m128i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+
+#define _mm_ternarylogic_epi32(A, B, C, I) \
+ ((__m128i) \
+ __builtin_ia32_pternlogd128_mask ((__v4si) (__m128i) (A), \
+ (__v4si) (__m128i) (B), \
+ (__v4si) (__m128i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) -1))
+
+#define _mm_mask_ternarylogic_epi32(A, U, B, C, I) \
+ ((__m128i) \
+ __builtin_ia32_pternlogd128_mask ((__v4si) (__m128i) (A), \
+ (__v4si) (__m128i) (B), \
+ (__v4si) (__m128i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
+
+#define _mm_maskz_ternarylogic_epi32(U, A, B, C, I) \
+ ((__m128i) \
+ __builtin_ia32_pternlogd128_maskz ((__v4si) (__m128i) (A), \
+ (__v4si) (__m128i) (B), \
+ (__v4si) (__m128i) (C), \
+ (unsigned char) (I), \
+ (__mmask8) (U)))
#define _mm256_roundscale_ps(A, B) \
((__m256) __builtin_ia32_rndscaleps_256_mask ((__v8sf)(__m256)(A), \