> -----Original Message----- > From: Uros Bizjak [mailto:ubiz...@gmail.com] > Sent: Tuesday, September 19, 2017 11:23 PM > To: Peryt, Sebastian <sebastian.pe...@intel.com> > Cc: gcc-patches@gcc.gnu.org; Kirill Yukhin <kirill.yuk...@gmail.com> > Subject: Re: [PATCH][x86] Knights Mill -march/-mtune options > > On Tue, Sep 19, 2017 at 9:01 AM, Peryt, Sebastian <sebastian.pe...@intel.com> > wrote: > > >> >> >> > This patch adds options -march=/-mtune=knm for Knights Mill. > >> >> >> > > >> >> >> > 2017-09-14 Sebastian Peryt <sebastian.pe...@intel.com> 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): Define M_INTEL_KNM. > >> >> >> > * config/i386/i386.h (TARGET_KNM): Define. > >> >> >> > (processor_type): Add PROCESSOR_KNM. > >> >> >> > * config/i386/x86-tune.def: Add m_KNM. > >> >> >> > * doc/invoke.texi: Add knm as x86 -march=/-mtune= CPU type. > >> >> >> > > >> >> >> > > >> >> >> > gcc/testsuite/ > >> >> >> > > >> >> >> > * gcc.target/i386/funcspec-5.c: Test knm. > >> >> >> > > >> >> >> > Is it ok for trunk? > >> >> >> > >> >> >> You also have to update libgcc/cpuinfo.h together with > >> >> >> fold_builtin_cpu from i386.c. Please note that all new > >> >> >> processor types and subtypes have to be added at the end of the enum. > >> >> >> > >> >> > > >> >> > Uros, > >> >> > > >> >> > I have updated libgcc/cpuinfo.h and libgcc/cpuinfo.c. I > >> >> > understood that CPU_TYPE_MAX in libgcc/cpuinfo.h processor_types > >> >> > is some kind of barrier, this is why I put KNM before that. Is that > >> >> > correct > thinking? > >> >> > As for fold_builtin_cpu in i386.c I already have something like this: > >> >> > > >> >> > @@ -34217,6 +34229,7 @@ fold_builtin_cpu (tree fndecl, tree *args) > >> >> > M_AMDFAM15H, > >> >> > M_INTEL_SILVERMONT, > >> >> > M_INTEL_KNL, > >> >> > + M_INTEL_KNM, > >> >> > M_AMD_BTVER1, > >> >> > M_AMD_BTVER2, > >> >> > M_CPU_SUBTYPE_START, > >> >> > @@ -34262,6 +34275,7 @@ fold_builtin_cpu (tree fndecl, tree *args) > >> >> > {"bonnell", M_INTEL_BONNELL}, > >> >> > {"silvermont", M_INTEL_SILVERMONT}, > >> >> > {"knl", M_INTEL_KNL}, > >> >> > + {"knm", M_INTEL_KNM}, > >> >> > {"amdfam10h", M_AMDFAM10H}, > >> >> > {"barcelona", M_AMDFAM10H_BARCELONA}, > >> >> > {"shanghai", M_AMDFAM10H_SHANGHAI}, > >> >> > > >> >> > I couldn't find any other place where I'm supposed to add anything > extra. > >> >> > >> >> Please look at libgcc/config/i386/cpuinfo.h. The comment here says that: > >> >> > >> >> /* Any new types or subtypes have to be inserted at the end. */ > >> >> > >> >> The above patch should then add M_INTEL_KNM as the last entry > >> >> *before* M_CPU_SUBTYPE_START. > >> >> > >> > > >> > Sorry, I didn't notice this value at first. I believe now it's correct. > >> > >> OK for mainline SVN (with updated ChangeLog). > >> > > > > Can you please commit for me? > > Please send an updated ChangeLog. > > Uros.
Uros, Below please find attached Changelog. This is for patch v3 (also attached here just in case). 2017-09-20 Sebastian Peryt <sebastian.pe...@intel.com> 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. Thanks, Sebastian
KNM_enabling_v3.patch
Description: KNM_enabling_v3.patch