[llvm-commits] [llvm] r78410 - in /llvm/trunk: lib/Target/ARM/ARMInstrThumb2.td lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/Thumb2/thumb2-ldm.ll
Evan Cheng
evan.cheng at apple.com
Fri Aug 7 14:19:11 PDT 2009
Author: evancheng
Date: Fri Aug 7 16:19:10 2009
New Revision: 78410
URL: http://llvm.org/viewvc/llvm-project?rev=78410&view=rev
Log:
Thumb2 32-bit ldm / stm needs .w suffix if submode is ia.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/test/CodeGen/Thumb2/thumb2-ldm.ll
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=78410&r1=78409&r2=78410&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Fri Aug 7 16:19:10 2009
@@ -651,12 +651,12 @@
let mayLoad = 1 in
def t2LDM : T2XI<(outs),
(ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops),
- IIC_iLoad, "ldm${addr:submode}${p} $addr, $dst1", []>;
+ IIC_iLoad, "ldm${addr:submode}${p}${addr:wide} $addr, $dst1", []>;
let mayStore = 1 in
def t2STM : T2XI<(outs),
(ins addrmode4:$addr, pred:$p, reglist:$src1, variable_ops),
- IIC_iStore, "stm${addr:submode}${p} $addr, $src1", []>;
+ IIC_iStore, "stm${addr:submode}${p}${addr:wide} $addr, $src1", []>;
//===----------------------------------------------------------------------===//
// Move Instructions.
@@ -1072,7 +1072,7 @@
let isReturn = 1, isTerminator = 1, mayLoad = 1 in
def t2LDM_RET : T2XI<(outs),
(ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops),
- IIC_iLoad, "ldm${addr:submode}${p} $addr, $dst1",
+ IIC_iLoad, "ldm${addr:submode}${p}${addr:wide} $addr, $dst1",
[]>;
let isBranch = 1, isTerminator = 1, isBarrier = 1 in {
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=78410&r1=78409&r2=78410&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Fri Aug 7 16:19:10 2009
@@ -599,6 +599,10 @@
O << ARM_AM::getAMSubModeAltStr(Mode, isLDM);
} else
O << ARM_AM::getAMSubModeStr(Mode);
+ } else if (Modifier && strcmp(Modifier, "wide") == 0) {
+ ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO2.getImm());
+ if (Mode == ARM_AM::ia)
+ O << ".w";
} else {
printOperand(MI, Op);
if (ARM_AM::getAM4WBFlag(MO2.getImm()))
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-ldm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ldm.ll?rev=78410&r1=78409&r2=78410&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-ldm.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ldm.ll Fri Aug 7 16:19:10 2009
@@ -5,7 +5,7 @@
define i32 @t1() {
; CHECK: t1:
; CHECK: stmfd sp!, {r7, lr}
-; CHECK: ldmfd sp!, {r7, pc}
+; CHECK: ldmfd.w sp!, {r7, pc}
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1]
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
%tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]
@@ -15,8 +15,8 @@
define i32 @t2() {
; CHECK: t2:
; CHECK: stmfd sp!, {r7, lr}
-; CHECK: ldmia
-; CHECK: ldmfd sp!, {r7, pc}
+; CHECK: ldmia.w
+; CHECK: ldmfd.w sp!, {r7, pc}
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1]
@@ -27,7 +27,7 @@
define i32 @t3() {
; CHECK: t3:
; CHECK: stmfd sp!, {r7, lr}
-; CHECK: ldmfd sp!, {r7, pc}
+; CHECK: ldmfd.w sp!, {r7, pc}
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
More information about the llvm-commits
mailing list