McARM: Start marking T2 address operands as such, for the benefit of the parser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2011-01-18 03:06:03 +00:00
parent 55b5e85643
commit 2e3cea3153
2 changed files with 17 additions and 0 deletions

View File

@ -129,6 +129,7 @@ def t2addrmode_imm12 : Operand<i32>,
let PrintMethod = "printAddrModeImm12Operand";
let EncoderMethod = "getAddrModeImm12OpValue";
let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm);
let ParserMatchClass = MemMode5AsmOperand;
}
// ADR instruction labels.
@ -143,6 +144,7 @@ def t2addrmode_imm8 : Operand<i32>,
let PrintMethod = "printT2AddrModeImm8Operand";
let EncoderMethod = "getT2AddrModeImm8OpValue";
let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm);
let ParserMatchClass = MemMode5AsmOperand;
}
def t2am_imm8_offset : Operand<i32>,
@ -150,6 +152,7 @@ def t2am_imm8_offset : Operand<i32>,
[], [SDNPWantRoot]> {
let PrintMethod = "printT2AddrModeImm8OffsetOperand";
let EncoderMethod = "getT2AddrModeImm8OffsetOpValue";
let ParserMatchClass = MemMode5AsmOperand;
}
// t2addrmode_imm8s4 := reg +/- (imm8 << 2)
@ -157,6 +160,7 @@ def t2addrmode_imm8s4 : Operand<i32> {
let PrintMethod = "printT2AddrModeImm8s4Operand";
let EncoderMethod = "getT2AddrModeImm8s4OpValue";
let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm);
let ParserMatchClass = MemMode5AsmOperand;
}
def t2am_imm8s4_offset : Operand<i32> {
@ -169,6 +173,7 @@ def t2addrmode_so_reg : Operand<i32>,
let PrintMethod = "printT2AddrModeSoRegOperand";
let EncoderMethod = "getT2AddrModeSORegOpValue";
let MIOperandInfo = (ops GPR:$base, rGPR:$offsreg, i32imm:$offsimm);
let ParserMatchClass = MemMode5AsmOperand;
}

View File

@ -0,0 +1,12 @@
@ RUN: llvm-mc -triple thumbv7-unknown-unknown -show-encoding %s > %t
@ RUN: FileCheck < %t %s
.syntax unified
.text
@ FIXME: This is not the correct instruction representation, but at least we are
@ parsing the ldr to something.
@
@ CHECK: ldr r0, [r7, #258]
ldr r0, [r7, #-8]