From cace2309d494617577161853a358eb3a444c1688 Mon Sep 17 00:00:00 2001 From: Sebastian Peryt Date: Wed, 20 Sep 2017 15:47:30 +0200 Subject: [PATCH] config.gcc: Support "knm". gcc/ * config.gcc: Support "knm". * config/i386/driver-i386.c (host_detect_local_cpu): Detect "knm". * config/i386/i386-c.c (ix86_target_macros_internal): Handle PROCESSOR_KNM. * config/i386/i386.c (m_KNM): Define. (processor_target_table): Add "knm". (PTA_KNM): Define. (ix86_option_override_internal): Add "knm". (ix86_issue_rate): Add PROCESSOR_KNM. (ix86_adjust_cost): Ditto. (ia32_multipass_dfa_lookahead): Ditto. (get_builtin_code_for_version): Handle PROCESSOR_KNM. (fold_builtin_cpu): Add M_INTEL_KNM. * config/i386/i386.h (processor_costs): Define TARGET_KNM. (processor_type): Add PROCESSOR_KNM. * config/i386/x86-tune.def: Add m_KNM. * doc/invoke.texi: Add knm as x86 -march=/-mtune= CPU type. libgcc/ * config/i386/cpuinfo.h (processor_types): Add INTEL_KNM. * config/i386/cpuinfo.c (get_intel_cpu): Detect Knights Mill. gcc/testsuite/ * gcc.target/i386/builtin_target.c: Test knm. * gcc.target/i386/funcspec-56.inc: Test arch=knm. From-SVN: r253013 --- gcc/ChangeLog | 26 +++++++++-- gcc/config.gcc | 2 +- gcc/config/i386/driver-i386.c | 7 +++ gcc/config/i386/i386-c.c | 7 +++ gcc/config/i386/i386.c | 14 ++++++ gcc/config/i386/i386.h | 2 + gcc/config/i386/x86-tune.def | 46 +++++++++---------- gcc/doc/invoke.texi | 6 +++ gcc/testsuite/ChangeLog | 5 ++ .../gcc.target/i386/builtin_target.c | 4 ++ gcc/testsuite/gcc.target/i386/funcspec-56.inc | 1 + libgcc/ChangeLog | 45 ++++++++++-------- libgcc/config/i386/cpuinfo.c | 4 ++ libgcc/config/i386/cpuinfo.h | 1 + 14 files changed, 123 insertions(+), 47 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b41cd0353a9..1bbb3bf6eb4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2017-09-20 Sebastian Peryt + + * config.gcc: Support "knm". + * config/i386/driver-i386.c (host_detect_local_cpu): Detect "knm". + * config/i386/i386-c.c (ix86_target_macros_internal): Handle + PROCESSOR_KNM. + * config/i386/i386.c (m_KNM): Define. + (processor_target_table): Add "knm". + (PTA_KNM): Define. + (ix86_option_override_internal): Add "knm". + (ix86_issue_rate): Add PROCESSOR_KNM. + (ix86_adjust_cost): Ditto. + (ia32_multipass_dfa_lookahead): Ditto. + (get_builtin_code_for_version): Handle PROCESSOR_KNM. + (fold_builtin_cpu): Add M_INTEL_KNM. + * config/i386/i386.h (processor_costs): Define TARGET_KNM. + (processor_type): Add PROCESSOR_KNM. + * config/i386/x86-tune.def: Add m_KNM. + * doc/invoke.texi: Add knm as x86 -march=/-mtune= CPU type. + 2017-09-20 Richard Biener PR tree-optimization/80213 @@ -97,7 +117,7 @@ * rtl.h (get_stack_check_protect): Prototype. * target.def (stack_clash_protection_final_dynamic_probe): New hook. * targhooks.c (default_stack_clash_protection_final_dynamic_probe): New. - * targhooks.h (default_stack_clash_protection_final_dynamic_probe): + * targhooks.h (default_stack_clash_protection_final_dynamic_probe): Prototype. * doc/tm.texi.in (TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE): Add @hook. @@ -312,8 +332,8 @@ 2017-09-17 Daniel Santos - config/i386/i386.c: (xlogue_layout::STUB_NAME_MAX_LEN): Increase to 20 - bytes. + * config/i386/i386.c (xlogue_layout::STUB_NAME_MAX_LEN): + Increase to 20 bytes. (xlogue_layout::s_stub_names): Add an additional size-2 diminsion. (xlogue_layout::get_stub_name): Modify to select the appropairate sse or avx version of the stub. diff --git a/gcc/config.gcc b/gcc/config.gcc index 630832f9277..555ed69e4e9 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -623,7 +623,7 @@ pentium4 pentium4m pentiumpro prescott lakemont" 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 \ +sandybridge ivybridge haswell broadwell bonnell silvermont knl knm \ skylake-avx512 x86-64 native" # Additional x86 processors supported by --with-cpu=. Each processor diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index 570c49031bd..e78cd929d6f 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -790,6 +790,10 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Knights Landing. */ cpu = "knl"; break; + case 0x85: + /* Knights Mill. */ + cpu = "knm"; + break; default: if (arch) { @@ -797,6 +801,9 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Assume Knights Landing. */ if (has_avx512f) cpu = "knl"; + /* Assume Knights Mill */ + else if (has_avx5124vnniw) + cpu = "knm"; /* Assume Skylake. */ else if (has_clflushopt) cpu = "skylake"; diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index 9a79a215bec..44cbe28c863 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -176,6 +176,10 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__knl"); def_or_undef (parse_in, "__knl__"); break; + case PROCESSOR_KNM: + def_or_undef (parse_in, "__knm"); + def_or_undef (parse_in, "__knm__"); + break; case PROCESSOR_SKYLAKE_AVX512: def_or_undef (parse_in, "__skylake_avx512"); def_or_undef (parse_in, "__skylake_avx512__"); @@ -292,6 +296,9 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_KNL: def_or_undef (parse_in, "__tune_knl__"); break; + case PROCESSOR_KNM: + def_or_undef (parse_in, "__tune_knm__"); + 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 d19c770d4cb..aeafd0d5d21 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2192,6 +2192,7 @@ const struct processor_costs *ix86_cost = &pentium_cost; #define m_BONNELL (1U< + + * gcc.target/i386/builtin_target.c: Test knm. + * gcc.target/i386/funcspec-56.inc: Test arch=knm. + 2017-09-20 Richard Biener PR tree-optimization/77362 diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c index 9c190eb7ebc..8fa97973ef8 100644 --- a/gcc/testsuite/gcc.target/i386/builtin_target.c +++ b/gcc/testsuite/gcc.target/i386/builtin_target.c @@ -42,6 +42,10 @@ check_intel_cpu_model (unsigned int family, unsigned int model, /* Knights Landing. */ assert (__builtin_cpu_is ("knl")); break; + case 0x85: + /* Knights Mill */ + assert (__builtin_cpu_is ("knm")); + break; case 0x1a: case 0x1e: case 0x1f: diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc b/gcc/testsuite/gcc.target/i386/funcspec-56.inc index 746c9cfc4e1..9ae74cb9581 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc +++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc @@ -142,6 +142,7 @@ extern void test_arch_corei7 (void) __attribute__((__target__("arch=corei7"))); extern void test_arch_corei7_avx (void) __attribute__((__target__("arch=corei7-avx"))); 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_avx512 (void) __attribute__((__target__("arch=skylake-avx512"))); extern void test_arch_k8 (void) __attribute__((__target__("arch=k8"))); extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3"))); diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index b548922904c..1a627c0b86d 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,30 +1,35 @@ +2017-09-20 Sebastian Peryt + + * config/i386/cpuinfo.h (processor_types): Add INTEL_KNM. + * config/i386/cpuinfo.c (get_intel_cpu): Detect Knights Mill. + 2017-09-17 Daniel Santos - config/i386/i386-asm.h (PASTE2): New macro. + * config/i386/i386-asm.h (PASTE2): New macro. (ASMNAME): Modify to use PASTE2. (MS2SYSV_STUB_PREFIX): New macro for isa prefix. (MS2SYSV_STUB_BEGIN, MS2SYSV_STUB_END): New macros for stub headers. - config/i386/resms64.S: Rename to a header file, use MS2SYSV_STUB_BEGIN + * config/i386/resms64.S: Rename to a header file, use MS2SYSV_STUB_BEGIN instead of HIDDEN_FUNC and MS2SYSV_STUB_END instead of FUNC_END. - config/i386/resms64f.S: Likewise. - config/i386/resms64fx.S: Likewise. - config/i386/resms64x.S: Likewise. - config/i386/savms64.S: Likewise. - config/i386/savms64f.S: Likewise. - config/i386/avx_resms64.S: New file that only defines a macro and + * config/i386/resms64f.S: Likewise. + * config/i386/resms64fx.S: Likewise. + * config/i386/resms64x.S: Likewise. + * config/i386/savms64.S: Likewise. + * config/i386/savms64f.S: Likewise. + * config/i386/avx_resms64.S: New file that only defines a macro and includes it's corresponding header file. - config/i386/avx_resms64f.S: Likewise. - config/i386/avx_resms64fx.S: Likewise. - config/i386/avx_resms64x.S: Likewise. - config/i386/avx_savms64.S: Likewise. - config/i386/avx_savms64f.S: Likewise. - config/i386/sse_resms64.S: Likewise. - config/i386/sse_resms64f.S: Likewise. - config/i386/sse_resms64fx.S: Likewise. - config/i386/sse_resms64x.S: Likewise. - config/i386/sse_savms64.S: Likewise. - config/i386/sse_savms64f.S: Likewise. - config/i386/t-msabi: Modified to add avx and sse versions of stubs. + * config/i386/avx_resms64f.S: Likewise. + * config/i386/avx_resms64fx.S: Likewise. + * config/i386/avx_resms64x.S: Likewise. + * config/i386/avx_savms64.S: Likewise. + * config/i386/avx_savms64f.S: Likewise. + * config/i386/sse_resms64.S: Likewise. + * config/i386/sse_resms64f.S: Likewise. + * config/i386/sse_resms64fx.S: Likewise. + * config/i386/sse_resms64x.S: Likewise. + * config/i386/sse_savms64.S: Likewise. + * config/i386/sse_savms64f.S: Likewise. + * config/i386/t-msabi: Modified to add avx and sse versions of stubs. 2017-09-01 Olivier Hainque diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c index b008fb6e396..c2ab8bed88e 100644 --- a/libgcc/config/i386/cpuinfo.c +++ b/libgcc/config/i386/cpuinfo.c @@ -137,6 +137,10 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id) /* Knights Landing. */ __cpu_model.__cpu_type = INTEL_KNL; break; + case 0x85: + /* Knights Mill. */ + __cpu_model.__cpu_type = INTEL_KNM; + break; case 0x1a: case 0x1e: case 0x1f: diff --git a/libgcc/config/i386/cpuinfo.h b/libgcc/config/i386/cpuinfo.h index 872b45e3817..397840160c0 100644 --- a/libgcc/config/i386/cpuinfo.h +++ b/libgcc/config/i386/cpuinfo.h @@ -47,6 +47,7 @@ enum processor_types AMD_BTVER1, AMD_BTVER2, AMDFAM17H, + INTEL_KNM, CPU_TYPE_MAX }; -- 2.30.2