r331682 - [X86] Make _mm256_gf2p8mul_epi8 require avx features since its 256 bits.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon May 7 14:47:11 PDT 2018


Author: ctopper
Date: Mon May  7 14:47:11 2018
New Revision: 331682

URL: http://llvm.org/viewvc/llvm-project?rev=331682&view=rev
Log:
[X86] Make _mm256_gf2p8mul_epi8 require avx features since its 256 bits.

Without this we throw an error on the header file instead of the user code when the right features aren't enabled in clang.

Rename the other DEFAULT_FN_ATTRS defines to _Z for 512-bit since I used _Y for this case.

Modified:
    cfe/trunk/lib/Headers/gfniintrin.h

Modified: cfe/trunk/lib/Headers/gfniintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/gfniintrin.h?rev=331682&r1=331681&r2=331682&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/gfniintrin.h (original)
+++ cfe/trunk/lib/Headers/gfniintrin.h Mon May  7 14:47:11 2018
@@ -122,8 +122,11 @@
 /* Default attributes for simple form (no masking). */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("gfni")))
 
+/* Default attributes for YMM unmasked form. */
+#define __DEFAULT_FN_ATTRS_Y __attribute__((__always_inline__, __nodebug__, __target__("avx,gfni")))
+
 /* Default attributes for ZMM forms. */
-#define __DEFAULT_FN_ATTRS_F __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni")))
+#define __DEFAULT_FN_ATTRS_Z __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,gfni")))
 
 /* Default attributes for VLX forms. */
 #define __DEFAULT_FN_ATTRS_VL __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,avx512vl,gfni")))
@@ -150,7 +153,7 @@ _mm_maskz_gf2p8mul_epi8(__mmask16 __U, _
               __U, __A, __B);
 }
 
-static __inline__ __m256i __DEFAULT_FN_ATTRS
+static __inline__ __m256i __DEFAULT_FN_ATTRS_Y
 _mm256_gf2p8mul_epi8(__m256i __A, __m256i __B)
 {
   return (__m256i) __builtin_ia32_vgf2p8mulb_v32qi((__v32qi) __A,
@@ -172,14 +175,14 @@ _mm256_maskz_gf2p8mul_epi8(__mmask32 __U
               __U, __A, __B);
 }
 
-static __inline__ __m512i __DEFAULT_FN_ATTRS_F
+static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
 _mm512_gf2p8mul_epi8(__m512i __A, __m512i __B)
 {
   return (__m512i) __builtin_ia32_vgf2p8mulb_v64qi((__v64qi) __A,
               (__v64qi) __B);
 }
 
-static __inline__ __m512i __DEFAULT_FN_ATTRS_F
+static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
 _mm512_mask_gf2p8mul_epi8(__m512i __S, __mmask64 __U, __m512i __A, __m512i __B)
 {
   return (__m512i) __builtin_ia32_selectb_512(__U,
@@ -187,7 +190,7 @@ _mm512_mask_gf2p8mul_epi8(__m512i __S, _
               (__v64qi) __S);
 }
 
-static __inline__ __m512i __DEFAULT_FN_ATTRS_F
+static __inline__ __m512i __DEFAULT_FN_ATTRS_Z
 _mm512_maskz_gf2p8mul_epi8(__mmask64 __U, __m512i __A, __m512i __B)
 {
   return _mm512_mask_gf2p8mul_epi8((__m512i)_mm512_setzero_qi(),
@@ -195,7 +198,8 @@ _mm512_maskz_gf2p8mul_epi8(__mmask64 __U
 }
 
 #undef __DEFAULT_FN_ATTRS
-#undef __DEFAULT_FN_ATTRS_F
+#undef __DEFAULT_FN_ATTRS_Y
+#undef __DEFAULT_FN_ATTRS_Z
 #undef __DEFAULT_FN_ATTRS_VL
 
 #endif // __GFNIINTRIN_H




More information about the cfe-commits mailing list