diff mbox

[x86_64] : Add bdver4 for multi versioning and fix AMD cpu model detection.

Message ID 7794A52CE4D579448B959EED7DD0A4723DD6E9EB@satlexdag06.amd.com
State New
Headers show

Commit Message

Kumar, Venkataramanan Oct. 9, 2015, 9:50 a.m. UTC
Hi Uros,

Please find below patch that adds bdver4 target for multi versioning. 
Also I while computing model, the extended_model is incorrectly left shifted  by 4. I have removed it now.

Is below patch Ok for trunk ? 
GCC bootstrap and regressions passed.


Regards,
Venkat.

Comments

Uros Bizjak Oct. 9, 2015, 9:55 a.m. UTC | #1
On Fri, Oct 9, 2015 at 11:50 AM, Kumar, Venkataramanan
<Venkataramanan.Kumar@amd.com> wrote:
> Hi Uros,
>
> Please find below patch that adds bdver4 target for multi versioning.
> Also I while computing model, the extended_model is incorrectly left shifted  by 4. I have removed it now.
>
> Is below patch Ok for trunk ?
> GCC bootstrap and regressions passed.

OK for trunk and release branches, where applicable. IMO, model
selection fix should be applied to all release branches.

Thanks,
Uros.

> diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
> index bb3a722..8676747 100644
> --- a/libgcc/ChangeLog
> +++ b/libgcc/ChangeLog
> @@ -1,3 +1,8 @@
> +2015-10-09  Venkataramanan Kumar <venkataramanan.kumar@amd.com>
> +
> +       * config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.
> +       (__cpu_indicator_init): Fix model selection for AMD CPUs.
> +
>  2015-10-05  Kirill Yukhin  <kirill.yukhin@intel.com>
>
>         * config/i386/cpuinfo.c (get_intel_cpu): Detect "skylake-avx512".
> diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
> index 0cbbc85..1313ca3 100644
> --- a/libgcc/config/i386/cpuinfo.c
> +++ b/libgcc/config/i386/cpuinfo.c
> @@ -169,6 +169,9 @@ get_amd_cpu (unsigned int family, unsigned int model)
>        /* Bulldozer version 3 "Steamroller"  */
>        if (model >= 0x30 && model <= 0x4f)
>         __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;
> +      /* Bulldozer version 4 "Excavator"   */
> +      if (model >= 0x60 && model <= 0x7f)
> +       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;
>        break;
>      /* AMD Family 16h "btver2" */
>      case 0x16:
> @@ -455,7 +458,7 @@ __cpu_indicator_init (void)
>        if (family == 0x0f)
>         {
>           family += extended_family;
> -         model += (extended_model << 4);
> +         model += extended_model;
>         }
>
>        /* Get CPU type.  */
>
> Regards,
> Venkat.
>
>
>
>
>
>
Kumar, Venkataramanan Oct. 9, 2015, 10:01 a.m. UTC | #2
Thank you Uros,

I will  test and commit model selection change in all release branches as well.

Regards,
Venkat.

> -----Original Message-----

> From: Uros Bizjak [mailto:ubizjak@gmail.com]

> Sent: Friday, October 09, 2015 3:25 PM

> To: Kumar, Venkataramanan

> Cc: gcc-patches@gcc.gnu.org

> Subject: Re: [Patch] [x86_64]: Add bdver4 for multi versioning and fix AMD

> cpu model detection.

> 

> On Fri, Oct 9, 2015 at 11:50 AM, Kumar, Venkataramanan

> <Venkataramanan.Kumar@amd.com> wrote:

> > Hi Uros,

> >

> > Please find below patch that adds bdver4 target for multi versioning.

> > Also I while computing model, the extended_model is incorrectly left

> shifted  by 4. I have removed it now.

> >

> > Is below patch Ok for trunk ?

> > GCC bootstrap and regressions passed.

> 

> OK for trunk and release branches, where applicable. IMO, model selection

> fix should be applied to all release branches.

> 

> Thanks,

> Uros.

> 

> > diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index

> > bb3a722..8676747 100644

