Fix GFNI check which didn't work properly in gfni+sse case
authorJulia Koval <julia.koval@intel.com>
Thu, 16 Nov 2017 06:14:54 +0000 (07:14 +0100)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Thu, 16 Nov 2017 06:14:54 +0000 (06:14 +0000)
gcc/
PR target/82983
* config/i386/gfniintrin.h: Add sse check.
* config/i386/i386.c (ix86_expand_builtin): Fix gfni check.

From-SVN: r254797

gcc/ChangeLog
gcc/config/i386/gfniintrin.h
gcc/config/i386/i386.c

index 8a716afb006666cfe6d537577cac193985ad28b5..0068c53d062fb3abddbfd814afc976a1291a40cb 100644 (file)
@@ -1,3 +1,9 @@
+2017-11-16  Julia Koval  <julia.koval@intel.com>
+
+       PR target/82983
+       * config/i386/gfniintrin.h: Add sse check.
+       * config/i386/i386.c (ix86_expand_builtin): Fix gfni check.
+
 2017-11-16  Julia Koval  <julia.koval@intel.com>
 
        * common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512VBMI2_SET,
index dc07428398a6918a36af56d98418502ef171a3e1..e9fea2ef00a7847ce87a27ae53d959a0ea0e1f19 100644 (file)
@@ -28,9 +28,9 @@
 #ifndef _GFNIINTRIN_H_INCLUDED
 #define _GFNIINTRIN_H_INCLUDED
 
-#ifndef __GFNI__
+#if !defined(__GFNI__) || !defined(__SSE__)
 #pragma GCC push_options
-#pragma GCC target("gfni")
+#pragma GCC target("gfni,sse")
 #define __DISABLE_GFNI__
 #endif /* __GFNI__ */
 
index 7d4cc61bf4ae0b9bd0a329a4ca73ebd07657b367..b2c2934bcf0062c86a222ae626e85099aef4024f 100644 (file)
@@ -35191,6 +35191,8 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget,
            & ix86_isa_flags))
       || ((ix86_builtins_isa[fcode].isa & OPTION_MASK_ISA_AVX512VL)
          && !(ix86_isa_flags & OPTION_MASK_ISA_AVX512VL))
+      || ((ix86_builtins_isa[fcode].isa & OPTION_MASK_ISA_GFNI)
+         && !(ix86_isa_flags & OPTION_MASK_ISA_GFNI))
       || ((ix86_builtins_isa[fcode].isa & OPTION_MASK_ISA_MMX)
          && !(ix86_isa_flags & OPTION_MASK_ISA_MMX))
       || (ix86_builtins_isa[fcode].isa2