[NFC][Clang][AArch64] Clean up AArch64TargetInfo::hasFeature

This commit is contained in:
Archibald Elliott 2022-02-25 18:39:34 +00:00
parent eac2638ec1
commit 220da125c4

View File

@ -511,14 +511,12 @@ AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts) const {
}
bool AArch64TargetInfo::hasFeature(StringRef Feature) const {
return Feature == "aarch64" || Feature == "arm64" || Feature == "arm" ||
(Feature == "neon" && (FPU & NeonMode)) ||
((Feature == "sve" || Feature == "sve2" || Feature == "sve2-bitperm" ||
Feature == "sve2-aes" || Feature == "sve2-sha3" ||
Feature == "sve2-sm4" || Feature == "f64mm" || Feature == "f32mm" ||
Feature == "i8mm" || Feature == "bf16") &&
(FPU & SveMode)) ||
(Feature == "ls64" && HasLS64);
return llvm::StringSwitch<bool>(Feature)
.Cases("aarch64", "arm64", "arm", true)
.Case("neon", FPU & NeonMode)
.Cases("sve", "sve2", "sve2-bitperm", "sve2-aes", "sve2-sha3", "sve2-sm4", "f64mm", "f32mm", "i8mm", "bf16", FPU & SveMode)
.Case("ls64", HasLS64)
.Default(false);
}
bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,