mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Provide hooks for spilling / restoring stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75969 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4cc7ce0c01
commit
4b730160bb
@ -12,6 +12,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "SystemZ.h"
|
||||
#include "SystemZInstrBuilder.h"
|
||||
#include "SystemZInstrInfo.h"
|
||||
#include "SystemZMachineFunctionInfo.h"
|
||||
#include "SystemZTargetMachine.h"
|
||||
@ -55,14 +56,41 @@ void SystemZInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
assert(0 && "Cannot store this register to stack slot!");
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||
|
||||
unsigned Opc = 0;
|
||||
if (RC == &SystemZ::GR32RegClass ||
|
||||
RC == &SystemZ::ADDR32RegClass)
|
||||
Opc = SystemZ::MOV32mr;
|
||||
else if (RC == &SystemZ::GR64RegClass ||
|
||||
RC == &SystemZ::ADDR64RegClass) {
|
||||
Opc = SystemZ::MOV64mr;
|
||||
} else
|
||||
assert(0 && "Unsupported regclass to store");
|
||||
|
||||
addFrameReference(BuildMI(MBB, MI, DL, get(Opc)), FrameIdx)
|
||||
.addReg(SrcReg, getKillRegState(isKill));
|
||||
}
|
||||
|
||||
void SystemZInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const{
|
||||
assert(0 && "Cannot store this register to stack slot!");
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||
|
||||
unsigned Opc = 0;
|
||||
if (RC == &SystemZ::GR32RegClass ||
|
||||
RC == &SystemZ::ADDR32RegClass)
|
||||
Opc = SystemZ::MOV32rm;
|
||||
else if (RC == &SystemZ::GR64RegClass ||
|
||||
RC == &SystemZ::ADDR64RegClass) {
|
||||
Opc = SystemZ::MOV64rm;
|
||||
} else
|
||||
assert(0 && "Unsupported regclass to store");
|
||||
|
||||
addFrameReference(BuildMI(MBB, MI, DL, get(Opc), DestReg), FrameIdx);
|
||||
}
|
||||
|
||||
bool SystemZInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
|
Loading…
Reference in New Issue
Block a user