mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Make sure stack link is set in 64-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
863ab9fbd6
commit
dfc55885e2
@ -396,9 +396,15 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||
|
||||
// Replace the pseudo instruction with a new instruction...
|
||||
if (Old->getOpcode() == PPC::ADJCALLSTACKDOWN) {
|
||||
BuildMI(MBB, I, PPC::LWZ, 2, PPC::R0).addImm(0).addReg(PPC::R31);
|
||||
BuildMI(MBB, I, PPC::STWU, 3)
|
||||
.addReg(PPC::R0).addImm(-Amount).addReg(PPC::R1);
|
||||
if (!Subtarget.isPPC64()) {
|
||||
BuildMI(MBB, I, PPC::LWZ, 2, PPC::R0).addImm(0).addReg(PPC::R31);
|
||||
BuildMI(MBB, I, PPC::STWU, 3)
|
||||
.addReg(PPC::R0).addImm(-Amount).addReg(PPC::R1);
|
||||
} else {
|
||||
BuildMI(MBB, I, PPC::LD, 2, PPC::X0).addImm(0).addReg(PPC::X31);
|
||||
BuildMI(MBB, I, PPC::STDU, 3)
|
||||
.addReg(PPC::X0).addImm(-Amount/4).addReg(PPC::X1);
|
||||
}
|
||||
} else {
|
||||
assert(Old->getOpcode() == PPC::ADJCALLSTACKUP);
|
||||
BuildMI(MBB, I, PPC::ADDI, 2, PPC::R1).addReg(PPC::R1).addImm(Amount);
|
||||
|
Loading…
Reference in New Issue
Block a user