[clang] [X86][RFC] Support AVX10 options (PR #67278)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 17 23:47:42 PDT 2023


================
@@ -130,17 +131,35 @@ bool X86TargetInfo::initFeatureMap(
       continue;
     }
 
-    if (!HasAVX512F && Feature.substr(0, 7) == "+avx512")
+    if (Feature.substr(0, 7) == "+avx10.") {
+      HasAVX10 = true;
       HasAVX512F = true;
-    if (HasAVX512F && Feature == "-avx512f")
+      if (Feature.substr(Feature.size() - 3, 3) == "512") {
+        HasEVEX512 = true;
+      } else if (Feature.substr(7, 2) == "1-") {
----------------
phoebewang wrote:

We have convention that features are independent to each other and can be combined as a union set.
For example, when you specify `-mavx2 -mfma`, you will enable both features rather than disabling AVX2, though FMA only imply AVX1.
Similarly, we should avoid to disable `avx10.1-512` in combination of `-mavx10.1-512 -mavx10.2-256` just because `avx10.2-256` only implies `avx10.1-256`.

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


More information about the cfe-commits mailing list