> > --- a/libgcc/ChangeLog

> > +++ b/libgcc/ChangeLog

> > @@ -1,3 +1,8 @@

> > +2015-10-09  Venkataramanan Kumar

> <venkataramanan.kumar@amd.com>

> > +

> > +       * config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.

> > +       (__cpu_indicator_init): Fix model selection for AMD CPUs.

> > +

> >  2015-10-05  Kirill Yukhin  <kirill.yukhin@intel.com>

> >

> >         * config/i386/cpuinfo.c (get_intel_cpu): Detect "skylake-avx512".

> > diff --git a/libgcc/config/i386/cpuinfo.c

> > b/libgcc/config/i386/cpuinfo.c index 0cbbc85..1313ca3 100644

> > --- a/libgcc/config/i386/cpuinfo.c

> > +++ b/libgcc/config/i386/cpuinfo.c

> > @@ -169,6 +169,9 @@ get_amd_cpu (unsigned int family, unsigned int

> model)

> >        /* Bulldozer version 3 "Steamroller"  */

> >        if (model >= 0x30 && model <= 0x4f)

> >         __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;

> > +      /* Bulldozer version 4 "Excavator"   */

> > +      if (model >= 0x60 && model <= 0x7f)

> > +       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;

> >        break;

> >      /* AMD Family 16h "btver2" */

> >      case 0x16:

> > @@ -455,7 +458,7 @@ __cpu_indicator_init (void)

> >        if (family == 0x0f)

> >         {

> >           family += extended_family;

> > -         model += (extended_model << 4);

> > +         model += extended_model;

> >         }

> >

> >        /* Get CPU type.  */

> >

> > Regards,

> > Venkat.

> >

> >

> >

> >

> >

> >
Kumar, Venkataramanan Oct. 13, 2015, 3:16 p.m. UTC | #3
Hi Uros,

I realized both GCC 4.9 and GCC 5 branches includes processor subtype AMDFAM15H_BDVER4.
So I need to back port not only model selection fix but also the detection of model for bdver4.

Is that fine?

Regards,
Venkat.   

> -----Original Message-----

> From: Kumar, Venkataramanan

> Sent: Friday, October 09, 2015 3:31 PM

> To: 'Uros Bizjak'

> Cc: gcc-patches@gcc.gnu.org

> Subject: RE: [Patch] [x86_64]: Add bdver4 for multi versioning and fix AMD

> cpu model detection.

> 

> Thank you Uros,

> 

> I will  test and commit model selection change in all release branches as well.

> 

> Regards,

> Venkat.

> 

> > -----Original Message-----

> > From: Uros Bizjak [mailto:ubizjak@gmail.com]

> > Sent: Friday, October 09, 2015 3:25 PM

> > To: Kumar, Venkataramanan

> > Cc: gcc-patches@gcc.gnu.org

> > Subject: Re: [Patch] [x86_64]: Add bdver4 for multi versioning and fix

> > AMD cpu model detection.

> >

> > On Fri, Oct 9, 2015 at 11:50 AM, Kumar, Venkataramanan

> > <Venkataramanan.Kumar@amd.com> wrote:

> > > Hi Uros,

> > >

> > > Please find below patch that adds bdver4 target for multi versioning.

> > > Also I while computing model, the extended_model is incorrectly left

> > shifted  by 4. I have removed it now.

> > >

> > > Is below patch Ok for trunk ?

> > > GCC bootstrap and regressions passed.

> >

> > OK for trunk and release branches, where applicable. IMO, model

> > selection fix should be applied to all release branches.

> >

> > Thanks,

> > Uros.

> >

> > > diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index

> > > bb3a722..8676747 100644

> > > --- a/libgcc/ChangeLog

> > > +++ b/libgcc/ChangeLog

> > > @@ -1,3 +1,8 @@

> > > +2015-10-09  Venkataramanan Kumar

> > <venkataramanan.kumar@amd.com>

> > > +

> > > +       * config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.

> > > +       (__cpu_indicator_init): Fix model selection for AMD CPUs.

