RE: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-20 Thread Peryt, Sebastian
> -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_INTE

Re: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-19 Thread Uros Bizjak
On Tue, Sep 19, 2017 at 9:01 AM, Peryt, Sebastian
 wrote:

>> >> >> > This patch adds  options -march=/-mtune=knm for Knights Mill.
>> >> >> >
>> >> >> > 2017-09-14  Sebastian Peryt   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.


RE: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-19 Thread Peryt, Sebastian
> -Original Message-
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
> Sent: Monday, September 18, 2017 9:10 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 Mon, Sep 18, 2017 at 12:42 PM, Peryt, Sebastian
> <sebastian.pe...@intel.com> wrote:
> >> -Original Message-
> >> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> >> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
> >> Sent: Monday, September 18, 2017 12: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 Mon, Sep 18, 2017 at 12:17 PM, Peryt, Sebastian
> >> <sebastian.pe...@intel.com> wrote:
> >> >> -Original Message-
> >> >> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> >> >> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
> >> >> Sent: Sunday, September 17, 2017 6:14 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 Thu, Sep 14, 2017 at 1:47 PM, Peryt, Sebastian
> >> >> <sebastian.pe...@intel.com>
> >> >> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > 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?

Thanks,
Sebastian

> Thanks,
> Uros.


Re: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-18 Thread Uros Bizjak
On Mon, Sep 18, 2017 at 12:42 PM, Peryt, Sebastian
<sebastian.pe...@intel.com> wrote:
>> -Original Message-
>> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
>> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
>> Sent: Monday, September 18, 2017 12: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 Mon, Sep 18, 2017 at 12:17 PM, Peryt, Sebastian
>> <sebastian.pe...@intel.com> wrote:
>> >> -Original Message-
>> >> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
>> >> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
>> >> Sent: Sunday, September 17, 2017 6:14 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 Thu, Sep 14, 2017 at 1:47 PM, Peryt, Sebastian
>> >> <sebastian.pe...@intel.com>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > 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).

Thanks,
Uros.


RE: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-18 Thread Peryt, Sebastian
> -Original Message-
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
> Sent: Monday, September 18, 2017 12: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 Mon, Sep 18, 2017 at 12:17 PM, Peryt, Sebastian
> <sebastian.pe...@intel.com> wrote:
> >> -Original Message-
> >> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> >> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
> >> Sent: Sunday, September 17, 2017 6:14 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 Thu, Sep 14, 2017 at 1:47 PM, Peryt, Sebastian
> >> <sebastian.pe...@intel.com>
> >> wrote:
> >> > Hi,
> >> >
> >> > 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.

Sebastian

> > Additionally I updated one extra test I found -
> > gcc.target/i386/funcspec-56.inc
> >
> >> Ops, and ANDFAM17H processor type should not be there in cpuinfo.h.
> >
> > Sorry, I don't understand - it shouldn't be at this position, or in this 
> > enum at all?
> 
> This means I have to synchronize gcc part with libgcc. I'll do it later today.
> 
> Uros.


KNM_enabling_v3.patch
Description: KNM_enabling_v3.patch


Re: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-18 Thread Uros Bizjak
On Mon, Sep 18, 2017 at 12:17 PM, Peryt, Sebastian
<sebastian.pe...@intel.com> wrote:
>> -Original Message-
>> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
>> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
>> Sent: Sunday, September 17, 2017 6:14 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 Thu, Sep 14, 2017 at 1:47 PM, Peryt, Sebastian <sebastian.pe...@intel.com>
>> wrote:
>> > Hi,
>> >
>> > 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.

> Additionally I updated one extra test I found - 
> gcc.target/i386/funcspec-56.inc
>
>> Ops, and ANDFAM17H processor type should not be there in cpuinfo.h.
>
> Sorry, I don't understand - it shouldn't be at this position, or in this enum 
> at all?

This means I have to synchronize gcc part with libgcc. I'll do it later today.

Uros.


RE: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-18 Thread Peryt, Sebastian
> -Original Message-
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> ow...@gcc.gnu.org] On Behalf Of Uros Bizjak
> Sent: Sunday, September 17, 2017 6:14 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 Thu, Sep 14, 2017 at 1:47 PM, Peryt, Sebastian <sebastian.pe...@intel.com>
> wrote:
> > Hi,
> >
> > 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.
Additionally I updated one extra test I found - gcc.target/i386/funcspec-56.inc

> Ops, and ANDFAM17H processor type should not be there in cpuinfo.h.

Sorry, I don't understand - it shouldn't be at this position, or in this enum 
at all?
> 
> Uros.

Thanks,
Sebastian

2017-09-18  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.

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/funcspec-5.c: Test knm.
* gcc.target/i386/funcspec-56.inc: Test arch=knm.


KNM_enabling_v2.patch
Description: KNM_enabling_v2.patch


Re: [PATCH][x86] Knights Mill -march/-mtune options

2017-09-17 Thread Uros Bizjak
On Thu, Sep 14, 2017 at 1:47 PM, Peryt, Sebastian
 wrote:
> Hi,
>
> This patch adds  options -march=/-mtune=knm for Knights Mill.
>
> 2017-09-14  Sebastian Peryt  
> 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.

Ops, and ANDFAM17H processor type should not be there in cpuinfo.h.

Uros.