]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Initial Clearwater Forest Support
authorHaochen Jiang <haochen.jiang@intel.com>
Wed, 18 Oct 2023 06:39:53 +0000 (14:39 +0800)
committerHaochen Jiang <haochen.jiang@intel.com>
Wed, 18 Oct 2023 06:39:53 +0000 (14:39 +0800)
gcc/ChangeLog:

* common/config/i386/cpuinfo.h
(get_intel_cpu): Handle Clearwater Forest.
* common/config/i386/i386-common.cc (processor_name):
Add Clearwater Forest.
(processor_alias_table): Ditto.
* common/config/i386/i386-cpuinfo.h (enum processor_types):
Add INTEL_CLEARWATERFOREST.
* config.gcc: Add -march=clearwaterforest.
* config/i386/driver-i386.cc (host_detect_local_cpu): Handle
clearwaterforest.
* config/i386/i386-c.cc (ix86_target_macros_internal): Ditto.
* config/i386/i386-options.cc (processor_cost_table): Ditto.
(m_CLEARWATERFOREST): New.
(m_CORE_ATOM): Add clearwaterforest.
* config/i386/i386.h (enum processor_type): Ditto.
* doc/extend.texi: Ditto.
* doc/invoke.texi: Ditto.

gcc/testsuite/ChangeLog:

* g++.target/i386/mv16.C: Ditto.
* gcc.target/i386/funcspec-56.inc: Handle new march.

12 files changed:
gcc/common/config/i386/cpuinfo.h
gcc/common/config/i386/i386-common.cc
gcc/common/config/i386/i386-cpuinfo.h
gcc/config.gcc
gcc/config/i386/driver-i386.cc
gcc/config/i386/i386-c.cc
gcc/config/i386/i386-options.cc
gcc/config/i386/i386.h
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/g++.target/i386/mv16.C
gcc/testsuite/gcc.target/i386/funcspec-56.inc

index 0f86b44730b8bcb2ab0d52a1c45be439341b93af..5cfbcf0e1bcd5265452033b7f322e57bad2b4ef3 100644 (file)
@@ -608,6 +608,12 @@ get_intel_cpu (struct __processor_model *cpu_model,
       cpu_model->__cpu_type = INTEL_COREI7;
       cpu_model->__cpu_subtype = INTEL_COREI7_ARROWLAKE_S;
       break;
+    case 0xdd:
+      /* Clearwater Forest.  */
+      cpu = "clearwaterforest";
+      CHECK___builtin_cpu_is ("clearwaterforest");
+      cpu_model->__cpu_type = INTEL_CLEARWATERFOREST;
+      break;
     case 0x17:
     case 0x1d:
       /* Penryn.  */
index 13e423deceb961fee2c0e6ed074a4e55c4801117..903034d2afd5b3d42330c1b876db8f6257624a4f 100644 (file)
@@ -2077,6 +2077,7 @@ const char *const processor_names[] =
   "tremont",
   "sierraforest",
   "grandridge",
+  "clearwaterforest",
   "knl",
   "knm",
   "skylake",
@@ -2246,6 +2247,8 @@ const pta processor_alias_table[] =
     M_CPU_SUBTYPE (INTEL_SIERRAFOREST), P_PROC_AVX2},
   {"grandridge", PROCESSOR_GRANDRIDGE, CPU_HASWELL, PTA_GRANDRIDGE,
     M_CPU_TYPE (INTEL_GRANDRIDGE), P_PROC_AVX2},
+  {"clearwaterforest", PROCESSOR_CLEARWATERFOREST, CPU_HASWELL,
+    PTA_CLEARWATERFOREST, M_CPU_TYPE (INTEL_CLEARWATERFOREST), P_PROC_AVX2},
   {"knl", PROCESSOR_KNL, CPU_SLM, PTA_KNL,
     M_CPU_TYPE (INTEL_KNL), P_PROC_AVX512F},
   {"knm", PROCESSOR_KNM, CPU_SLM, PTA_KNM,
index 47e9dcfb8f75938e6b907de2f7ac8b70e682e472..44db6a0707629ccbb957e0dd78b25639e220dcf3 100644 (file)
@@ -62,6 +62,7 @@ enum processor_types
   ZHAOXIN_FAM7H,
   INTEL_SIERRAFOREST,
   INTEL_GRANDRIDGE,
+  INTEL_CLEARWATERFOREST,
   CPU_TYPE_MAX,
   BUILTIN_CPU_TYPE_MAX = CPU_TYPE_MAX
 };
