mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
ARM refactor indexed store instructions.
Refactor STR[B] pre and post indexed instructions to use addressing modes for memory operands, which is necessary for assembly parsing and is more consistent with the rest of the memory instruction definitions. Make some incremental progress on refactoring away the mega-operand addrmode2 along the way, which is nice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136978 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -894,7 +894,10 @@ bool ARMLoadStoreOpt::MergeBaseUpdateLoadStore(MachineBasicBlock &MBB,
|
||||
return false;
|
||||
|
||||
unsigned Offset = 0;
|
||||
if (isAM2)
|
||||
// FIXME: Loads still use a combined reg/imm offset operand. When
|
||||
// AM2 refactoring is complete, this can go away and just always use
|
||||
// the raw Offset value.
|
||||
if (isAM2 && isLd)
|
||||
Offset = ARM_AM::getAM2Opc(AddSub, Bytes, ARM_AM::no_shift);
|
||||
else if (!isAM5)
|
||||
Offset = AddSub == ARM_AM::sub ? -Bytes : Bytes;
|
||||
@ -924,7 +927,10 @@ bool ARMLoadStoreOpt::MergeBaseUpdateLoadStore(MachineBasicBlock &MBB,
|
||||
.addReg(Base).addImm(Offset).addImm(Pred).addReg(PredReg);
|
||||
} else {
|
||||
MachineOperand &MO = MI->getOperand(0);
|
||||
if (isAM2)
|
||||
// FIXME: post-indexed stores use am2offset_imm, which still encodes
|
||||
// the vestigal zero-reg offset register. When that's fixed, this clause
|
||||
// can be removed entirely.
|
||||
if (isAM2 && NewOpc == ARM::STR_POST_IMM)
|
||||
// STR_PRE, STR_POST
|
||||
BuildMI(MBB, MBBI, dl, TII->get(NewOpc), Base)
|
||||
.addReg(MO.getReg(), getKillRegState(MO.isKill()))
|
||||
|
Reference in New Issue
Block a user