summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-11-20 22:01:38 +0000
committerEric Christopher <echristo@apple.com>2010-11-20 22:01:38 +0000
commitd0aec3bf64baacdbbfdb75e0d664ec6ca345e7b6 (patch)
treec3e01908ff01d87b8be9c22ca2fe08fa92a5946e /llvm/lib
parentfacfd06c4fc3a387cf04e00ddc86a10289b55a87 (diff)
downloadbcm5719-llvm-d0aec3bf64baacdbbfdb75e0d664ec6ca345e7b6.tar.gz
bcm5719-llvm-d0aec3bf64baacdbbfdb75e0d664ec6ca345e7b6.zip
STRH only needs the additional operand, not t2STRH. Also invert conditional
to match the one from the load emitter above. llvm-svn: 119911
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMFastISel.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp
index c991c4ed28f..1f93e6cde7b 100644
--- a/llvm/lib/Target/ARM/ARMFastISel.cpp
+++ b/llvm/lib/Target/ARM/ARMFastISel.cpp
@@ -845,7 +845,6 @@ bool ARMFastISel::SelectLoad(const Instruction *I) {
bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg, Address &Addr) {
unsigned StrOpc;
bool isFloat = false;
- bool needReg0Op = false;
switch (VT.getSimpleVT().SimpleTy) {
default: return false;
case MVT::i1: {
@@ -862,7 +861,6 @@ bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg, Address &Addr) {
break;
case MVT::i16:
StrOpc = isThumb ? ARM::t2STRHi12 : ARM::STRH;
- needReg0Op = true;
break;
case MVT::i32:
StrOpc = isThumb ? ARM::t2STRi12 : ARM::STRi12;
@@ -886,18 +884,16 @@ bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg, Address &Addr) {
if (isFloat)
Addr.Offset /= 4;
- // FIXME: The 'needReg0Op' bit goes away once STRH is converted to
- // not use the mega-addrmode stuff.
- if (!needReg0Op)
+ // ARM::STRH needs an additional operand.
+ if (!isThumb && VT.getSimpleVT().SimpleTy == MVT::i16)
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(StrOpc))
- .addReg(SrcReg).addReg(Addr.Base.Reg).addImm(Addr.Offset));
+ .addReg(SrcReg).addReg(Addr.Base.Reg)
+ .addReg(0).addImm(Addr.Offset));
else
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(StrOpc))
- .addReg(SrcReg).addReg(Addr.Base.Reg)
- .addReg(0).addImm(Addr.Offset));
-
+ .addReg(SrcReg).addReg(Addr.Base.Reg).addImm(Addr.Offset));
return true;
}
OpenPOWER on IntegriCloud