index fa192637a52fa88bbe92f5797c274c9433f6d56b..2d045d6d00f34d69a5844c498a5fb7a0fea832b9 100644 (file)
@@ -708,7 +708,7 @@ skylake goldmont goldmont-plus tremont cascadelake tigerlake cooperlake \
 sapphirerapids alderlake rocketlake eden-x2 nano nano-1000 nano-2000 nano-3000 \
 nano-x2 eden-x4 nano-x4 lujiazui x86-64 x86-64-v2 x86-64-v3 x86-64-v4 \
 sierraforest graniterapids graniterapids-d grandridge arrowlake arrowlake-s \
-native"
+clearwaterforest native"
 
 # Additional x86 processors supported by --with-cpu=.  Each processor
 # MUST be separated by exactly one space.
index 08d0aed61837bd495c4883d4dfd74a6c303fc2dc..23fcff324f969db611d3611b3caf752cd4f14d83 100644 (file)
@@ -591,8 +591,11 @@ const char *host_detect_local_cpu (int argc, const char **argv)
              /* This is unknown family 0x6 CPU.  */
              if (has_feature (FEATURE_AVX))
                {
+                 /* Assume Clearwater Forest.  */
+                 if (has_feature (FEATURE_USER_MSR))
+                   cpu = "clearwaterforest";
                  /* Assume Arrow Lake S.  */
-                 if (has_feature (FEATURE_SM3))
+                 else if (has_feature (FEATURE_SM3))
                    cpu = "arrowlake-s";
                  /* Assume Grand Ridge.  */
                  else if (has_feature (FEATURE_RAOINT))
index 042ad8b9d9c42af6189d18e8c4f9f87d94670f67..7ac95a923be9e835e3f1f0162e6a2775ff97af49 100644 (file)
@@ -210,6 +210,10 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
       def_or_undef (parse_in, "__grandridge");
       def_or_undef (parse_in, "__grandridge__");
       break;
+    case PROCESSOR_CLEARWATERFOREST:
+      def_or_undef (parse_in, "__clearwaterforest");
+      def_or_undef (parse_in, "__clearwaterforest__");
+      break;
     case PROCESSOR_KNL:
       def_or_undef (parse_in, "__knl");
       def_or_undef (parse_in, "__knl__");
@@ -415,6 +419,9 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
     case PROCESSOR_GRANDRIDGE:
       def_or_undef (parse_in, "__tune_grandridge__");
       break;
+    case PROCESSOR_CLEARWATERFOREST:
+      def_or_undef (parse_in, "__tune_clearwaterforest__");
+      break;
     case PROCESSOR_KNL:
       def_or_undef (parse_in, "__tune_knl__");
       break;
index 818954d6dbc44f58159092ba59888063f79a1563..1d28258b4faea6f866d821b6e6b44c666eceeb32 100644 (file)
@@ -141,7 +141,8 @@ along with GCC; see the file COPYING3.  If not see
 #define m_GRANDRIDGE (HOST_WIDE_INT_1U<<PROCESSOR_GRANDRIDGE)
 #define m_ARROWLAKE (HOST_WIDE_INT_1U<<PROCESSOR_ARROWLAKE)
 #define m_ARROWLAKE_S (HOST_WIDE_INT_1U<<PROCESSOR_ARROWLAKE_S)
-#define m_CORE_ATOM (m_SIERRAFOREST | m_GRANDRIDGE)
+#define m_CLEARWATERFOREST (HOST_WIDE_INT_1U<<PROCESSOR_CLEARWATERFOREST)
+#define m_CORE_ATOM (m_SIERRAFOREST | m_GRANDRIDGE | m_CLEARWATERFOREST)
 #define m_INTEL (HOST_WIDE_INT_1U<<PROCESSOR_INTEL)
 /* Gather Data Sampling / CVE-2022-40982 / INTEL-SA-00828.
    Software mitigation.  */
@@ -767,6 +768,7 @@ static const struct processor_costs *processor_cost_table[] =
   &tremont_cost,
   &alderlake_cost,
   &alderlake_cost,
+  &alderlake_cost,
   &slm_cost,
   &slm_cost,
   &skylake_cost,
index e4c1fc6eef0db4b602edb77a1f7ac6991135eb86..d7d0085f925042264f9a421b809c570007849b97 100644 (file)
@@ -2268,6 +2268,7 @@ enum processor_type
   PROCESSOR_TREMONT,
   PROCESSOR_SIERRAFOREST,
   PROCESSOR_GRANDRIDGE,
+  PROCESSOR_CLEARWATERFOREST,
   PROCESSOR_KNL,
   PROCESSOR_KNM,
   PROCESSOR_SKYLAKE,
@@ -2402,6 +2403,8 @@ constexpr wide_int_bitmask PTA_GRANDRIDGE = PTA_SIERRAFOREST | PTA_RAOINT;
 constexpr wide_int_bitmask PTA_ARROWLAKE = PTA_SIERRAFOREST;
 constexpr wide_int_bitmask PTA_ARROWLAKE_S = PTA_ARROWLAKE | PTA_AVXVNNIINT16
   | PTA_SHA512 | PTA_SM3 | PTA_SM4;
+constexpr wide_int_bitmask PTA_CLEARWATERFOREST = PTA_ARROWLAKE_S | PTA_PREFETCHI
+  | PTA_USER_MSR;
 constexpr wide_int_bitmask PTA_KNM = PTA_KNL | PTA_AVX5124VNNIW
   | PTA_AVX5124FMAPS | PTA_AVX512VPOPCNTDQ;
 constexpr wide_int_bitmask PTA_ZNVER1 = PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2
index e8180945ab4bfbe6a0302881cef78f88c7d5215e..5beb8361b1c36493b51c4acf9e9316e11fc69e8a 100644 (file)
@@ -22636,6 +22636,9 @@ Intel Core i7 Arrow Lake CPU.
 @item arrowlake-s
 Intel Core i7 Arrow Lake S CPU.
 
+@item clearwaterforest
+Intel Atom Clearwater Forest CPU.
+
 @item knl
 Intel Knights Landing CPU.
 
index db59d8b6d4af3a8f1e094f4e736a09900269b234..44a6d3d7efb3e88176c96d86f4b35f0eae049dcd 100644 (file)
@@ -32856,6 +32856,15 @@ PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI,
 AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3
 and SM4 instruction set support.
 
+@item clearwaterforest
+Intel Clearwater Forest CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2,
+SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, AES, PREFETCHW, PCLMUL, RDRND, XSAVE,
+XSAVEC, XSAVES, XSAVEOPT, FSGSBASE, PTWRITE, RDPID, SGX, GFNI-SSE, CLWB,
+MOVDIRI, MOVDIR64B, CLDEMOTE, WAITPKG, ADCX, AVX, AVX2, BMI, BMI2, F16C, FMA,
+LZCNT, PCONFIG, PKU, VAES, VPCLMULQDQ, SERIALIZE, HRESET, KL, WIDEKL, AVX-VNNI,
+AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AVXVNNIINT16, SHA512, SM3, SM4,
+USER_MSR and PREFETCHI instruction set support.
+
 @item knl
 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
 SSSE3, SSE4.1, SSE4.2, POPCNT, CX16, SAHF, FXSR, AVX, XSAVE, PCLMUL, FSGSBASE,
index 07f4a2a89dff3543aaaf24ef8fe1f0679ab29464..d29002b18dba281cfb2b8bec51a6c47a35952d8d 100644 (file)
@@ -116,6 +116,10 @@ int __attribute__ ((target("arch=arrowlake-s"))) foo () {
   return 30;
 }
 
+int __attribute__ ((target("arch=clearwaterforest"))) foo () {
+  return 31;
+}
+
 int main ()
 {
   int val = foo ();
@@ -166,6 +170,8 @@ int main ()
     assert (val == 29);
   else if (__builtin_cpu_is ("arrowlake-s"))
     assert (val == 30);
+  else if (__builtin_cpu_is ("clearwaterforest"))
+    assert (val == 31);
   else
     assert (val == 0);
 
index e0470a604837b1c83c82dc10024320e9e2078703..c1d93243ea7efdf6209cd857078a64bfaef7cd71 100644 (file)
@@ -216,6 +216,7 @@ extern void test_arch_graniterapids (void)  __attribute__((__target__("arch=grani
 extern void test_arch_graniterapids_d (void)   __attribute__((__target__("arch=graniterapids-d")));
 extern void test_arch_arrowlake (void)         __attribute__((__target__("arch=arrowlake")));
 extern void test_arch_arrowlake_s (void)       __attribute__((__target__("arch=arrowlake-s")));
+extern void test_arch_clearwaterforest (void)  __attribute__((__target__("arch=clearwaterforest")));
 extern void test_arch_lujiazui (void)                  __attribute__((__target__("arch=lujiazui")));
 extern void test_arch_k8 (void)                        __attribute__((__target__("arch=k8")));
 extern void test_arch_k8_sse3 (void)           __attribute__((__target__("arch=k8-sse3")));