aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/ARM/ARMInstrInfo.td8
-rw-r--r--test/CodeGen/ARM/mem.ll15
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td
index 37ec3603d9..816970f116 100644
--- a/lib/Target/ARM/ARMInstrInfo.td
+++ b/lib/Target/ARM/ARMInstrInfo.td
@@ -184,6 +184,14 @@ def str : InstARM<(ops IntRegs:$src, memri:$addr),
"str $src, $addr",
[(store IntRegs:$src, iaddr:$addr)]>;
+def STRB : InstARM<(ops IntRegs:$src, IntRegs:$addr),
+ "strb $src, [$addr]",
+ [(truncstorei8 IntRegs:$src, IntRegs:$addr)]>;
+
+def STRH : InstARM<(ops IntRegs:$src, IntRegs:$addr),
+ "strh $src, [$addr]",
+ [(truncstorei16 IntRegs:$src, IntRegs:$addr)]>;
+
def MOV : InstARM<(ops IntRegs:$dst, op_addr_mode1:$src),
"mov $dst, $src", [(set IntRegs:$dst, addr_mode1:$src)]>;
diff --git a/test/CodeGen/ARM/mem.ll b/test/CodeGen/ARM/mem.ll
new file mode 100644
index 0000000000..1bd328c3cc
--- /dev/null
+++ b/test/CodeGen/ARM/mem.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=arm &&
+; RUN: llvm-as < %s | llc -march=arm | grep strb &&
+; RUN: llvm-as < %s | llc -march=arm | grep strh
+
+void %f1() {
+entry:
+ store ubyte 0, ubyte* null
+ ret void
+}
+
+void %f2() {
+entry:
+ store short 0, short* null
+ ret void
+}