summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMBaseInfo.h
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-02-14 13:09:44 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-02-14 13:09:44 +0000
commit90d1dfe4c6e6cbad825017757ed45f4a66000f40 (patch)
treed2b1a7a7bd112e15846eafe75bfe35fc9043080f /llvm/lib/Target/ARM/ARMBaseInfo.h
parent2d9a7672db4e5258f74e0ceacdf4e70e7284fbce (diff)
downloadbcm5719-llvm-90d1dfe4c6e6cbad825017757ed45f4a66000f40.tar.gz
bcm5719-llvm-90d1dfe4c6e6cbad825017757ed45f4a66000f40.zip
Fix encoding and add parsing support for the arm/thumb CPS instruction:
- Add custom operand matching for imod and iflags. - Rename SplitMnemonicAndCC to SplitMnemonic since it splits more than CC from mnemonic. - While adding ".w" as an operand, don't change "Head" to avoid passing the wrong mnemonic to ParseOperand. - Add asm parser tests. - Add disassembler tests just to make sure it can catch all cps versions. llvm-svn: 125489
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInfo.h')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseInfo.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInfo.h b/llvm/lib/Target/ARM/ARMBaseInfo.h
index 6054bb773e7..a56cc1a9f24 100644
--- a/llvm/lib/Target/ARM/ARMBaseInfo.h
+++ b/llvm/lib/Target/ARM/ARMBaseInfo.h
@@ -97,6 +97,36 @@ inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
}
}
+namespace ARM_PROC {
+ enum IMod {
+ IE = 2,
+ ID = 3
+ };
+
+ enum IFlags {
+ F = 1,
+ I = 2,
+ A = 4
+ };
+
+ inline static const char *IFlagsToString(unsigned val) {
+ switch (val) {
+ default: llvm_unreachable("Unknown iflags operand");
+ case F: return "f";
+ case I: return "i";
+ case A: return "a";
+ }
+ }
+
+ inline static const char *IModToString(unsigned val) {
+ switch (val) {
+ default: llvm_unreachable("Unknown imod operand");
+ case IE: return "ie";
+ case ID: return "id";
+ }
+ }
+}
+
namespace ARM_MB {
// The Memory Barrier Option constants map directly to the 4-bit encoding of
// the option field for memory barrier operations.
OpenPOWER on IntegriCloud