From 176a3386885f99654139a2222144b57471a2aee6 Mon Sep 17 00:00:00 2001 From: Olga Makhotina Date: Mon, 16 Apr 2018 11:23:55 +0000 Subject: [PATCH] Fixed g++.dg/ext/mv16.C with -march=native. gcc/ PR target/84331 * gcc/config.gcc: Support "skylake". * gcc/config/i386/i386-c.c (ix86_target_macros_internal): Handle PROCESSOR_SKYLAKE. * gcc/config/i386/i386.c (m_SKYLAKE): Define. (processor_target_table): Add "skylake". (ix86_option_override_internal): Add "skylake". (get_builtin_code_for_version): Handle PROCESSOR_SKYLAKE, PROCESSOR_CANNONLAKE. (get_builtin_code_for_version): Fix priority for PROCESSOR_ICELAKE_CLIENT, PROCESSOR_ICELAKE_SERVER, PROCESSOR_SKYLAKE-AVX512. * gcc/config/i386/i386.h (processor_costs): Define TARGET_SKYLAKE. (processor_type): Add PROCESSOR_SKYLAKE. gcc/testsuite/ PR target/84331 * gcc/testsuite/gcc.target/i386/funcspec-56.inc: Test arch=skylake. From-SVN: r259399 --- gcc/ChangeLog | 17 ++++++++++ gcc/config.gcc | 2 +- gcc/config/i386/i386-c.c | 7 ++++ gcc/config/i386/i386.c | 32 +++++++++++-------- gcc/config/i386/i386.h | 2 ++ gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gcc.target/i386/funcspec-56.inc | 1 + 7 files changed, 52 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a82dfec269..8cc7a6b8167 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2018-04-16 Olga Makhotina + + PR target/84331 + * gcc/config.gcc: Support "skylake". + * gcc/config/i386/i386-c.c (ix86_target_macros_internal): Handle + PROCESSOR_SKYLAKE. + * gcc/config/i386/i386.c (m_SKYLAKE): Define. + (processor_target_table): Add "skylake". + (ix86_option_override_internal): Add "skylake". + (get_builtin_code_for_version): Handle PROCESSOR_SKYLAKE, + PROCESSOR_CANNONLAKE. + (get_builtin_code_for_version): Fix priority for + PROCESSOR_ICELAKE_CLIENT, PROCESSOR_ICELAKE_SERVER, + PROCESSOR_SKYLAKE-AVX512. + * gcc/config/i386/i386.h (processor_costs): Define TARGET_SKYLAKE. + (processor_type): Add PROCESSOR_SKYLAKE. + 2018-04-16 Paolo Carlini Jason Merrill diff --git a/gcc/config.gcc b/gcc/config.gcc index 55c314afdbd..787d8f40e4a 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-client icelake-server x86-64 native" +skylake-avx512 cannonlake icelake-client icelake-server skylake 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/i386-c.c b/gcc/config/i386/i386-c.c index 6c50e2096a0..2e0e9f66c9e 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -182,6 +182,10 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__knm"); def_or_undef (parse_in, "__knm__"); break; + case PROCESSOR_SKYLAKE: + def_or_undef (parse_in, "__skylake"); + def_or_undef (parse_in, "__skylake__"); + break; case PROCESSOR_SKYLAKE_AVX512: def_or_undef (parse_in, "__skylake_avx512"); def_or_undef (parse_in, "__skylake_avx512__"); @@ -313,6 +317,9 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_KNM: def_or_undef (parse_in, "__tune_knm__"); break; + case PROCESSOR_SKYLAKE: + def_or_undef (parse_in, "__tune_skylake__"); + break; case PROCESSOR_SKYLAKE_AVX512: def_or_undef (parse_in, "__tune_skylake_avx512__"); break; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 99ac84e9ed4..b62fdad9927 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -144,6 +144,7 @@ const struct processor_costs *ix86_cost = NULL; #define m_SILVERMONT (HOST_WIDE_INT_1U<x_ix86_isa_flags - & OPTION_MASK_ISA_AVX512VBMI) - arg_str = "cannonlake"; - else if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_AVX512VL) - arg_str = "skylake-avx512"; - else if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_XSAVES) - arg_str = "skylake"; - else if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_ADX) + if (new_target->x_ix86_isa_flags & OPTION_MASK_ISA_ADX) arg_str = "broadwell"; else arg_str = "haswell"; priority = P_PROC_AVX2; break; + case PROCESSOR_SKYLAKE: + arg_str = "skylake"; + priority = P_PROC_AVX2; + break; + case PROCESSOR_SKYLAKE_AVX512: + arg_str = "skylake-avx512"; + priority = P_PROC_AVX512F; + break; + case PROCESSOR_CANNONLAKE: + arg_str = "cannonlake"; + priority = P_PROC_AVX512F; + break; case PROCESSOR_ICELAKE_CLIENT: arg_str = "icelake-client"; - priority = P_PROC_AVX2; + priority = P_PROC_AVX512F; break; case PROCESSOR_ICELAKE_SERVER: arg_str = "icelake-server"; - priority = P_PROC_AVX2; + priority = P_PROC_AVX512F; break; case PROCESSOR_BONNELL: arg_str = "bonnell"; diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index c7f9b4551b3..c9f19b66dca 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -385,6 +385,7 @@ extern const struct processor_costs ix86_size_cost; #define TARGET_SILVERMONT (ix86_tune == PROCESSOR_SILVERMONT) #define TARGET_KNL (ix86_tune == PROCESSOR_KNL) #define TARGET_KNM (ix86_tune == PROCESSOR_KNM) +#define TARGET_SKYLAKE (ix86_tune == PROCESSOR_SKYLAKE) #define TARGET_SKYLAKE_AVX512 (ix86_tune == PROCESSOR_SKYLAKE_AVX512) #define TARGET_CANNONLAKE (ix86_tune == PROCESSOR_CANNONLAKE) #define TARGET_ICELAKE_CLIENT (ix86_tune == PROCESSOR_ICELAKE_CLIENT) @@ -2267,6 +2268,7 @@ enum processor_type PROCESSOR_SILVERMONT, PROCESSOR_KNL, PROCESSOR_KNM, + PROCESSOR_SKYLAKE, PROCESSOR_SKYLAKE_AVX512, PROCESSOR_CANNONLAKE, PROCESSOR_ICELAKE_CLIENT, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8806b95bb3f..1aa8476339e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-16 Olga Makhotina + + PR target/84331 + * gcc/testsuite/gcc.target/i386/funcspec-56.inc: Test arch=skylake. + 2018-04-16 Paolo Carlini Jason Merrill diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc b/gcc/testsuite/gcc.target/i386/funcspec-56.inc index 35b287a6d78..4636631d5f0 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc +++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc @@ -143,6 +143,7 @@ extern void test_arch_corei7_avx (void) __attribute__((__target__("arch=corei7- extern void test_arch_core_avx2 (void) __attribute__((__target__("arch=core-avx2"))); 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 (void) __attribute__((__target__("arch=skylake"))); 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_client (void) __attribute__((__target__("arch=icelake-client"))); -- 2.30.2