diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-08-07 21:19:10 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-08-07 21:19:10 +0000 |
commit | 9b53104dfd8c2bb2d9eca8b000a998f100196d5a (patch) | |
tree | eee8001991e28c001e7597804b9fc9890855fd3f | |
parent | 79f302e7a2d4dad8bda72ce6cd0d2c1425bdc287 (diff) | |
download | external_llvm-9b53104dfd8c2bb2d9eca8b000a998f100196d5a.zip external_llvm-9b53104dfd8c2bb2d9eca8b000a998f100196d5a.tar.gz external_llvm-9b53104dfd8c2bb2d9eca8b000a998f100196d5a.tar.bz2 |
Thumb2 32-bit ldm / stm needs .w suffix if submode is ia.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78410 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMInstrThumb2.td | 6 | ||||
-rw-r--r-- | lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 4 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-ldm.ll | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td index 11b0454..d4ee7c0 100644 --- a/lib/Target/ARM/ARMInstrThumb2.td +++ b/lib/Target/ARM/ARMInstrThumb2.td @@ -651,12 +651,12 @@ def t2STRB_POST : T2Iidxldst<(outs GPR:$base_wb), 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 isCall = 1, 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 { diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 7b19969..3bbb3b9 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -599,6 +599,10 @@ void ARMAsmPrinter::printAddrMode4Operand(const MachineInstr *MI, int Op, 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())) diff --git a/test/CodeGen/Thumb2/thumb2-ldm.ll b/test/CodeGen/Thumb2/thumb2-ldm.ll index c3e3bf6..932ec75 100644 --- a/test/CodeGen/Thumb2/thumb2-ldm.ll +++ b/test/CodeGen/Thumb2/thumb2-ldm.ll @@ -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 @t1() { 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 @t2() { 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] |