[llvm] 20741c7 - [llvm][AArch64] Fix "+all" feature for sysreg aliases
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 01:41:57 PDT 2022
Author: David Spickett
Date: 2022-07-06T08:41:53Z
New Revision: 20741c74c501733dbabda0848cef472131926f0c
URL: https://github.com/llvm/llvm-project/commit/20741c74c501733dbabda0848cef472131926f0c
DIFF: https://github.com/llvm/llvm-project/commit/20741c74c501733dbabda0848cef472131926f0c.diff
LOG: [llvm][AArch64] Fix "+all" feature for sysreg aliases
For example the predres extension adds one instruction that
is a sys alias. Previously this wasn't disassembled properly
with "+all".
This was because a check for "+all" was added to haveFeatures
in AArch64SysReg but not in SysAlias.
Reviewed By: MaskRay, lenary
Differential Revision: https://reviews.llvm.org/D129147
Added:
Modified:
llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
llvm/test/MC/Disassembler/AArch64/mattr-all.txt
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h b/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
index 71303611265c9..cf8891cff1b3e 100644
--- a/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
+++ b/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
@@ -343,7 +343,8 @@ struct SysAlias {
: Name(N), Encoding(E), FeaturesRequired(F) {}
bool haveFeatures(FeatureBitset ActiveFeatures) const {
- return (FeaturesRequired & ActiveFeatures) == FeaturesRequired;
+ return ActiveFeatures[llvm::AArch64::FeatureAll] ||
+ (FeaturesRequired & ActiveFeatures) == FeaturesRequired;
}
FeatureBitset getRequiredFeatures() const { return FeaturesRequired; }
diff --git a/llvm/test/MC/Disassembler/AArch64/mattr-all.txt b/llvm/test/MC/Disassembler/AArch64/mattr-all.txt
index 0d3f13fb76a9b..87dc73a1e7ce7 100644
--- a/llvm/test/MC/Disassembler/AArch64/mattr-all.txt
+++ b/llvm/test/MC/Disassembler/AArch64/mattr-all.txt
@@ -35,3 +35,7 @@
## armv9a rme
# CHECK: mrs x0, MFAR_EL3
[0xa0,0x60,0x3e,0xd5]
+
+## predres (to make sure sysreg aliases work)
+# CHECK: cfp rctx, x0
+[0x80,0x73,0x0b,0xd5]
More information about the llvm-commits
mailing list