diff options
| author | Eric Christopher <echristo@apple.com> | 2010-09-30 22:34:19 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2010-09-30 22:34:19 +0000 |
| commit | 56094ff4020402154b49b973e67ce3b23168af7b (patch) | |
| tree | 95be9e1d2702c1fc4833c0ff6f0b708ccebc2d6f /llvm/lib/Target/ARM | |
| parent | 0d3d0b7489a182ef1892b9df8468be4621b83c60 (diff) | |
| download | bcm5719-llvm-56094ff4020402154b49b973e67ce3b23168af7b.tar.gz bcm5719-llvm-56094ff4020402154b49b973e67ce3b23168af7b.zip | |
Movement and cleanup.
llvm-svn: 115225
Diffstat (limited to 'llvm/lib/Target/ARM')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMFastISel.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index 26c3c5b833d..b4fd1b402c4 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -1003,6 +1003,32 @@ bool ARMFastISel::SelectFPToSI(const Instruction *I) { return true; } +bool ARMFastISel::SelectSDiv(const Instruction *I) { + EVT VT; + const Type *Ty = I->getType(); + if (!isTypeLegal(Ty, VT)) + return false; + + // If we have integer div support we should have selected this automagically. + // In case we have a real miss go ahead and return false and we'll pick + // it up later. + if (Subtarget->hasDivide()) return false; + + // Otherwise emit a libcall. + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (VT == MVT::i16) + LC = RTLIB::SDIV_I16; + else if (VT == MVT::i32) + LC = RTLIB::SDIV_I32; + else if (VT == MVT::i64) + LC = RTLIB::SDIV_I64; + else if (VT == MVT::i128) + LC = RTLIB::SDIV_I128; + assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SDIV!"); + + return ARMEmitLibcall(I, LC); +} + bool ARMFastISel::SelectBinaryOp(const Instruction *I, unsigned ISDOpcode) { EVT VT = TLI.getValueType(I->getType(), true); @@ -1232,32 +1258,6 @@ bool ARMFastISel::ARMEmitLibcall(const Instruction *I, RTLIB::Libcall Call) { return true; } -bool ARMFastISel::SelectSDiv(const Instruction *I) { - EVT VT; - const Type *Ty = I->getType(); - if (!isTypeLegal(Ty, VT)) - return false; - - // If we have integer div support we should have selected this automagically. - // In case we have a real miss go ahead and return false and we'll pick - // it up later. - if (Subtarget->hasDivide()) return false; - - // Otherwise emit a libcall. - RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; - if (VT == MVT::i16) - LC = RTLIB::SDIV_I16; - else if (VT == MVT::i32) - LC = RTLIB::SDIV_I32; - else if (VT == MVT::i64) - LC = RTLIB::SDIV_I64; - else if (VT == MVT::i128) - LC = RTLIB::SDIV_I128; - assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SDIV!"); - - return ARMEmitLibcall(I, LC); -} - bool ARMFastISel::SelectCall(const Instruction *I) { const CallInst *CI = cast<CallInst>(I); const Value *Callee = CI->getCalledValue(); |