> > > +

> > >  2015-10-05  Kirill Yukhin  <kirill.yukhin@intel.com>

> > >

> > >         * config/i386/cpuinfo.c (get_intel_cpu): Detect "skylake-avx512".

> > > diff --git a/libgcc/config/i386/cpuinfo.c

> > > b/libgcc/config/i386/cpuinfo.c index 0cbbc85..1313ca3 100644

> > > --- a/libgcc/config/i386/cpuinfo.c

> > > +++ b/libgcc/config/i386/cpuinfo.c

> > > @@ -169,6 +169,9 @@ get_amd_cpu (unsigned int family, unsigned int

> > model)

> > >        /* Bulldozer version 3 "Steamroller"  */

> > >        if (model >= 0x30 && model <= 0x4f)

> > >         __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;

> > > +      /* Bulldozer version 4 "Excavator"   */

> > > +      if (model >= 0x60 && model <= 0x7f)

> > > +       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;

> > >        break;

> > >      /* AMD Family 16h "btver2" */

> > >      case 0x16:

> > > @@ -455,7 +458,7 @@ __cpu_indicator_init (void)

> > >        if (family == 0x0f)

> > >         {

> > >           family += extended_family;

> > > -         model += (extended_model << 4);

> > > +         model += extended_model;

> > >         }

> > >

> > >        /* Get CPU type.  */

> > >

> > > Regards,

> > > Venkat.

> > >

> > >

> > >

> > >

> > >

> > >
Uros Bizjak Oct. 13, 2015, 3:42 p.m. UTC | #4
On Tue, Oct 13, 2015 at 5:16 PM, Kumar, Venkataramanan
<Venkataramanan.Kumar@amd.com> wrote:
> Hi Uros,
>
> I realized both GCC 4.9 and GCC 5 branches includes processor subtype AMDFAM15H_BDVER4.
> So I need to back port not only model selection fix but also the detection of model for bdver4.
>
> Is that fine?

OK, but to avoid ABI mismatches, please double check that enum values
passed between library and compiled code are always the same in all
gcc releases.

Uros.

> Regards,
> Venkat.
>
>> -----Original Message-----
>> From: Kumar, Venkataramanan
>> Sent: Friday, October 09, 2015 3:31 PM
>> To: 'Uros Bizjak'
>> Cc: gcc-patches@gcc.gnu.org
>> Subject: RE: [Patch] [x86_64]: Add bdver4 for multi versioning and fix AMD
>> cpu model detection.
>>
>> Thank you Uros,
>>
>> I will  test and commit model selection change in all release branches as well.
>>
>> Regards,
>> Venkat.
>>
>> > -----Original Message-----
>> > From: Uros Bizjak [mailto:ubizjak@gmail.com]
>> > Sent: Friday, October 09, 2015 3:25 PM
>> > To: Kumar, Venkataramanan
>> > Cc: gcc-patches@gcc.gnu.org
>> > Subject: Re: [Patch] [x86_64]: Add bdver4 for multi versioning and fix
>> > AMD cpu model detection.
>> >
>> > On Fri, Oct 9, 2015 at 11:50 AM, Kumar, Venkataramanan
>> > <Venkataramanan.Kumar@amd.com> wrote:
>> > > Hi Uros,
>> > >
>> > > Please find below patch that adds bdver4 target for multi versioning.
>> > > Also I while computing model, the extended_model is incorrectly left
>> > shifted  by 4. I have removed it now.
>> > >
>> > > Is below patch Ok for trunk ?
>> > > GCC bootstrap and regressions passed.
>> >
>> > OK for trunk and release branches, where applicable. IMO, model
>> > selection fix should be applied to all release branches.
>> >
>> > Thanks,
>> > Uros.
>> >
>> > > diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index
>> > > bb3a722..8676747 100644
>> > > --- a/libgcc/ChangeLog
>> > > +++ b/libgcc/ChangeLog
>> > > @@ -1,3 +1,8 @@
>> > > +2015-10-09  Venkataramanan Kumar
>> > <venkataramanan.kumar@amd.com>
>> > > +
>> > > +       * config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.
>> > > +       (__cpu_indicator_init): Fix model selection for AMD CPUs.
>> > > +
>> > >  2015-10-05  Kirill Yukhin  <kirill.yukhin@intel.com>
>> > >
>> > >         * config/i386/cpuinfo.c (get_intel_cpu): Detect "skylake-avx512".
>> > > diff --git a/libgcc/config/i386/cpuinfo.c
>> > > b/libgcc/config/i386/cpuinfo.c index 0cbbc85..1313ca3 100644
>> > > --- a/libgcc/config/i386/cpuinfo.c
>> > > +++ b/libgcc/config/i386/cpuinfo.c
>> > > @@ -169,6 +169,9 @@ get_amd_cpu (unsigned int family, unsigned int
>> > model)
>> > >        /* Bulldozer version 3 "Steamroller"  */
>> > >        if (model >= 0x30 && model <= 0x4f)
>> > >         __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;
>> > > +      /* Bulldozer version 4 "Excavator"   */
>> > > +      if (model >= 0x60 && model <= 0x7f)
>> > > +       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;
>> > >        break;
>> > >      /* AMD Family 16h "btver2" */
>> > >      case 0x16:
>> > > @@ -455,7 +458,7 @@ __cpu_indicator_init (void)
>> > >        if (family == 0x0f)
>> > >         {
>> > >           family += extended_family;
>> > > -         model += (extended_model << 4);
>> > > +         model += extended_model;
>> > >         }
>> > >
>> > >        /* Get CPU type.  */
>> > >
>> > > Regards,
>> > > Venkat.
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
Kumar, Venkataramanan Oct. 18, 2015, 6:45 p.m. UTC | #5
Hi Uros,

