[llvm-branch-commits] [llvm-branch] r119615 - /llvm/branches/Apple/whitney/lib/Target/ARM/ARMFastISel.cpp
Daniel Dunbar
daniel at zuster.org
Wed Nov 17 18:35:47 PST 2010
Author: ddunbar
Date: Wed Nov 17 20:35:47 2010
New Revision: 119615
URL: http://llvm.org/viewvc/llvm-project?rev=119615&view=rev
Log:
Merge r118888:
--
Author: Eric Christopher <echristo at apple.com>
Date: Fri Nov 12 09:48:30 2010 +0000
Fix up a few more spots of addrmode2 (or not) changes that were
missed. Update some comments accordingly.
Fixes rdar://8652289
Modified:
llvm/branches/Apple/whitney/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/branches/Apple/whitney/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/ARM/ARMFastISel.cpp?rev=119615&r1=119614&r2=119615&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Target/ARM/ARMFastISel.cpp Wed Nov 17 20:35:47 2010
@@ -460,7 +460,7 @@
TII.get(ARM::t2LDRpci), DestReg)
.addConstantPoolIndex(Idx));
else
- // The extra reg and immediate are for addrmode2.
+ // The extra immediate is for addrmode2.
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(ARM::LDRcp), DestReg)
.addConstantPoolIndex(Idx)
@@ -505,11 +505,11 @@
if (RelocM == Reloc::PIC_)
MIB.addImm(Id);
} else {
- // The extra reg and immediate are for addrmode2.
+ // The extra immediate is for addrmode2.
MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(ARM::LDRcp),
DestReg)
.addConstantPoolIndex(Idx)
- .addReg(0).addImm(0);
+ .addImm(0);
}
AddOptionalDefs(MIB);
return DestReg;
@@ -789,9 +789,15 @@
if (isFloat)
Offset /= 4;
- AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
- TII.get(Opc), ResultReg)
- .addReg(Base).addImm(Offset));
+ // LDRH needs an additional operand.
+ if (!isThumb && VT.getSimpleVT().SimpleTy == MVT::i16)
+ AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
+ TII.get(Opc), ResultReg)
+ .addReg(Base).addReg(0).addImm(Offset));
+ else
+ AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
+ TII.get(Opc), ResultReg)
+ .addReg(Base).addImm(Offset));
return true;
}
More information about the llvm-branch-commits
mailing list