aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Smith <peter.smith@arm.com>2016-05-11 13:47:17 +0100
committerPeter Smith <peter.smith@arm.com>2016-05-11 13:47:17 +0100
commit9e6f5c1c50a8d4b1d2520ee3940695d82bd5a473 (patch)
tree9aca1684e67a6c038cecd6661d466fd449fc9a8c
parent32ba5cd276701e439e639003dfa3e92817c0c4fc (diff)
[ARM] ARM mov InstAlias for MOVW lacks HasV6T2linaro-local/armv5movt
The movw instruction is only available in ARM state for V6T2 and above. The MOVi16 instruction has condition HasV6T2 but the InstAlias for "mov${p} $Rd, $imm" does not. This means that movw can incorrectly be used in ARMv4 and ARMv5. Change-Id: I33d6404b12d90f0330c254814b75df3e9ff3d351
-rw-r--r--lib/Target/ARM/ARMInstrInfo.td2
-rw-r--r--test/MC/ARM/not-armv4.s5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td
index 25472b5e1db..8e53acbcae3 100644
--- a/lib/Target/ARM/ARMInstrInfo.td
+++ b/lib/Target/ARM/ARMInstrInfo.td
@@ -3328,7 +3328,7 @@ def MOVi16 : AI1<0b1000, (outs GPR:$Rd), (ins imm0_65535_expr:$imm),
def : InstAlias<"mov${p} $Rd, $imm",
(MOVi16 GPR:$Rd, imm0_65535_expr:$imm, pred:$p)>,
- Requires<[IsARM]>;
+ Requires<[IsARM, HasV6T2]>;
def MOVi16_ga_pcrel : PseudoInst<(outs GPR:$Rd),
(ins i32imm:$addr, pclabel:$id), IIC_iMOVi, []>,
diff --git a/test/MC/ARM/not-armv4.s b/test/MC/ARM/not-armv4.s
index a1ba611a61e..d25281a4bc4 100644
--- a/test/MC/ARM/not-armv4.s
+++ b/test/MC/ARM/not-armv4.s
@@ -6,3 +6,8 @@ clz r4,r9
@ CHECK: error: instruction requires: armv6t2
rbit r4,r9
+
+@ CHECK: error: instruction requires: armv6t2
+movw r4,#0x1234
+@ CHECK: error: instruction requires: armv6t2
+mov r4,#0x1234