> -----Original Message-----

> From: Uros Bizjak [mailto:ubizjak@gmail.com]

> Sent: Tuesday, October 13, 2015 9:12 PM

> To: Kumar, Venkataramanan

> Cc: gcc-patches@gcc.gnu.org

> Subject: Re: [Patch] [x86_64]: Add bdver4 for multi versioning and fix AMD

> cpu model detection.

> 

> On Tue, Oct 13, 2015 at 5:16 PM, Kumar, Venkataramanan

> <Venkataramanan.Kumar@amd.com> wrote:

> > Hi Uros,

> >

> > I realized both GCC 4.9 and GCC 5 branches includes processor subtype

> AMDFAM15H_BDVER4.

> > So I need to back port not only model selection fix but also the detection of

> model for bdver4.

> >

> > Is that fine?

> 

> OK, but to avoid ABI mismatches, please double check that enum values

> passed between library and compiled code are always the same in all gcc

> releases.

> 


I verified and same enum value is passed by gcc and libgcc in GCC 5 and GCC 4-9 branches.
Also ran gcc bootstrap and gcc regression tests on a bdver4 machine .

Completed the back ports.

GCC 4_9
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=228953
 
GCC 5 
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=228951

> Uros.

> 

> > Regards,

> > Venkat.

> >

> >> -----Original Message-----

> >> From: Kumar, Venkataramanan

> >> Sent: Friday, October 09, 2015 3:31 PM

> >> To: 'Uros Bizjak'

> >> Cc: gcc-patches@gcc.gnu.org

> >> Subject: RE: [Patch] [x86_64]: Add bdver4 for multi versioning and

> >> fix AMD cpu model detection.

> >>

> >> Thank you Uros,

> >>

> >> I will  test and commit model selection change in all release branches as

> well.

> >>

> >> Regards,

> >> Venkat.

> >>

> >> > -----Original Message-----

> >> > From: Uros Bizjak [mailto:ubizjak@gmail.com]

> >> > Sent: Friday, October 09, 2015 3:25 PM

> >> > To: Kumar, Venkataramanan

> >> > Cc: gcc-patches@gcc.gnu.org

> >> > Subject: Re: [Patch] [x86_64]: Add bdver4 for multi versioning and

> >> > fix AMD cpu model detection.

> >> >

