| OLD | NEW |
| 1 //===-- ARMFastISel.cpp - ARM FastISel implementation ---------------------===// | 1 //===-- ARMFastISel.cpp - ARM FastISel implementation ---------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file defines the ARM-specific support for the FastISel class. Some | 10 // This file defines the ARM-specific support for the FastISel class. Some |
| (...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1665 UseImm = isThumb2 ? (ARM_AM::getT2SOImmVal(Imm) != -1) : | 1665 UseImm = isThumb2 ? (ARM_AM::getT2SOImmVal(Imm) != -1) : |
| 1666 (ARM_AM::getSOImmVal(Imm) != -1); | 1666 (ARM_AM::getSOImmVal(Imm) != -1); |
| 1667 } | 1667 } |
| 1668 | 1668 |
| 1669 unsigned Op2Reg = 0; | 1669 unsigned Op2Reg = 0; |
| 1670 if (!UseImm) { | 1670 if (!UseImm) { |
| 1671 Op2Reg = getRegForValue(I->getOperand(2)); | 1671 Op2Reg = getRegForValue(I->getOperand(2)); |
| 1672 if (Op2Reg == 0) return false; | 1672 if (Op2Reg == 0) return false; |
| 1673 } | 1673 } |
| 1674 | 1674 |
| 1675 unsigned CmpOpc = isThumb2 ? ARM::t2CMPri : ARM::CMPri; | 1675 unsigned TstOpc = isThumb2 ? ARM::t2TSTri : ARM::TSTri; |
| 1676 CondReg = constrainOperandRegClass(TII.get(CmpOpc), CondReg, 0); | 1676 CondReg = constrainOperandRegClass(TII.get(TstOpc), CondReg, 0); |
| 1677 AddOptionalDefs( | 1677 AddOptionalDefs( |
| 1678 BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(CmpOpc)) | 1678 BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TstOpc)) |
| 1679 .addReg(CondReg) | 1679 .addReg(CondReg) |
| 1680 .addImm(0)); | 1680 .addImm(1)); |
| 1681 | 1681 |
| 1682 unsigned MovCCOpc; | 1682 unsigned MovCCOpc; |
| 1683 const TargetRegisterClass *RC; | 1683 const TargetRegisterClass *RC; |
| 1684 if (!UseImm) { | 1684 if (!UseImm) { |
| 1685 RC = isThumb2 ? &ARM::tGPRRegClass : &ARM::GPRRegClass; | 1685 RC = isThumb2 ? &ARM::tGPRRegClass : &ARM::GPRRegClass; |
| 1686 MovCCOpc = isThumb2 ? ARM::t2MOVCCr : ARM::MOVCCr; | 1686 MovCCOpc = isThumb2 ? ARM::t2MOVCCr : ARM::MOVCCr; |
| 1687 } else { | 1687 } else { |
| 1688 RC = isThumb2 ? &ARM::rGPRRegClass : &ARM::GPRRegClass; | 1688 RC = isThumb2 ? &ARM::rGPRRegClass : &ARM::GPRRegClass; |
| 1689 if (!isNegativeImm) | 1689 if (!isNegativeImm) |
| 1690 MovCCOpc = isThumb2 ? ARM::t2MOVCCi : ARM::MOVCCi; | 1690 MovCCOpc = isThumb2 ? ARM::t2MOVCCi : ARM::MOVCCi; |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3089 // iOS always has a FP for backtracking, force other targets | 3089 // iOS always has a FP for backtracking, force other targets |
| 3090 // to keep their FP when doing FastISel. The emitted code is | 3090 // to keep their FP when doing FastISel. The emitted code is |
| 3091 // currently superior, and in cases like test-suite's lencod | 3091 // currently superior, and in cases like test-suite's lencod |
| 3092 // FastISel isn't quite correct when FP is eliminated. | 3092 // FastISel isn't quite correct when FP is eliminated. |
| 3093 TM.Options.NoFramePointerElim = true; | 3093 TM.Options.NoFramePointerElim = true; |
| 3094 return new ARMFastISel(funcInfo, libInfo); | 3094 return new ARMFastISel(funcInfo, libInfo); |
| 3095 } | 3095 } |
| 3096 return nullptr; | 3096 return nullptr; |
| 3097 } | 3097 } |
| 3098 } | 3098 } |
| OLD | NEW |