diff --git a/clang/lib/Headers/gfniintrin.h b/clang/lib/Headers/gfniintrin.h --- a/clang/lib/Headers/gfniintrin.h +++ b/clang/lib/Headers/gfniintrin.h @@ -20,22 +20,27 @@ (__v16qi)(__m128i)(B), \ (char)(I)) +#ifdef __AVXINTRIN_H +#ifdef __AVX512BWINTRIN_H +#ifdef __AVX512VLINTRIN_H #define _mm_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \ (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \ (__v16qi)_mm_gf2p8affineinv_epi64_epi8(A, B, I), \ (__v16qi)(__m128i)(S)) - #define _mm_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \ (__m128i)_mm_mask_gf2p8affineinv_epi64_epi8((__m128i)_mm_setzero_si128(), \ U, A, B, I) - +#endif /* __AVX512VLINTRIN_H */ +#endif /* __AVX512BWINTRIN_H */ #define _mm256_gf2p8affineinv_epi64_epi8(A, B, I) \ (__m256i)__builtin_ia32_vgf2p8affineinvqb_v32qi((__v32qi)(__m256i)(A), \ (__v32qi)(__m256i)(B), \ (char)(I)) +#ifdef __AVX512BWINTRIN_H +#ifdef __AVX512VLINTRIN_H #define _mm256_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \ (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \ (__v32qi)_mm256_gf2p8affineinv_epi64_epi8(A, B, I), \ @@ -44,13 +49,14 @@ #define _mm256_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \ (__m256i)_mm256_mask_gf2p8affineinv_epi64_epi8((__m256i)_mm256_setzero_si256(), \ U, A, B, I) - +#endif #define _mm512_gf2p8affineinv_epi64_epi8(A, B, I) \ (__m512i)__builtin_ia32_vgf2p8affineinvqb_v64qi((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), \ (char)(I)) +#ifdef __AVX512VLINTRIN_H #define _mm512_mask_gf2p8affineinv_epi64_epi8(S, U, A, B, I) \ (__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \ (__v64qi)_mm512_gf2p8affineinv_epi64_epi8(A, B, I), \ @@ -59,12 +65,18 @@ #define _mm512_maskz_gf2p8affineinv_epi64_epi8(U, A, B, I) \ (__m512i)_mm512_mask_gf2p8affineinv_epi64_epi8((__m512i)_mm512_setzero_si512(), \ U, A, B, I) +#endif /* __AVX512VLINTRIN_H */ +#endif /* __AVX512BWINTRIN_H */ +#endif /* __AVXINTRIN_H */ #define _mm_gf2p8affine_epi64_epi8(A, B, I) \ (__m128i)__builtin_ia32_vgf2p8affineqb_v16qi((__v16qi)(__m128i)(A), \ (__v16qi)(__m128i)(B), \ (char)(I)) +#ifdef __AVXINTRIN_H +#ifdef __AVX512BWINTRIN_H +#ifdef __AVX512VLINTRIN_H #define _mm_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \ (__m128i)__builtin_ia32_selectb_128((__mmask16)(U), \ (__v16qi)_mm_gf2p8affine_epi64_epi8(A, B, I), \ @@ -74,13 +86,16 @@ #define _mm_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \ (__m128i)_mm_mask_gf2p8affine_epi64_epi8((__m128i)_mm_setzero_si128(), \ U, A, B, I) - +#endif /* __AVX512VLINTRIN_H */ +#endif /* __AVX512BWINTRIN_H */ #define _mm256_gf2p8affine_epi64_epi8(A, B, I) \ (__m256i)__builtin_ia32_vgf2p8affineqb_v32qi((__v32qi)(__m256i)(A), \ (__v32qi)(__m256i)(B), \ (char)(I)) +#ifdef __AVX512BWINTRIN_H +#ifdef __AVX512VLINTRIN_H #define _mm256_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \ (__m256i)__builtin_ia32_selectb_256((__mmask32)(U), \ (__v32qi)_mm256_gf2p8affine_epi64_epi8(A, B, I), \ @@ -89,13 +104,14 @@ #define _mm256_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \ (__m256i)_mm256_mask_gf2p8affine_epi64_epi8((__m256i)_mm256_setzero_si256(), \ U, A, B, I) - +#endif /* __AVX512VLINTRIN_H */ #define _mm512_gf2p8affine_epi64_epi8(A, B, I) \ (__m512i)__builtin_ia32_vgf2p8affineqb_v64qi((__v64qi)(__m512i)(A), \ (__v64qi)(__m512i)(B), \ (char)(I)) +#ifdef __AVX512VLINTRIN_H #define _mm512_mask_gf2p8affine_epi64_epi8(S, U, A, B, I) \ (__m512i)__builtin_ia32_selectb_512((__mmask64)(U), \ (__v64qi)_mm512_gf2p8affine_epi64_epi8(A, B, I), \ @@ -104,6 +120,9 @@ #define _mm512_maskz_gf2p8affine_epi64_epi8(U, A, B, I) \ (__m512i)_mm512_mask_gf2p8affine_epi64_epi8((__m512i)_mm512_setzero_si512(), \ U, A, B, I) +#endif /* __AVX512VLINTRIN_H */ +#endif /* __AVX512BWINTRIN_H */ +#endif /* __AVXINTRIN_H */ /* Default attributes for simple form (no masking). */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("gfni"), __min_vector_width__(128))) @@ -125,6 +144,9 @@ (__v16qi) __B); } +#ifdef __AVXINTRIN_H +#ifdef __AVX512BWINTRIN_H +#ifdef __AVX512VLINTRIN_H static __inline__ __m128i __DEFAULT_FN_ATTRS_VL128 _mm_mask_gf2p8mul_epi8(__m128i __S, __mmask16 __U, __m128i __A, __m128i __B) { @@ -139,6 +161,8 @@ return _mm_mask_gf2p8mul_epi8((__m128i)_mm_setzero_si128(), __U, __A, __B); } +#endif /* __AVX512VLINTRIN_H */ +#endif /* __AVX512BWINTRIN_H */ static __inline__ __m256i __DEFAULT_FN_ATTRS_Y _mm256_gf2p8mul_epi8(__m256i __A, __m256i __B) @@ -147,6 +171,8 @@ (__v32qi) __B); } +#ifdef __AVX512BWINTRIN_H +#ifdef __AVX512VLINTRIN_H static __inline__ __m256i __DEFAULT_FN_ATTRS_VL256 _mm256_mask_gf2p8mul_epi8(__m256i __S, __mmask32 __U, __m256i __A, __m256i __B) { @@ -161,6 +187,7 @@ return _mm256_mask_gf2p8mul_epi8((__m256i)_mm256_setzero_si256(), __U, __A, __B); } +#endif static __inline__ __m512i __DEFAULT_FN_ATTRS_Z _mm512_gf2p8mul_epi8(__m512i __A, __m512i __B) @@ -169,6 +196,7 @@ (__v64qi) __B); } +#ifdef __AVX512VLINTRIN_H static __inline__ __m512i __DEFAULT_FN_ATTRS_Z _mm512_mask_gf2p8mul_epi8(__m512i __S, __mmask64 __U, __m512i __A, __m512i __B) { @@ -183,6 +211,9 @@ return _mm512_mask_gf2p8mul_epi8((__m512i)_mm512_setzero_si512(), __U, __A, __B); } +#endif /* __AVX512VLINTRIN_H */ +#endif /* __AVX512BWINTRIN_H */ +#endif /* __AVXINTRIN_H */ #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_Y