> >> > On Fri, Oct 9, 2015 at 11:50 AM, Kumar, Venkataramanan

> >> > <Venkataramanan.Kumar@amd.com> wrote:

> >> > > Hi Uros,

> >> > >

> >> > > Please find below patch that adds bdver4 target for multi versioning.

> >> > > Also I while computing model, the extended_model is incorrectly

> >> > > left

> >> > shifted  by 4. I have removed it now.

> >> > >

> >> > > Is below patch Ok for trunk ?

> >> > > GCC bootstrap and regressions passed.

> >> >

> >> > OK for trunk and release branches, where applicable. IMO, model

> >> > selection fix should be applied to all release branches.

> >> >

> >> > Thanks,

> >> > Uros.

> >> >

> >> > > diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index

> >> > > bb3a722..8676747 100644

> >> > > --- a/libgcc/ChangeLog

> >> > > +++ b/libgcc/ChangeLog

> >> > > @@ -1,3 +1,8 @@

> >> > > +2015-10-09  Venkataramanan Kumar

> >> > <venkataramanan.kumar@amd.com>

> >> > > +

> >> > > +       * config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.

> >> > > +       (__cpu_indicator_init): Fix model selection for AMD CPUs.

> >> > > +

> >> > >  2015-10-05  Kirill Yukhin  <kirill.yukhin@intel.com>

> >> > >

> >> > >         * config/i386/cpuinfo.c (get_intel_cpu): Detect "skylake-avx512".

> >> > > diff --git a/libgcc/config/i386/cpuinfo.c

> >> > > b/libgcc/config/i386/cpuinfo.c index 0cbbc85..1313ca3 100644

> >> > > --- a/libgcc/config/i386/cpuinfo.c

> >> > > +++ b/libgcc/config/i386/cpuinfo.c

> >> > > @@ -169,6 +169,9 @@ get_amd_cpu (unsigned int family, unsigned

> >> > > int

> >> > model)

> >> > >        /* Bulldozer version 3 "Steamroller"  */

> >> > >        if (model >= 0x30 && model <= 0x4f)

> >> > >         __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;

> >> > > +      /* Bulldozer version 4 "Excavator"   */

> >> > > +      if (model >= 0x60 && model <= 0x7f)

> >> > > +       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;

> >> > >        break;

> >> > >      /* AMD Family 16h "btver2" */

> >> > >      case 0x16:

> >> > > @@ -455,7 +458,7 @@ __cpu_indicator_init (void)

> >> > >        if (family == 0x0f)

> >> > >         {

> >> > >           family += extended_family;

> >> > > -         model += (extended_model << 4);

> >> > > +         model += extended_model;

> >> > >         }

> >> > >

> >> > >        /* Get CPU type.  */

> >> > >

> >> > > Regards,

> >> > > Venkat.

> >> > >

> >> > >

> >> > >

> >> > >

> >> > >

> >> > >


Regards,
Venkat.
diff mbox

Patch

diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index bb3a722..8676747 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2015-10-09  Venkataramanan Kumar <venkataramanan.kumar@amd.com>
+
+       * config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.
+       (__cpu_indicator_init): Fix model selection for AMD CPUs.
+
 2015-10-05  Kirill Yukhin  <kirill.yukhin@intel.com>

        * config/i386/cpuinfo.c (get_intel_cpu): Detect "skylake-avx512".
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 0cbbc85..1313ca3 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -169,6 +169,9 @@  get_amd_cpu (unsigned int family, unsigned int model)
       /* Bulldozer version 3 "Steamroller"  */
       if (model >= 0x30 && model <= 0x4f)
        __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;
+      /* Bulldozer version 4 "Excavator"   */
+      if (model >= 0x60 && model <= 0x7f)
+       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;
       break;
     /* AMD Family 16h "btver2" */
     case 0x16:
@@ -455,7 +458,7 @@  __cpu_indicator_init (void)
       if (family == 0x0f)
        {
          family += extended_family;
-         model += (extended_model << 4);
+         model += extended_model;
        }

       /* Get CPU type.  */