summaryrefslogtreecommitdiff
path: root/llvm/lib/TargetParser/AArch64TargetParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TargetParser/AArch64TargetParser.cpp')
-rw-r--r--llvm/lib/TargetParser/AArch64TargetParser.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/TargetParser/AArch64TargetParser.cpp b/llvm/lib/TargetParser/AArch64TargetParser.cpp
index 4a2523440f0f..c17fa729bac4 100644
--- a/llvm/lib/TargetParser/AArch64TargetParser.cpp
+++ b/llvm/lib/TargetParser/AArch64TargetParser.cpp
@@ -50,7 +50,7 @@ std::optional<AArch64::ArchInfo> AArch64::ArchInfo::findBySubArch(StringRef SubA
std::optional<AArch64::FMVInfo> lookupFMVByID(AArch64::ArchExtKind ExtID) {
for (const AArch64::FMVInfo &Info : AArch64::getFMVInfo())
- if (Info.ID && *Info.ID == ExtID)
+ if (Info.ID == ExtID)
return Info;
return {};
}
@@ -298,6 +298,13 @@ void AArch64::ExtensionSet::disable(ArchExtKind E) {
if (E == AEK_SVE2AES)
disable(AEK_SVEAES);
+ // sve2-sha3 was historically associated with both FEAT_SVE2 and
+ // FEAT_SVE_SHA3, the latter is now associated with sve-sha3 and sve2-sha3 has
+ // become shorthand for +sve2+sve-sha3. For backwards compatibility, when we
+ // disable sve2-sha3 we must also disable sve-sha3.
+ if (E == AEK_SVE2SHA3)
+ disable(AEK_SVESHA3);
+
if (E == AEK_SVE2BITPERM){
disable(AEK_SVEBITPERM);
disable(AEK_SVE2);