[clang] [X86][AVX10] Permit AVX512 options/features used together with AVX10 (PR #71318)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 9 05:52:52 PST 2023
================
@@ -131,35 +135,50 @@ bool X86TargetInfo::initFeatureMap(
continue;
}
- if (Feature.substr(0, 7) == "+avx10.") {
- HasAVX10 = true;
- HasAVX512F = true;
- if (Feature.substr(Feature.size() - 3, 3) == "512") {
- HasEVEX512 = true;
- } else if (Feature.substr(7, 2) == "1-") {
- HasEVEX512 = false;
+ if (Feature.substr(1, 6) == "avx10.") {
+ if (Feature[0] == '+') {
+ HasAVX10 = true;
+ if (Feature.substr(Feature.size() - 3, 3) == "512")
+ HasAVX10_512 = true;
+ LastAVX10 = Feature;
+ } else if (HasAVX10 && Feature == "-avx10.1-256") {
+ HasAVX10 = false;
+ HasAVX10_512 = false;
+ } else if (HasAVX10_512 && Feature == "-avx10.1-512") {
+ HasAVX10_512 = false;
}
+ // Postpone AVX10 features handling after AVX512 settled.
+ UpdatedAVX10FeaturesVec.push_back(Feature);
+ continue;
} else if (!HasAVX512F && Feature.substr(0, 7) == "+avx512") {
HasAVX512F = true;
+ LastAVX512 = Feature;
} else if (HasAVX512F && Feature == "-avx512f") {
HasAVX512F = false;
- } else if (HasAVX10 && Feature == "-avx10.1-256") {
- HasAVX10 = false;
- HasAVX512F = false;
- } else if (!HasEVEX512 && Feature == "+evex512") {
+ } else if (HasEVEX512 != true && Feature == "+evex512") {
----------------
phoebewang wrote:
I think "std::optional" doesn't help here because we need to distinguish the uninitialized status and false too.
https://github.com/llvm/llvm-project/pull/71318
More information about the cfe-commits
mailing list