diff options
author | Oliver Stannard <oliver.stannard@arm.com> | 2016-11-10 13:20:41 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@arm.com> | 2016-11-10 13:20:41 +0000 |
commit | 18ca2adf2d22e2fc35e2406543a524efa8bbb144 (patch) | |
tree | 14aff9fdc7643d3c5e8215530345d5bfda535846 | |
parent | 12e8a92acd77d0ec5925342cbe00decc0ef9bbfc (diff) | |
download | bcm5719-llvm-18ca2adf2d22e2fc35e2406543a524efa8bbb144.tar.gz bcm5719-llvm-18ca2adf2d22e2fc35e2406543a524efa8bbb144.zip |
[ARM] Thumb2 LDR (literal) should accept PC as the destination
The version of this instruction with the .w suffix already correctly accepts
this, but the alias without the .w did not.
Differential Revision: https://reviews.llvm.org/D26499
llvm-svn: 286446
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstrThumb2.td | 2 | ||||
-rw-r--r-- | llvm/test/MC/ARM/basic-thumb2-instructions.s | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrThumb2.td b/llvm/lib/Target/ARM/ARMInstrThumb2.td index c47b871abcc..8c865837cd8 100644 --- a/llvm/lib/Target/ARM/ARMInstrThumb2.td +++ b/llvm/lib/Target/ARM/ARMInstrThumb2.td @@ -4407,7 +4407,7 @@ def : t2InstAlias<"ldrsh${p} $Rt, $addr", (t2LDRSHs rGPR:$Rt, t2addrmode_so_reg:$addr, pred:$p)>; def : t2InstAlias<"ldr${p} $Rt, $addr", - (t2LDRpci GPRnopc:$Rt, t2ldrlabel:$addr, pred:$p)>; + (t2LDRpci GPR:$Rt, t2ldrlabel:$addr, pred:$p)>; def : t2InstAlias<"ldrb${p} $Rt, $addr", (t2LDRBpci rGPR:$Rt, t2ldrlabel:$addr, pred:$p)>; def : t2InstAlias<"ldrh${p} $Rt, $addr", diff --git a/llvm/test/MC/ARM/basic-thumb2-instructions.s b/llvm/test/MC/ARM/basic-thumb2-instructions.s index 4dfa6d35f6a..f0319717b99 100644 --- a/llvm/test/MC/ARM/basic-thumb2-instructions.s +++ b/llvm/test/MC/ARM/basic-thumb2-instructions.s @@ -886,6 +886,7 @@ _func: ldr.w r5, _foo ldr lr, (_strcmp-4) ldr sp, _foo + ldr pc, _foo @ CHECK: ldr.w r5, _foo @ encoding: [0x5f'A',0xf8'A',A,0x50'A'] @ CHECK: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12 @@ -899,6 +900,10 @@ _func: @ CHECK: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12 @ CHECK-BE: ldr.w sp, _foo @ encoding: [0xf8'A',0x5f'A',0xd0'A',A] @ CHECK-BE: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12 +@ CHECK: ldr.w pc, _foo @ encoding: [0x5f'A',0xf8'A',A,0xf0'A'] +@ CHECK: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12 +@ CHECK-BE: ldr.w pc, _foo @ encoding: [0xf8'A',0x5f'A',0xf0'A',A] +@ CHECK-BE: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12 ldr r7, [pc, #8] ldr.n r7, [pc, #8] |