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

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 2 07:48:01 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) {
----------------
phoebewang wrote:

No. There're two problems from compiling:

- compiler-rt doesn't support `llvm_unreachable`;
- some buildbot will warn about `[[fallthrough]]`

But yes, I found the implications problem during revisiting it, i.e., an old version compiler-rt runs on future HW.

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


More information about the cfe-commits mailing list