summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-09-09 20:49:25 +0000
committerEric Christopher <echristo@apple.com>2010-09-09 20:49:25 +0000
commitaa3ace10c1b90e07114e60700c8c1f8e6b4f3e84 (patch)
tree6161ccae8e10e7d2ca7e0a246c97645da5c3e4e2 /lib
parentef2fdd21418e0cdc5df963a063b0f940964fa208 (diff)
downloadllvm-aa3ace10c1b90e07114e60700c8c1f8e6b4f3e84.tar.gz
llvm-aa3ace10c1b90e07114e60700c8c1f8e6b4f3e84.tar.bz2
llvm-aa3ace10c1b90e07114e60700c8c1f8e6b4f3e84.tar.xz
New "move to fp reg" routine. Use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMFastISel.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp
index 54f3dfba79..3bd0f6a17a 100644
--- a/lib/Target/ARM/ARMFastISel.cpp
+++ b/lib/Target/ARM/ARMFastISel.cpp
@@ -131,6 +131,7 @@ class ARMFastISel : public FastISel {
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 @@ unsigned ARMFastISel::FastEmitInst_extractsubreg(MVT RetVT,
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 @@ unsigned ARMFastISel::ARMMaterializeFP(const ConstantFP *CFP, EVT VT) {
// 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) {