driver-i386.c (host_detect_local_cpu): Detect cascadelake.
authorWei Xiao <wei3.xiao@intel.com>
Tue, 18 Dec 2018 03:41:44 +0000 (03:41 +0000)
committerXuepeng Guo <xguo@gcc.gnu.org>
Tue, 18 Dec 2018 03:41:44 +0000 (03:41 +0000)
gcc/ChangeLog
2018-12-18  Wei Xiao  <wei3.xiao@intel.com>

* config/i386/driver-i386.c (host_detect_local_cpu): Detect cascadelake.
* config/i386/i386.c (fold_builtin_cpu): Handle cascadelake.
* doc/extend.texi: Add cascadelake.

gcc/testsuite/ChangeLog
2018-12-18  Wei Xiao  <wei3.xiao@intel.com>

* g++.target/i386/mv16.C: Handle new march.
* gcc.target/i386/builtin_target.c: Ditto.

libgcc/ChangeLog
2018-12-18  Wei Xiao  <wei3.xiao@intel.com>

* config/i386/cpuinfo.c (get_intel_cpu): Handle cascadelake.
* config/i386/cpuinfo.h: Add INTEL_COREI7_CASCADELAKE.

From-SVN: r267226

gcc/ChangeLog
gcc/config/i386/driver-i386.c
gcc/config/i386/i386.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.target/i386/mv16.C
gcc/testsuite/gcc.target/i386/builtin_target.c
libgcc/ChangeLog
libgcc/config/i386/cpuinfo.c
libgcc/config/i386/cpuinfo.h

index 625429c31c04889a8112eda7e14bf1610d80f20b..6801995021e40d7bd6b71392f3a684eb91251cb7 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-18  Wei Xiao  <wei3.xiao@intel.com>
+
+       * config/i386/driver-i386.c (host_detect_local_cpu): Detect cascadelake.
+       * config/i386/i386.c (fold_builtin_cpu): Handle cascadelake.
+       * doc/extend.texi: Add cascadelake.
 2018-12-17  Peter Bergner  <bergner@linux.ibm.com>
 
        PR target/87870
index e910038d11d5c8cd052efe74cf57a5d6b1d72135..19a8aba6a12a529ea73add62dbfb50a4cfdf061c 100644 (file)
@@ -832,8 +832,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)
          cpu = "skylake";
          break;
        case 0x55:
-         /* Skylake with AVX-512.  */
-         cpu = "skylake-avx512";
+         if (has_avx512vnni)
+           /* Cascade Lake.  */
+           cpu = "cascadelake";
+         else
+           /* Skylake with AVX-512.  */
+           cpu = "skylake-avx512";
          break;
        case 0x57:
          /* Knights Landing.  */
index b9c459198b4245b51643b5d01a708edac0bf7d40..1a4c407040ac03ed085800befe7f72490dcfa8e8 100644 (file)
@@ -32393,7 +32393,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
     M_INTEL_COREI7_CANNONLAKE,
     M_INTEL_COREI7_ICELAKE_CLIENT,
     M_INTEL_COREI7_ICELAKE_SERVER,
-    M_AMDFAM17H_ZNVER2
+    M_AMDFAM17H_ZNVER2,
+    M_INTEL_COREI7_CASCADELAKE
   };
 
   static struct _arch_names_table
@@ -32420,6 +32421,7 @@ fold_builtin_cpu (tree fndecl, tree *args)
       {"cannonlake", M_INTEL_COREI7_CANNONLAKE},
       {"icelake-client", M_INTEL_COREI7_ICELAKE_CLIENT},
       {"icelake-server", M_INTEL_COREI7_ICELAKE_SERVER},
+      {"cascadelake", M_INTEL_COREI7_CASCADELAKE},
       {"bonnell", M_INTEL_BONNELL},
       {"silvermont", M_INTEL_SILVERMONT},
       {"goldmont", M_INTEL_GOLDMONT},
index 4bc90fa5d7592f3b475305779b2a00d3830fb3ed..5d8fc94aaa7c4189606f969b197b0f7cb8680ffd 100644 (file)
@@ -20768,6 +20768,9 @@ Intel Core i7 Ice Lake Client CPU.
 @item icelake-server
 Intel Core i7 Ice Lake Server CPU.
 
+@item cascadelake
+Intel Core i7 Cascadelake CPU.
+
 @item bonnell
 Intel Atom Bonnell CPU.
 
