On 7/19/24 12:34 PM, Michael Meissner wrote:
> On Thu, Jul 18, 2024 at 08:08:44AM -0500, Segher Boessenkool wrote:
>>> --- a/gcc/config/rs6000/ppc-auxv.h
>>> +++ b/gcc/config/rs6000/ppc-auxv.h
>>> @@ -47,9 +47,8 @@
>>>  #define PPC_PLATFORM_PPC476            12
>>>  #define PPC_PLATFORM_POWER8            13
>>>  #define PPC_PLATFORM_POWER9            14
>>> -
>>> -/* This is not yet official.  */
>>>  #define PPC_PLATFORM_POWER10           15
>>> +#define PPC_PLATFORM_POWER11           16
>>
>> Please add a comment where the official thing is?
>>
>> It is in glibc dl-procinfo.h, and there *cannot* be more than 16
>> platforms currently, so how can this work?  Or do we get data
>> directly from the kernel, or what?
>>
>> But you tested it, so you do obviously get PPC_PLATFORM_POWER11 from
>> somewhere.  I cannot see from where though?
> 
> In other discussions, I was told that 16 with be the platform number for the
> kernel in the future.

The AT_PLATFORM from the kernel is a string, not an integer.
To make __builtin_cpu_is ("power11") work efficiently, GLIBC stores
an integer representing each cpu AT_PLATFORM string in the TCB.
It is therefore GLIBC which "owns" the integer versions of the
platform values and yes, 16 is the correct value for Power11 and
that value exists in upstream GLIBC.

Peter


Reply via email to