Hello,
On Fri, Sep 26 2025, Kalvakuntla, Umesh wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Hello Martin,
>
> Can you please commit this? I don't have the required rights.
Honza is in favor, so I think I can. Can you please write the
corresponding ChangeLog and provide information how the patch has been
tested?
Thank you,
Martin
>> gcc/common/config/i386/cpuinfo.h | 12 +++++++++++-
>> gcc/config/i386/cpuid.h | 4 ++++
>> 2 files changed, 15 insertions(+), 1 deletion(-)
>>
>> diff --git a/gcc/common/config/i386/cpuinfo.h
>> b/gcc/common/config/i386/cpuinfo.h
>> index c93ea07239a..3f29f17e2a5 100644
>> --- a/gcc/common/config/i386/cpuinfo.h
>> +++ b/gcc/common/config/i386/cpuinfo.h
>> @@ -312,7 +312,8 @@ get_amd_cpu (struct __processor_model *cpu_model,
>> break;
>> case 0x1a:
>> cpu_model->__cpu_type = AMDFAM1AH;
>> - if (model <= 0x77)
>> + if (model <= 0x4f || (model >= 0x60 && model <= 0x77) ||
>> + (model >= 0xd0 && model <= 0xd7))
>> {
>> cpu = "znver5";
>> CHECK___builtin_cpu_is ("znver5");
>> @@ -1102,6 +1103,15 @@ get_available_features (struct __processor_model
>> *cpu_model,
>> set_feature (FEATURE_WBNOINVD);
>> }
>>
>> + if (ext_level >= 0x80000021)
>> + {
>> + __cpuid (0x80000021, eax, ebx, ecx, edx);
>> + if (eax & bit_AMD_PREFETCHI)
>> + {
>> + set_feature (FEATURE_PREFETCHI);
>> + }
>> + }
>> +
>> #undef set_feature
>> }
>>
>> diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h index
>> afd4ef06e9f..dac01d887f1 100644
>> --- a/gcc/config/i386/cpuid.h
>> +++ b/gcc/config/i386/cpuid.h
>> @@ -72,6 +72,10 @@
>> #define bit_CLZERO (1 << 0)
>> #define bit_WBNOINVD (1 << 9)
>>
>> +/* Extended Features (%eax == 0x80000021) */
>> +/* %eax */
>> +#define bit_AMD_PREFETCHI (1 << 20)
>> +
>> /* Extended Features Leaf (%eax == 7, %ecx == 0) */
>> /* %ebx */
>> #define bit_FSGSBASE (1 << 0)
>> --
>> 2.43.0
>>
>>