diff options
| author | Jim Grosbach <grosbach@apple.com> | 2010-10-27 16:50:31 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2010-10-27 16:50:31 +0000 |
| commit | 8bf1483a3d5435c96eff38cb3a95b655c0ad7661 (patch) | |
| tree | a099f72987d750861d16716a2003f800a1e87713 | |
| parent | e4992c88a405b1a8a29b3bcd84d98c7b849149bf (diff) | |
| download | bcm5719-llvm-8bf1483a3d5435c96eff38cb3a95b655c0ad7661.tar.gz bcm5719-llvm-8bf1483a3d5435c96eff38cb3a95b655c0ad7661.zip | |
The immediate operands of an LDRi12 instruction doesn't need the addrmode2
encoding tricks. Handle the 'imm doesn't fit in the insn' case.
llvm-svn: 117454
| -rw-r--r-- | llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp index 69e10baafbc..223cbe75e0b 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -1435,8 +1435,12 @@ bool llvm::rewriteARMFrameIndex(MachineInstr &MI, unsigned FrameRegIdx, // Otherwise, it didn't fit. Pull in what we can to simplify the immed. ImmedOffset = ImmedOffset & Mask; - if (isSub) - ImmedOffset |= 1 << NumBits; + if (isSub) { + if (AddrMode == ARMII::AddrMode_i12) + ImmedOffset = -ImmedOffset; + else + ImmedOffset |= 1 << NumBits; + } ImmOp.ChangeToImmediate(ImmedOffset); Offset &= ~(Mask*Scale); } |

