diff options
| author | David Goodwin <david_goodwin@apple.com> | 2009-07-14 18:48:51 +0000 |
|---|---|---|
| committer | David Goodwin <david_goodwin@apple.com> | 2009-07-14 18:48:51 +0000 |
| commit | 4ad7797e1c21735d2313a66f3ea9a81a8040cb3c (patch) | |
| tree | ef82853b7e46937bd9704f2f3c76dc73ddc05741 /llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | |
| parent | 844834d6f54805ee36f4a231aacdb082f4aac99d (diff) | |
| download | bcm5719-llvm-4ad7797e1c21735d2313a66f3ea9a81a8040cb3c.tar.gz bcm5719-llvm-4ad7797e1c21735d2313a66f3ea9a81a8040cb3c.zip | |
hasThumb2() does not mean we are compiling for thumb, must also check isThumb().
llvm-svn: 75660
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp index 75e956b55f4..fe4b4ed8a56 100644 --- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -902,7 +902,8 @@ SDNode *ARMDAGToDAGISel::Select(SDValue Op) { 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 @@ SDNode *ARMDAGToDAGISel::Select(SDValue Op) { 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 @@ SDNode *ARMDAGToDAGISel::Select(SDValue Op) { 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); } } |

