[llvm-commits] [llvm] r114256 - /llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Eric Christopher
echristo at apple.com
Fri Sep 17 18:59:37 PDT 2010
Author: echristo
Date: Fri Sep 17 20:59:37 2010
New Revision: 114256
URL: http://llvm.org/viewvc/llvm-project?rev=114256&view=rev
Log:
Add addrmode5 fp load support. Swap float/thumb operand adding to handle
thumb with floating point.
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=114256&r1=114255&r2=114256&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Fri Sep 17 20:59:37 2010
@@ -555,6 +555,7 @@
assert(VT.isSimple() && "Non-simple types are invalid here!");
unsigned Opc;
+ bool isFloat = false;
switch (VT.getSimpleVT().SimpleTy) {
default:
assert(false && "Trying to emit for an unhandled type!");
@@ -570,13 +571,27 @@
case MVT::i32:
Opc = isThumb ? ARM::tLDR : ARM::LDR;
break;
+ case MVT::f32:
+ Opc = ARM::VLDRS;
+ isFloat = true;
+ break;
+ case MVT::f64:
+ Opc = ARM::VLDRD;
+ isFloat = true;
+ break;
}
ResultReg = createResultReg(TLI.getRegClassFor(VT));
// TODO: Fix the Addressing modes so that these can share some code.
// Since this is a Thumb1 load this will work in Thumb1 or 2 mode.
- if (isThumb)
+ // The thumb addressing mode has operands swapped from the arm addressing
+ // mode, the floating point one only has two operands.
+ if (isFloat)
+ AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
+ TII.get(Opc), ResultReg)
+ .addReg(Reg).addImm(Offset));
+ else if (isThumb)
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(Opc), ResultReg)
.addReg(Reg).addImm(Offset).addReg(0));
@@ -657,14 +672,15 @@
// The thumb addressing mode has operands swapped from the arm addressing
// mode, the floating point one only has two operands.
- if (isThumb)
+ if (isFloat)
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(StrOpc), SrcReg)
- .addReg(DstReg).addImm(Offset).addReg(0));
- else if (isFloat)
+ .addReg(DstReg).addImm(Offset));
+ else if (isThumb)
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(StrOpc), SrcReg)
- .addReg(DstReg).addImm(Offset));
+ .addReg(DstReg).addImm(Offset).addReg(0));
+
else
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(StrOpc), SrcReg)
More information about the llvm-commits
mailing list