index 77787b2c8c79959cef7a7f7af96a66b2a0269793..4f6358b9384273a077344e479711737a41cec2ad 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-18  Wei Xiao  <wei3.xiao@intel.com>
+
+       * g++.target/i386/mv16.C: Handle new march.
+       * gcc.target/i386/builtin_target.c: Ditto.
+
 2018-12-17  Peter Bergner  <bergner@linux.ibm.com>
 
        PR target/87870
index 1091868a29ce24b8c7bab59d80f14bb713b212a2..81e15115f27f77d45dedd1fbc16d79d9e19f5147 100644 (file)
@@ -68,6 +68,10 @@ int __attribute__ ((target("arch=icelake-server"))) foo () {
   return 18;
 }
 
+int __attribute__ ((target("arch=cascadelake"))) foo () {
+  return 19;
+}
+
 int main ()
 {
   int val = foo ();
@@ -94,6 +98,8 @@ int main ()
     assert (val == 17);
   else if (__builtin_cpu_is ("icelake-server"))
     assert (val == 18);
+  else if (__builtin_cpu_is ("cascadelake"))
+    assert (val == 19);
   else
     assert (val == 0);
 
index 1a7a9f3124fca6280a0b05e9bac7a4b680c6b4f9..d39626611a7672f8bb70b27ef714a3f40aa83235 100644 (file)
@@ -108,10 +108,18 @@ check_intel_cpu_model (unsigned int family, unsigned int model,
              assert (__builtin_cpu_is ("skylake"));
              break;
            case 0x55:
-             /* Skylake with AVX-512 support.  */
-             assert (__builtin_cpu_is ("corei7"));
-             assert (__builtin_cpu_is ("skylake-avx512"));
-             break;
+             {
+               unsigned int eax, ebx, ecx, edx;
+               __cpuid_count (7, 0, eax, ebx, ecx, edx);
+               assert (__builtin_cpu_is ("corei7"));
+               if (ecx & bit_AVX512VNNI)
+                 /* Cascade Lake.  */
+                 assert (__builtin_cpu_is ("cascadelake"));
+               else
+                 /* Skylake with AVX-512 support.  */
+                 assert (__builtin_cpu_is ("skylake-avx512"));
+               break;
+             }
            case 0x66:
              /* Cannon Lake.  */
              assert (__builtin_cpu_is ("cannonlake"));
index 24b7c9ac4a5ae004232ba7cc75cbc4b09b6d50ee..2075567766db33f1085e84cb4ecd5bb09ccef433 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-18  Wei Xiao  <wei3.xiao@intel.com>
+
+       * config/i386/cpuinfo.c (get_intel_cpu): Handle cascadelake.
+       * config/i386/cpuinfo.h: Add INTEL_COREI7_CASCADELAKE.
+
 2018-12-12  Rasmus Villemoes  <rv@rasmusvillemoes.dk>
 
        * config/rs6000/tramp.S (__trampoline_setup): Also emit .size
index 09f4d6f154e26a57e112e6e65c0dfe17d6f7f61d..3a5631501194dcb4809602f34923e5d1c34d4ceb 100644 (file)
@@ -215,9 +215,17 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id)
              __cpu_model.__cpu_subtype = INTEL_COREI7_SKYLAKE;
              break;
            case 0x55:
-             /* Skylake with AVX-512 support.  */
-             __cpu_model.__cpu_type = INTEL_COREI7;
-             __cpu_model.__cpu_subtype = INTEL_COREI7_SKYLAKE_AVX512;
+             {
+               unsigned int eax, ebx, ecx, edx;
+               __cpu_model.__cpu_type = INTEL_COREI7;
+               __cpuid_count (7, 0, eax, ebx, ecx, edx);
+               if (ecx & bit_AVX512VNNI)
+                 /* Cascade Lake.  */
+                 __cpu_model.__cpu_subtype = INTEL_COREI7_CASCADELAKE;
+               else
+                 /* Skylake with AVX-512 support.  */
+                 __cpu_model.__cpu_subtype = INTEL_COREI7_SKYLAKE_AVX512;
+             }
              break;
            case 0x66:
              /* Cannon Lake.  */
index ac9c3486028f65edeba39b11715e171272469106..e7312528bd4960d289159f5c2dbb2fd544307f20 100644 (file)
@@ -76,6 +76,7 @@ enum processor_subtypes
   INTEL_COREI7_ICELAKE_CLIENT,
   INTEL_COREI7_ICELAKE_SERVER,
   AMDFAM17H_ZNVER2,
+  INTEL_COREI7_CASCADELAKE,
   CPU_SUBTYPE_MAX
 };