diff options
author | Jim Grosbach <grosbach@apple.com> | 2010-10-27 23:12:14 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2010-10-27 23:12:14 +0000 |
commit | 7e3383c007f53b3a00675af225e428cb66ddf404 (patch) | |
tree | a506d6a7aa8416c28debbaa7905253d71d2dd4d5 /lib/Target/ARM/ARMFastISel.cpp | |
parent | 0bccec368a55e80a2911dcb448cdffabf6bcea98 (diff) |
Refactor ARM STR/STRB instruction patterns into STR{B}i12 and STR{B}rs, like
the LDR instructions have. This makes the literal/register forms of the
instructions explicit and allows us to assign scheduling itineraries
appropriately. rdar://8477752
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMFastISel.cpp')
-rw-r--r-- | lib/Target/ARM/ARMFastISel.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp index 3eac44bc8d..675e7e5d25 100644 --- a/lib/Target/ARM/ARMFastISel.cpp +++ b/lib/Target/ARM/ARMFastISel.cpp @@ -805,17 +805,19 @@ bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg, unsigned Base, int Offset) { unsigned StrOpc; bool isFloat = false; + bool needReg0Op = false; switch (VT.getSimpleVT().SimpleTy) { default: return false; case MVT::i1: case MVT::i8: - StrOpc = isThumb ? ARM::t2STRBi12 : ARM::STRB; + StrOpc = isThumb ? ARM::t2STRBi12 : ARM::STRBi12; break; case MVT::i16: StrOpc = isThumb ? ARM::t2STRHi12 : ARM::STRH; + needReg0Op = true; break; case MVT::i32: - StrOpc = isThumb ? ARM::t2STRi12 : ARM::STR; + StrOpc = isThumb ? ARM::t2STRi12 : ARM::STRi12; break; case MVT::f32: if (!Subtarget->hasVFP2()) return false; @@ -836,9 +838,10 @@ bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg, if (isFloat) Offset /= 4; - // The thumb addressing mode has operands swapped from the arm addressing - // mode, the floating point one only has two operands. - if (isFloat || isThumb) + + // FIXME: The 'needReg0Op' bit goes away once STRH is converted to + // not use the mega-addrmode stuff. + if (!needReg0Op) AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(StrOpc)) .addReg(SrcReg).addReg(Base).addImm(Offset)); |