]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Correct AVX10 CPUID emulation
authorHaochen Jiang <haochen.jiang@intel.com>
Tue, 9 Jul 2024 08:31:02 +0000 (16:31 +0800)
committerHaochen Jiang <haochen.jiang@intel.com>
Tue, 9 Jul 2024 08:50:12 +0000 (16:50 +0800)
AVX10 Documentaion has specified ecx value as 0 for AVX10 version and
vector size under 0x24 subleaf. Although for ecx=1, the bits are all
reserved for now, we still need to specify ecx as 0 to avoid dirty
value in ecx.

gcc/ChangeLog:

* common/config/i386/cpuinfo.h (get_available_features): Correct
AVX10 CPUID emulation to specify ecx value.

gcc/common/config/i386/cpuinfo.h

index 936039725ab6c54a8ed2154b2fb2c7f59df2beac..2ae77d335d24c2ea23b7cc06edef2f835c05d606 100644 (file)
@@ -998,10 +998,10 @@ get_available_features (struct __processor_model *cpu_model,
        }
     }
 
-  /* Get Advanced Features at level 0x24 (eax = 0x24).  */
+  /* Get Advanced Features at level 0x24 (eax = 0x24, ecx = 0).  */
   if (avx10_set && max_cpuid_level >= 0x24)
     {
-      __cpuid (0x24, eax, ebx, ecx, edx);
+      __cpuid_count (0x24, 0, eax, ebx, ecx, edx);
       version = ebx & 0xff;
       if (ebx & bit_AVX10_256)
        switch (version)