summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-28 16:33:54 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-28 16:33:54 +0000
commit8b3184e540945583ccd761e0924ae80eff323118 (patch)
tree33d87f483e04317450764f9d3a511c826df57c15
parent4356636fc02b090627e1fa82f2d94ae50c4f1aa1 (diff)
downloadbcm5719-llvm-8b3184e540945583ccd761e0924ae80eff323118.tar.gz
bcm5719-llvm-8b3184e540945583ccd761e0924ae80eff323118.zip
ARM parsing and encoding for ADR.
The label does not have a '#' prefix. Add parsing and encoding tests. llvm-svn: 136360
-rw-r--r--llvm/lib/Target/ARM/ARMInstrInfo.td2
-rw-r--r--llvm/test/MC/ARM/basic-arm-instructions.s14
2 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.td b/llvm/lib/Target/ARM/ARMInstrInfo.td
index 6641cbd073b..42e91f4091b 100644
--- a/llvm/lib/Target/ARM/ARMInstrInfo.td
+++ b/llvm/lib/Target/ARM/ARMInstrInfo.td
@@ -1436,7 +1436,7 @@ let neverHasSideEffects = 1, isReMaterializable = 1 in
// 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,?,?,0}, (outs GPR:$Rd), (ins adrlabel:$label),
- MiscFrm, IIC_iALUi, "adr", "\t$Rd, #$label", []> {
+ MiscFrm, IIC_iALUi, "adr", "\t$Rd, $label", []> {
bits<4> Rd;
bits<12> label;
let Inst{27-25} = 0b001;
diff --git a/llvm/test/MC/ARM/basic-arm-instructions.s b/llvm/test/MC/ARM/basic-arm-instructions.s
index 72d3b784485..1c33a73d14f 100644
--- a/llvm/test/MC/ARM/basic-arm-instructions.s
+++ b/llvm/test/MC/ARM/basic-arm-instructions.s
@@ -123,8 +123,20 @@ _func:
@------------------------------------------------------------------------------
-@ FIXME: ADR
+@ ADR
@------------------------------------------------------------------------------
+Lback:
+ adr r2, Lback
+ adr r3, Lforward
+Lforward:
+
+@ CHECK: Lback:
+@ CHECK: adr r2, Lback @ encoding: [0bAAAAAAA0,0x20'A',0x0f'A',0b1110001A]
+@ CHECK: @ fixup A - offset: 0, value: Lback, kind: fixup_arm_adr_pcrel_12
+@ CHECK: adr r3, Lforward @ encoding: [0bAAAAAAA0,0x30'A',0x0f'A',0b1110001A]
+@ CHECK: @ fixup A - offset: 0, value: Lforward, kind: fixup_arm_adr_pcrel_12
+@ CHECK: Lforward:
+
@------------------------------------------------------------------------------
@ ADD
OpenPOWER on IntegriCloud