Add builtin_cpu for cannonlake and new isa features.
authorJulia Koval <julia.koval@intel.com>
Thu, 15 Mar 2018 07:52:36 +0000 (08:52 +0100)
committerJulia Koval <jkoval@gcc.gnu.org>
Thu, 15 Mar 2018 07:52:36 +0000 (08:52 +0100)
gcc/
* config/i386/i386.c (F_AVX512VBMI2, F_GFNI, F_VPCLMULQDQ,
F_AVX512VNNI, F_AVX512BITALG): New.

gcc/testsuite/
* gcc.target/i386/builtin_target.c (check_intel_cpu_model): Add
cannonlake.
(check_features): Add avx512vbmi2, gfni, vpclmulqdq, avx512vnni,
avx512bitalg.

libgcc/
* config/i386/cpuinfo.c (get_available_features): Add
FEATURE_AVX512VBMI2, FEATURE_GFNI, FEATURE_VPCLMULQDQ,
FEATURE_AVX512VNNI, FEATURE_AVX512BITALG.
* config/i386/cpuinfo.h (processor_features) Add
FEATURE_AVX512VBMI2, FEATURE_GFNI, FEATURE_VPCLMULQDQ,
FEATURE_AVX512VNNI, FEATURE_AVX512BITALG.

From-SVN: r258551

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/builtin_target.c
libgcc/ChangeLog
libgcc/config/i386/cpuinfo.c
libgcc/config/i386/cpuinfo.h

index ea4b6640e248b05e8c9a69b440a03661ea163424..b4dde6ea8b449627e5451f2c4c2f3cc34715ead4 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-15  Julia Koval  <julia.koval@intel.com>
+
+       * config/i386/i386.c (F_AVX512VBMI2, F_GFNI, F_VPCLMULQDQ,
+       F_AVX512VNNI, F_AVX512BITALG): New.
+
 2018-03-14  John David Anglin  <danglin@gcc.gnu.org>
 
        PR target/83451
index a87e5d5ad79873ea1afd6e7e186be9b4a17d5476..1b57cc6c851b65e559ad19a9c2758ba64114d44f 100644 (file)
@@ -33086,6 +33086,11 @@ fold_builtin_cpu (tree fndecl, tree *args)
     F_AVX5124VNNIW,
     F_AVX5124FMAPS,
     F_AVX512VPOPCNTDQ,
+    F_AVX512VBMI2,
+    F_GFNI,
+    F_VPCLMULQDQ,
+    F_AVX512VNNI,
+    F_AVX512BITALG,
     F_MAX
   };
 
@@ -33210,7 +33215,12 @@ fold_builtin_cpu (tree fndecl, tree *args)
       {"avx512ifma",F_AVX512IFMA},
       {"avx5124vnniw",F_AVX5124VNNIW},
       {"avx5124fmaps",F_AVX5124FMAPS},
-      {"avx512vpopcntdq",F_AVX512VPOPCNTDQ}
+      {"avx512vpopcntdq",F_AVX512VPOPCNTDQ},
+      {"avx512vbmi2", F_AVX512VBMI2},
+      {"gfni", F_GFNI},
+      {"vpclmulqdq", F_VPCLMULQDQ},
+      {"avx512vnni", F_AVX512VNNI},
+      {"avx512bitalg", F_AVX512BITALG}
     };
 
   tree __processor_model_type = build_processor_model_struct ();
index b2da077edb1e92ec54627226581c299626fecc71..4962ff5f4078ea65db573bfe2ad9af69aae88f39 100644 (file)
@@ -1,3 +1,10 @@
+2018-03-15  Julia Koval  <julia.koval@intel.com>
+
+       * gcc.target/i386/builtin_target.c (check_intel_cpu_model): Add
+       cannonlake.
+       (check_features): Add avx512vbmi2, gfni, vpclmulqdq, avx512vnni,
+       avx512bitalg.
+
 2018-03-15  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/84853
