[llvm-commits] [llvm] r115225 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Eric Christopher
echristo at apple.com
Thu Sep 30 15:34:19 PDT 2010
Author: echristo
Date: Thu Sep 30 17:34:19 2010
New Revision: 115225
URL: http://llvm.org/viewvc/llvm-project?rev=115225&view=rev
Log:
Movement and cleanup.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=115225&r1=115224&r2=115225&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Thu Sep 30 17:34:19 2010
@@ -1003,6 +1003,32 @@
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 @@
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();
More information about the llvm-commits
mailing list