summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2014-09-09 09:57:59 +0000
committerRenato Golin <renato.golin@linaro.org>2014-09-09 09:57:59 +0000
commit63e27980da2ef1c0c4c0eaecb3baef494b7fbce4 (patch)
treec2b4ecb0cc043e45584abab0e7936f91884e4562 /llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
parent37aeb2d7c2060c073768e504cdbcd992b2cd136b (diff)
downloadbcm5719-llvm-63e27980da2ef1c0c4c0eaecb3baef494b7fbce4.tar.gz
bcm5719-llvm-63e27980da2ef1c0c4c0eaecb3baef494b7fbce4.zip
ARM: Negative offset support problem
This patch is to permit a negative offset usage for a non frame access. Patch by Igor Oblakov. llvm-svn: 217431
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
index e547600624a..996bb1f0014 100644
--- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -542,11 +542,11 @@ bool ARMDAGToDAGISel::SelectAddrModeImm12(SDValue N,
}
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- int RHSC = (int)RHS->getZExtValue();
+ int RHSC = (int)RHS->getSExtValue();
if (N.getOpcode() == ISD::SUB)
RHSC = -RHSC;
- if (RHSC >= 0 && RHSC < 0x1000) { // 12 bits (unsigned)
+ if (RHSC > -0x1000 && RHSC < 0x1000) { // 12 bits
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
OpenPOWER on IntegriCloud