index 8fa97973ef880ed34c33b19dda6e2211b5283f2d..869bd947529c8cf863d75732afe4eb8a62c78fdc 100644 (file)
@@ -103,6 +103,10 @@ check_intel_cpu_model (unsigned int family, unsigned int model,
              assert (__builtin_cpu_is ("corei7"));
              assert (__builtin_cpu_is ("skylake-avx512"));
              break;
+           case 0x66:
+             /* Cannon Lake.  */
+             assert (__builtin_cpu_is ("cannonlake"));
+             break;
            case 0x17:
            case 0x1d:
              /* Penryn.  */
@@ -228,6 +232,16 @@ check_features (unsigned int ecx, unsigned int edx,
        assert (__builtin_cpu_supports ("avx512ifma"));
       if (ecx & bit_AVX512VBMI)
        assert (__builtin_cpu_supports ("avx512vbmi"));
+      if (ecx & bit_AVX512VBMI2)
+       assert (__builtin_cpu_supports ("avx512vbmi2"));
+      if (ecx & bit_GFNI)
+       assert (__builtin_cpu_supports ("gfni"));
+      if (ecx & bit_VPCLMULQDQ)
+       assert (__builtin_cpu_supports ("vpclmulqdq"));
+      if (ecx & bit_AVX512VNNI)
+       assert (__builtin_cpu_supports ("avx512vnni"));
+      if (ecx & bit_AVX512BITALG)
+       assert (__builtin_cpu_supports ("avx512bitalg"));
       if (ecx & bit_AVX512VPOPCNTDQ)
        assert (__builtin_cpu_supports ("avx512vpopcntdq"));
       if (edx & bit_AVX5124VNNIW)
index 88641125942501d57ae0ff61ab662a77b3964d00..40407abef7c45367746fe52567b8ef99db1c4633 100644 (file)
@@ -1,3 +1,12 @@
+2018-03-15  Julia Koval  <julia.koval@intel.com>
+
+       * config/i386/cpuinfo.c (get_available_features): Add
+       FEATURE_AVX512VBMI2, FEATURE_GFNI, FEATURE_VPCLMULQDQ,
+       FEATURE_AVX512VNNI, FEATURE_AVX512BITALG.
+       * config/i386/cpuinfo.h (processor_features): Add FEATURE_AVX512VBMI2,
+       FEATURE_GFNI, FEATURE_VPCLMULQDQ, FEATURE_AVX512VNNI,
+       FEATURE_AVX512BITALG.
+
 2018-03-14  Julia Koval  <julia.koval@intel.com>
 
        * config/i386/cpuinfo.h (processor_subtypes): Split up icelake on
index a8821af704e3bc753002e11a898e9d8c0dfeeea0..8a6eef599112d0a9ac60c557f5a006ff1bb97290 100644 (file)
@@ -287,6 +287,16 @@ get_available_features (unsigned int ecx, unsigned int edx,
        features |= (1 << FEATURE_AVX512IFMA);
       if (ecx & bit_AVX512VBMI)
        features |= (1 << FEATURE_AVX512VBMI);
+      if (ecx & bit_AVX512VBMI2)
+       features |= (1 << FEATURE_AVX512VBMI2);
+      if (ecx & bit_GFNI)
+       features |= (1 << FEATURE_GFNI);
+      if (ecx & bit_VPCLMULQDQ)
+       features |= (1 << FEATURE_VPCLMULQDQ);
+      if (ecx & bit_AVX512VNNI)
+       features |= (1 << FEATURE_AVX512VNNI);
+      if (ecx & bit_AVX512BITALG)
+       features |= (1 << FEATURE_AVX512BITALG);
       if (ecx & bit_AVX512VPOPCNTDQ)
        features |= (1 << FEATURE_AVX512VPOPCNTDQ);
       if (edx & bit_AVX5124VNNIW)
index 17e2abf2a00dccdfdb2ba41fb327904db6180623..371c8f60bb2a2dc9f5017131c215c4dffbeacad7 100644 (file)
@@ -109,7 +109,12 @@ enum processor_features
   FEATURE_AVX512IFMA,
   FEATURE_AVX5124VNNIW,
   FEATURE_AVX5124FMAPS,
-  FEATURE_AVX512VPOPCNTDQ
+  FEATURE_AVX512VPOPCNTDQ,
+  FEATURE_AVX512VBMI2,
+  FEATURE_GFNI,
+  FEATURE_VPCLMULQDQ,
+  FEATURE_AVX512VNNI,
+  FEATURE_AVX512BITALG
 };
 
 extern struct __processor_model