From 79ab536427e403df631eb3ed3480c6330b2ff898 Mon Sep 17 00:00:00 2001 From: Julia Koval Date: Wed, 14 Mar 2018 11:26:38 +0100 Subject: [PATCH] Split-up -march=icelake on -march=icelake-server and -march=icelake-client Split-up -march=icelake on -march=icelake-server and -march=icelake-client gcc/ * config.gcc (icelake-client, icelake-server): New. (icelake): Remove. * config/i386/i386.c (initial_ix86_tune_features): Extend to 64 bit. (initial_ix86_arch_features): Ditto. (PTA_SKYLAKE): Add SGX. (PTA_ICELAKE): Remove. (PTA_ICELAKE_CLIENT): New. (PTA_ICELAKE_SERVER): New. (ix86_option_override_internal): Split up icelake on icelake client and icelake server. (get_builtin_code_for_version): Ditto. (fold_builtin_cpu): Ditto. * config/i386/driver-i386.c (config/i386/driver-i386.c): Ditto. * config/i386/i386-c.c (ix86_target_macros_internal): Ditto * config/i386/i386.h (processor_type): Ditto. * doc/invoke.texi: Ditto. gcc/testsuite/ * g++.dg/ext/mv16.C: Split up icelake on icelake client and icelake-server. * gcc.target/i386/funcspec-56.inc: Ditto. libgcc/ * config/i386/cpuinfo.h (processor_subtypes): Split up icelake on icelake-client and icelake-server. From-SVN: r258518 --- gcc/ChangeLog | 19 +++ gcc/config.gcc | 2 +- gcc/config/i386/driver-i386.c | 7 +- gcc/config/i386/i386-c.c | 17 ++- gcc/config/i386/i386.c | 113 +++++++++++------- gcc/config/i386/i386.h | 6 +- gcc/doc/invoke.texi | 13 +- gcc/testsuite/ChangeLog | 6 + gcc/testsuite/g++.dg/ext/mv16.C | 10 +- gcc/testsuite/gcc.target/i386/funcspec-56.inc | 3 +- libgcc/ChangeLog | 5 + libgcc/config/i386/cpuinfo.h | 3 +- 12 files changed, 143 insertions(+), 61 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0bfc2018130..3be155db831 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2018-03-14 Julia Koval + + * config.gcc (icelake-client, icelake-server): New. + (icelake): Remove. + * config/i386/i386.c (initial_ix86_tune_features): Extend to 64 bit. + (initial_ix86_arch_features): Ditto. + (PTA_SKYLAKE): Add SGX. + (PTA_ICELAKE): Remove. + (PTA_ICELAKE_CLIENT): New. + (PTA_ICELAKE_SERVER): New. + (ix86_option_override_internal): Split up icelake on icelake client and + icelake server. + (get_builtin_code_for_version): Ditto. + (fold_builtin_cpu): Ditto. + * config/i386/driver-i386.c (config/i386/driver-i386.c): Ditto. + * config/i386/i386-c.c (ix86_target_macros_internal): Ditto + * config/i386/i386.h (processor_type): Ditto. + * doc/invoke.texi: Ditto. + 2018-03-14 Jakub Jelinek PR sanitizer/83392 diff --git a/gcc/config.gcc b/gcc/config.gcc index 81627d5d1c7..f7b2659bef6 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -637,7 +637,7 @@ x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \ bdver3 bdver4 znver1 btver1 btver2 k8 k8-sse3 opteron opteron-sse3 nocona \ core2 corei7 corei7-avx core-avx-i core-avx2 atom slm nehalem westmere \ sandybridge ivybridge haswell broadwell bonnell silvermont knl knm \ -skylake-avx512 cannonlake icelake x86-64 native" +skylake-avx512 cannonlake icelake-client icelake-server x86-64 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.c b/gcc/config/i386/driver-i386.c index 8c95c2eab81..4f5985445ff 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -825,9 +825,12 @@ const char *host_detect_local_cpu (int argc, const char **argv) if (arch) { /* This is unknown family 0x6 CPU. */ + /* Assume Ice Lake Server. */ + if (has_wbnoinvd) + cpu = "icelake-server"; /* Assume Ice Lake. */ - if (has_gfni) - cpu = "icelake"; + else if (has_gfni) + cpu = "icelake-client"; /* Assume Cannon Lake. */ else if (has_avx512vbmi) cpu = "cannonlake"; diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index 644958a9ea0..6c50e2096a0 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -190,9 +190,13 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__cannonlake"); def_or_undef (parse_in, "__cannonlake__"); break; - case PROCESSOR_ICELAKE: - def_or_undef (parse_in, "__icelake"); - def_or_undef (parse_in, "__icelake__"); + case PROCESSOR_ICELAKE_CLIENT: + def_or_undef (parse_in, "__icelake_client"); + def_or_undef (parse_in, "__icelake_client__"); + break; + case PROCESSOR_ICELAKE_SERVER: + def_or_undef (parse_in, "__icelake_server"); + def_or_undef (parse_in, "__icelake_server__"); break; /* use PROCESSOR_max to not set/unset the arch macro. */ case PROCESSOR_max: @@ -315,8 +319,11 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_CANNONLAKE: def_or_undef (parse_in, "__tune_cannonlake__"); break; - case PROCESSOR_ICELAKE: - def_or_undef (parse_in, "__tune_icelake__"); + case PROCESSOR_ICELAKE_CLIENT: + def_or_undef (parse_in, "__tune_icelake_client__"); + break; + case PROCESSOR_ICELAKE_SERVER: + def_or_undef (parse_in, "__tune_icelake_server__"); break; case PROCESSOR_LAKEMONT: def_or_undef (parse_in, "__tune_lakemont__"); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index af24c6ec5ba..a87e5d5ad79 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -127,48 +127,49 @@ const struct processor_costs *ix86_tune_cost = NULL; const struct processor_costs *ix86_cost = NULL; /* Processor feature/optimization bitmasks. */ -#define m_386 (1U<x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_RDPID)) opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_RDPID; + if (((processor_alias_table[i].flags & PTA_PCONFIG) != 0) + && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_PCONFIG)) + opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_PCONFIG; + if (((processor_alias_table[i].flags & PTA_WBNOINVD) != 0) + && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA_WBNOINVD)) + opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_WBNOINVD; if ((processor_alias_table[i].flags & (PTA_PREFETCH_SSE | PTA_SSE)) != 0) @@ -32376,9 +32391,7 @@ get_builtin_code_for_version (tree decl, tree *predicate_list) break; case PROCESSOR_HASWELL: case PROCESSOR_SKYLAKE_AVX512: - if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_GFNI) - arg_str = "icelake"; - else if (new_target->x_ix86_isa_flags + if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_AVX512VBMI) arg_str = "cannonlake"; else if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_AVX512VL) @@ -32391,6 +32404,14 @@ get_builtin_code_for_version (tree decl, tree *predicate_list) arg_str = "haswell"; priority = P_PROC_AVX2; break; + case PROCESSOR_ICELAKE_CLIENT: + arg_str = "icelake-client"; + priority = P_PROC_AVX2; + break; + case PROCESSOR_ICELAKE_SERVER: + arg_str = "icelake-server"; + priority = P_PROC_AVX2; + break; case PROCESSOR_BONNELL: arg_str = "bonnell"; priority = P_PROC_SSSE3; @@ -33105,7 +33126,8 @@ fold_builtin_cpu (tree fndecl, tree *args) M_INTEL_COREI7_SKYLAKE, M_INTEL_COREI7_SKYLAKE_AVX512, M_INTEL_COREI7_CANNONLAKE, - M_INTEL_COREI7_ICELAKE + M_INTEL_COREI7_ICELAKE_CLIENT, + M_INTEL_COREI7_ICELAKE_SERVER }; static struct _arch_names_table @@ -33130,7 +33152,8 @@ fold_builtin_cpu (tree fndecl, tree *args) {"skylake", M_INTEL_COREI7_SKYLAKE}, {"skylake-avx512", M_INTEL_COREI7_SKYLAKE_AVX512}, {"cannonlake", M_INTEL_COREI7_CANNONLAKE}, - {"icelake", M_INTEL_COREI7_ICELAKE}, + {"icelake-client", M_INTEL_COREI7_ICELAKE_CLIENT}, + {"icelake-server", M_INTEL_COREI7_ICELAKE_SERVER}, {"bonnell", M_INTEL_BONNELL}, {"silvermont", M_INTEL_SILVERMONT}, {"knl", M_INTEL_KNL}, diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index e43edd77b56..7f4b04f421d 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -387,7 +387,8 @@ extern const struct processor_costs ix86_size_cost; #define TARGET_KNM (ix86_tune == PROCESSOR_KNM) #define TARGET_SKYLAKE_AVX512 (ix86_tune == PROCESSOR_SKYLAKE_AVX512) #define TARGET_CANNONLAKE (ix86_tune == PROCESSOR_CANNONLAKE) -#define TARGET_ICELAKE (ix86_tune == PROCESSOR_ICELAKE) +#define TARGET_ICELAKE_CLIENT (ix86_tune == PROCESSOR_ICELAKE_CLIENT) +#define TARGET_ICELAKE_SERVER (ix86_tune == PROCESSOR_ICELAKE_SERVER) #define TARGET_INTEL (ix86_tune == PROCESSOR_INTEL) #define TARGET_GENERIC (ix86_tune == PROCESSOR_GENERIC) #define TARGET_AMDFAM10 (ix86_tune == PROCESSOR_AMDFAM10) @@ -2268,7 +2269,8 @@ enum processor_type PROCESSOR_KNM, PROCESSOR_SKYLAKE_AVX512, PROCESSOR_CANNONLAKE, - PROCESSOR_ICELAKE, + PROCESSOR_ICELAKE_CLIENT, + PROCESSOR_ICELAKE_SERVER, PROCESSOR_INTEL, PROCESSOR_GEODE, PROCESSOR_K6, diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4d543008f53..8354d47bc8a 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -26559,14 +26559,23 @@ RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, CLWB and UMIP instruction set support. -@item Icelake -Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, +@item icelake-client +Intel Icelake Client CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ, AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES instruction set support. +@item icelake-server +Intel Icelake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, +SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, +RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, +XSAVES, AVX512F, AVX512VL, AVX512BW, AVX512DQ, AVX512CD, AVX512VBMI, +AVX512IFMA, SHA, CLWB, UMIP, RDPID, GFNI, AVX512VBMI2, AVX512VPOPCNTDQ, +AVX512BITALG, AVX512VNNI, VPCLMULQDQ, VAES, PCONFIG and WBNOINVD instruction +set support. + @item k6 AMD K6 CPU with MMX instruction set support. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f8cb4f4e3a5..187cc6bc5c8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-03-14 Julia Koval + + * g++.dg/ext/mv16.C: Split up icelake on icelake client and icelake + server. + * gcc.target/i386/funcspec-56.inc: Ditto. + 2018-03-14 Richard Sandiford * gcc.target/aarch64/sve/mul_highpart_1_run.c: Restrict to diff --git a/gcc/testsuite/g++.dg/ext/mv16.C b/gcc/testsuite/g++.dg/ext/mv16.C index 8fbdb4791ae..3e7c228a7f1 100644 --- a/gcc/testsuite/g++.dg/ext/mv16.C +++ b/gcc/testsuite/g++.dg/ext/mv16.C @@ -60,10 +60,14 @@ int __attribute__ ((target("arch=cannonlake"))) foo () { return 16; } -int __attribute__ ((target("arch=icelake"))) foo () { +int __attribute__ ((target("arch=icelake-client"))) foo () { return 17; } +int __attribute__ ((target("arch=icelake-server"))) foo () { + return 18; +} + int main () { int val = foo (); @@ -86,8 +90,10 @@ int main () assert (val == 15); else if (__builtin_cpu_is ("cannonlake")) assert (val == 16); - else if (__builtin_cpu_is ("icelake")) + else if (__builtin_cpu_is ("icelake-client")) assert (val == 17); + else if (__builtin_cpu_is ("icelake-server")) + assert (val == 18); else assert (val == 0); diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc b/gcc/testsuite/gcc.target/i386/funcspec-56.inc index 837cdc3560d..35b287a6d78 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc +++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc @@ -145,7 +145,8 @@ extern void test_arch_knl (void) __attribute__((__target__("arch=knl"))); extern void test_arch_knm (void) __attribute__((__target__("arch=knm"))); extern void test_arch_skylake_avx512 (void) __attribute__((__target__("arch=skylake-avx512"))); extern void test_arch_cannonlake (void) __attribute__((__target__("arch=cannonlake"))); -extern void test_arch_icelake (void) __attribute__((__target__("arch=icelake"))); +extern void test_arch_icelake_client (void) __attribute__((__target__("arch=icelake-client"))); +extern void test_arch_icelake_server (void) __attribute__((__target__("arch=icelake-server"))); extern void test_arch_k8 (void) __attribute__((__target__("arch=k8"))); extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3"))); extern void test_arch_opteron (void) __attribute__((__target__("arch=opteron"))); diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index c8c87c6211b..88641125942 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2018-03-14 Julia Koval + + * config/i386/cpuinfo.h (processor_subtypes): Split up icelake on + icelake client and icelake server. + 2018-03-06 John David Anglin * config/pa/fptr.c (_dl_read_access_allowed): New. diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h index a2470726af1..17e2abf2a00 100644 --- a/libgcc/config/i386/cpuinfo.h +++ b/libgcc/config/i386/cpuinfo.h @@ -70,7 +70,8 @@ enum processor_subtypes INTEL_COREI7_SKYLAKE, INTEL_COREI7_SKYLAKE_AVX512, INTEL_COREI7_CANNONLAKE, - INTEL_COREI7_ICELAKE, + INTEL_COREI7_ICELAKE_CLIENT, + INTEL_COREI7_ICELAKE_SERVER, CPU_SUBTYPE_MAX }; -- 2.30.2