[llvm-commits] [llvm] r139942 - in /llvm/trunk: lib/Target/ARM/ARMInstrThumb2.td test/MC/ARM/basic-thumb2-instructions.s
Jim Grosbach
grosbach at apple.com
Fri Sep 16 14:06:12 PDT 2011
Author: grosbach
Date: Fri Sep 16 16:06:12 2011
New Revision: 139942
URL: http://llvm.org/viewvc/llvm-project?rev=139942&view=rev
Log:
Thumb2 assembly parsing and encoding for STR(immediate).
Add aliases for STRB/STRH while there. Tests forthcoming for those.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=139942&r1=139941&r2=139942&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Fri Sep 16 16:06:12 2011
@@ -3864,3 +3864,19 @@
// STM w/o the .w suffix.
def : t2InstAlias<"stm${p} $Rn, $regs",
(t2STMIA GPR:$Rn, pred:$p, reglist:$regs)>;
+
+// Alias for STR, STRB, and STRH without the ".w" optional
+// width specifier.
+def : t2InstAlias<"str${p} $Rt, $addr",
+ (t2STRi12 GPR:$Rt, t2addrmode_imm12:$addr, pred:$p)>;
+def : t2InstAlias<"strb${p} $Rt, $addr",
+ (t2STRBi12 rGPR:$Rt, t2addrmode_imm12:$addr, pred:$p)>;
+def : t2InstAlias<"strh${p} $Rt, $addr",
+ (t2STRHi12 rGPR:$Rt, t2addrmode_imm12:$addr, pred:$p)>;
+
+def : t2InstAlias<"str${p} $Rt, $addr",
+ (t2STRs GPR:$Rt, t2addrmode_so_reg:$addr, pred:$p)>;
+def : t2InstAlias<"strb${p} $Rt, $addr",
+ (t2STRBs rGPR:$Rt, t2addrmode_so_reg:$addr, pred:$p)>;
+def : t2InstAlias<"strh${p} $Rt, $addr",
+ (t2STRHs rGPR:$Rt, t2addrmode_so_reg:$addr, pred:$p)>;
Modified: llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s?rev=139942&r1=139941&r2=139942&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s Fri Sep 16 16:06:12 2011
@@ -2161,6 +2161,22 @@
@------------------------------------------------------------------------------
+@ STR(immediate)
+ at ------------------------------------------------------------------------------
+ str r5, [r5, #-4]
+ str r5, [r6, #32]
+ str r5, [r6, #33]
+ str r5, [r6, #257]
+ str.w pc, [r7, #257]
+
+@ CHECK: str r5, [r5, #-4] @ encoding: [0x45,0xf8,0x04,0x5c]
+@ CHECK: str r5, [r6, #32] @ encoding: [0x35,0x62]
+@ CHECK: str.w r5, [r6, #33] @ encoding: [0xc6,0xf8,0x21,0x50]
+@ CHECK: str.w r5, [r6, #257] @ encoding: [0xc6,0xf8,0x01,0x51]
+@ CHECK: str.w pc, [r7, #257] @ encoding: [0xc7,0xf8,0x01,0xf1]
+
+
+ at ------------------------------------------------------------------------------
@ SUB (register)
@------------------------------------------------------------------------------
sub.w r5, r2, r12, rrx
More information about the llvm-commits
mailing list