[clang] [compiler-rt] [llvm] Reland "[X86][AVX10.2] Support AVX10.2 option and VMPSADBW/VADDP[D,H,S] new instructions (#101452)" (PR #101616)

Evgenii Kudriashov via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 07:25:15 PDT 2024


================
@@ -978,8 +978,20 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf,
 
   bool HasLeaf24 =
       MaxLevel >= 0x24 && !getX86CpuIDAndInfo(0x24, &EAX, &EBX, &ECX, &EDX);
-  if (HasLeaf7Subleaf1 && ((EDX >> 19) & 1) && HasLeaf24 && ((EBX >> 18) & 1))
-    setFeature(FEATURE_AVX10_1_512);
+  if (HasLeaf7Subleaf1 && ((EDX >> 19) & 1) && HasLeaf24) {
+    bool Has512Len = (EBX >> 18) & 1;
+    int AVX10Ver = EBX & 0xff;
+    if (AVX10Ver >= 2) {
+      setFeature(FEATURE_AVX10_2_256);
+      if (Has512Len)
+        setFeature(FEATURE_AVX10_2_512);
+    }
+    if (AVX10Ver >= 1) {
----------------
e-kud wrote:

Is the reason of relanding that compiler-rt parses the literal cpuid without any implications?

https://github.com/llvm/llvm-project/pull/101616


More information about the cfe-commits mailing list