Set the encoding bits to {0,?,?,0}, not 0. Plus delegate the disassembly of ADR to
the more generic ADDri/SUBri instructions, and add a test case for that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128234
91177308-0d34-0410-b5e6-
96231b3b80d8
// The 'adr' mnemonic encodes differently if the label is before or after
// the instruction. The {24-21} opcode bits are set by the fixup, as we don't
// know until then which form of the instruction will be used.
// The 'adr' mnemonic encodes differently if the label is before or after
// the instruction. The {24-21} opcode bits are set by the fixup, as we don't
// know until then which form of the instruction will be used.
-def ADR : AI1<0, (outs GPR:$Rd), (ins adrlabel:$label),
+def ADR : AI1<{0,?,?,0}, (outs GPR:$Rd), (ins adrlabel:$label),
MiscFrm, IIC_iALUi, "adr", "\t$Rd, #$label", []> {
bits<4> Rd;
bits<12> label;
MiscFrm, IIC_iALUi, "adr", "\t$Rd, #$label", []> {
bits<4> Rd;
bits<12> label;
# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 | FileCheck %s
# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 | FileCheck %s
+# CHECK: addpl r4, pc, #19, 8
+0x4c 0x45 0x8f 0x52
+
# CHECK: b #0
0x00 0x00 0x00 0xea
# CHECK: b #0
0x00 0x00 0x00 0xea
Name == "MOVr_TC")
return false;
Name == "MOVr_TC")
return false;
+ // Delegate ADR disassembly to the more generic ADDri/SUBri instructions.
+ if (Name == "ADR")
+ return false;
+
//
// The following special cases are for conflict resolutions.
//
//
// The following special cases are for conflict resolutions.
//