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.