From: Haochen Jiang Date: Wed, 18 Oct 2023 06:39:53 +0000 (+0800) Subject: Initial Clearwater Forest Support X-Git-Tag: basepoints/gcc-15~5437 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7370c479dd34024f0cb7c0dc8b419f4884553051;p=thirdparty%2Fgcc.git Initial Clearwater Forest Support 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. --- diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index 0f86b44730b8..5cfbcf0e1bcd 100644 --- a/gcc/common/config/i386/cpuinfo.h +++ b/gcc/common/config/i386/cpuinfo.h @@ -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. */ diff --git a/gcc/common/config/i386/i386-common.cc b/gcc/common/config/i386/i386-common.cc index 13e423deceb9..903034d2afd5 100644 --- a/gcc/common/config/i386/i386-common.cc +++ b/gcc/common/config/i386/i386-common.cc @@ -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, diff --git a/gcc/common/config/i386/i386-cpuinfo.h b/gcc/common/config/i386/i386-cpuinfo.h index 47e9dcfb8f75..44db6a070762 100644 --- a/gcc/common/config/i386/i386-cpuinfo.h +++ b/gcc/common/config/i386/i386-cpuinfo.h @@ -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 }; diff --git a/gcc/config.gcc b/gcc/config.gcc index fa192637a52f..2d045d6d00f3 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -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. diff --git a/gcc/config/i386/driver-i386.cc b/gcc/config/i386/driver-i386.cc index 08d0aed61837..23fcff324f96 100644 --- a/gcc/config/i386/driver-i386.cc +++ b/gcc/config/i386/driver-i386.cc @@ -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)) diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc index 042ad8b9d9c4..7ac95a923be9 100644 --- a/gcc/config/i386/i386-c.cc +++ b/gcc/config/i386/i386-c.cc @@ -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; diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc index 818954d6dbc4..1d28258b4fae 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -141,7 +141,8 @@ along with GCC; see the file COPYING3. If not see #define m_GRANDRIDGE (HOST_WIDE_INT_1U<