[llvm-commits] [llvm] r117454 - /llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
Jim Grosbach
grosbach at apple.com
Wed Oct 27 09:50:31 PDT 2010
Author: grosbach
Date: Wed Oct 27 11:50:31 2010
New Revision: 117454
URL: http://llvm.org/viewvc/llvm-project?rev=117454&view=rev
Log:
The immediate operands of an LDRi12 instruction doesn't need the addrmode2
encoding tricks. Handle the 'imm doesn't fit in the insn' case.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=117454&r1=117453&r2=117454&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Wed Oct 27 11:50:31 2010
@@ -1435,8 +1435,12 @@
// 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);
}
More information about the llvm-commits
mailing list