Movement and cleanup.
authorEric Christopher <echristo@apple.com>
Thu, 30 Sep 2010 22:34:19 +0000 (22:34 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 30 Sep 2010 22:34:19 +0000 (22:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115225 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMFastISel.cpp

index 26c3c5b833dad441d1703d4d43c06a6ee949b47d..b4fd1b402c49d0f9ed0120a55193c1e21bfe9dd9 100644 (file)
@@ -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();