mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
implement isStoreToStackSlot for PPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25914 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4083960147
commit
6524287c53
lib/Target/PowerPC
@ -95,8 +95,25 @@ unsigned PPCInstrInfo::isLoadFromStackSlot(MachineInstr *MI,
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned PPCInstrInfo::isStoreToStackSlot(MachineInstr *MI,
|
||||
int &FrameIndex) const {
|
||||
switch (MI->getOpcode()) {
|
||||
default: break;
|
||||
//case PPC::ST: ?
|
||||
case PPC::STW:
|
||||
case PPC::STFS:
|
||||
case PPC::STFD:
|
||||
if (MI->getOperand(1).isImmediate() && !MI->getOperand(1).getImmedValue() &&
|
||||
MI->getOperand(2).isFrameIndex()) {
|
||||
FrameIndex = MI->getOperand(2).getFrameIndex();
|
||||
return MI->getOperand(0).getReg();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// commuteInstruction - We can commute rlwimi instructions, but only if the
|
||||
// rotate amt is zero. We also have to munge the immediates a bit.
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
unsigned& destReg) const;
|
||||
|
||||
unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
|
||||
unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
|
||||
|
||||
// commuteInstruction - We can commute rlwimi instructions, but only if the
|
||||
// rotate amt is zero. We also have to munge the immediates a bit.
|
||||
|
Loading…
x
Reference in New Issue
Block a user