[llvm-commits] [llvm] r113537 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp

Eric Christopher echristo at apple.com
Thu Sep 9 13:49:25 PDT 2010


Author: echristo
Date: Thu Sep  9 15:49:25 2010
New Revision: 113537

URL: http://llvm.org/viewvc/llvm-project?rev=113537&view=rev
Log:
New "move to fp reg" routine.  Use it.

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=113537&r1=113536&r2=113537&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Thu Sep  9 15:49:25 2010
@@ -131,6 +131,7 @@
     bool ARMComputeRegOffset(const Value *Obj, unsigned &Reg, int &Offset);
     unsigned ARMMaterializeFP(const ConstantFP *CFP, EVT VT);
     unsigned ARMMaterializeInt(const Constant *C);
+    unsigned ARMMoveToFPReg(EVT VT, unsigned SrcReg);
 
     bool DefinesOptionalPredicate(MachineInstr *MI, bool *CPSR);
     const MachineInstrBuilder &AddOptionalDefs(const MachineInstrBuilder &MIB);
@@ -330,6 +331,16 @@
   return ResultReg;
 }
 
+unsigned ARMFastISel::ARMMoveToFPReg(EVT VT, unsigned SrcReg) {
+  // If we have a floating point constant we expect it in a floating point
+  // register.
+  unsigned MoveReg = createResultReg(TLI.getRegClassFor(VT));
+  AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
+                          TII.get(ARM::VMOVRS), MoveReg)
+                  .addReg(SrcReg));
+  return MoveReg;
+}
+
 // For double width floating point we need to materialize two constants
 // (the high and the low) into integer registers then use a move to get
 // the combined constant into an FP reg.
@@ -356,11 +367,7 @@
 
   // If we have a floating point constant we expect it in a floating point
   // register.
-  unsigned MoveReg = createResultReg(TLI.getRegClassFor(VT));
-  AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
-                          TII.get(ARM::VMOVRS), MoveReg)
-                  .addReg(DestReg));
-  return MoveReg;
+  return ARMMoveToFPReg(VT, DestReg);
 }
 
 unsigned ARMFastISel::ARMMaterializeInt(const Constant *C) {





More information about the llvm-commits mailing list