[llvm-commits] [llvm] r75660 - /llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
David Goodwin
david_goodwin at apple.com
Tue Jul 14 11:48:52 PDT 2009
Author: david_goodwin
Date: Tue Jul 14 13:48:51 2009
New Revision: 75660
URL: http://llvm.org/viewvc/llvm-project?rev=75660&view=rev
Log:
hasThumb2() does not mean we are compiling for thumb, must also check isThumb().
Modified:
llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=75660&r1=75659&r2=75660&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jul 14 13:48:51 2009
@@ -902,7 +902,8 @@
return CurDAG->SelectNodeTo(N, ARM::tADDrSPi, MVT::i32, TFI,
CurDAG->getTargetConstant(0, MVT::i32));
} else {
- unsigned Opc = Subtarget->hasThumb2() ? ARM::t2ADDri : ARM::ADDri;
+ unsigned Opc = ((Subtarget->isThumb() && Subtarget->hasThumb2()) ?
+ ARM::t2ADDri : ARM::ADDri);
SDValue Ops[] = { TFI, CurDAG->getTargetConstant(0, MVT::i32),
getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
@@ -941,7 +942,8 @@
CurDAG->getTargetConstant(ShImm, MVT::i32),
getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
- return CurDAG->SelectNodeTo(N, (Subtarget->hasThumb2()) ?
+ return CurDAG->SelectNodeTo(N, (Subtarget->isThumb() &&
+ Subtarget->hasThumb2()) ?
ARM::t2ADDrs : ARM::ADDrs, MVT::i32, Ops, 7);
}
if (isPowerOf2_32(RHSV+1)) { // 2^n-1?
@@ -951,7 +953,8 @@
CurDAG->getTargetConstant(ShImm, MVT::i32),
getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
- return CurDAG->SelectNodeTo(N, (Subtarget->hasThumb2()) ?
+ return CurDAG->SelectNodeTo(N, (Subtarget->isThumb() &&
+ Subtarget->hasThumb2()) ?
ARM::t2RSBrs : ARM::RSBrs, MVT::i32, Ops, 7);
}
}
More information about the llvm-commits
mailing list