x86 cpuid.h updated to pass leaf argument to __get_cpuid_max
x86 cpuid.h fix ensures leaf argument is passed correctly, resolving testsuite regressions.
The x86 cpuid.h header has been updated to correctly pass the leaf argument to __get_cpuid_max. This change resolves regressions in the testsuite, specifically a vectorization test that failed due to incorrect CPUID information being used. The fix involves directly passing the leaf argument and applying a mask before invoking the CPUID instruction.
In Details
This commit modifies config/i386/cpuid.h to address PR testsuite/126697. The functions __get_cpuid and __get_cpuid_count were previously not correctly handling the leaf argument when calling __get_cpuid_max. The change ensures the __leaf argument is passed directly and masked with 0xC0000000 before being used by the CPUID instruction, which resolves issues seen in vectorization diagnostics.
- cpuid
- An x86 instruction that allows software to identify the processor's capabilities and features. It is used to query information such as the vendor, model, and supported instruction sets.
- leaf
- In the context of the CPUID instruction, a 'leaf' refers to a specific input value (typically in the EAX register) that selects a particular set of information to be returned by the CPUID instruction.
- vectorization
- An optimization technique where a single instruction operates on multiple data elements simultaneously, often leveraging SIMD (Single Instruction, Multiple Data) extensions.
- tree-ssa
- Static Single Assignment form. An intermediate representation used in compilers that makes data-flow analysis simpler by ensuring that every variable is assigned a value exactly once.