mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Add few pseudo-source-values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -35,15 +35,23 @@ void MSP430InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
|||||||
const TargetRegisterClass *RC) const {
|
const TargetRegisterClass *RC) const {
|
||||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||||
|
MachineFunction &MF = *MBB.getParent();
|
||||||
|
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||||
|
|
||||||
|
MachineMemOperand *MMO =
|
||||||
|
MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FrameIdx),
|
||||||
|
MachineMemOperand::MOStore, 0,
|
||||||
|
MFI.getObjectSize(FrameIdx),
|
||||||
|
MFI.getObjectAlignment(FrameIdx));
|
||||||
|
|
||||||
if (RC == &MSP430::GR16RegClass)
|
if (RC == &MSP430::GR16RegClass)
|
||||||
BuildMI(MBB, MI, DL, get(MSP430::MOV16mr))
|
BuildMI(MBB, MI, DL, get(MSP430::MOV16mr))
|
||||||
.addFrameIndex(FrameIdx).addImm(0)
|
.addFrameIndex(FrameIdx).addImm(0)
|
||||||
.addReg(SrcReg, getKillRegState(isKill));
|
.addReg(SrcReg, getKillRegState(isKill)).addMemOperand(MMO);
|
||||||
else if (RC == &MSP430::GR8RegClass)
|
else if (RC == &MSP430::GR8RegClass)
|
||||||
BuildMI(MBB, MI, DL, get(MSP430::MOV8mr))
|
BuildMI(MBB, MI, DL, get(MSP430::MOV8mr))
|
||||||
.addFrameIndex(FrameIdx).addImm(0)
|
.addFrameIndex(FrameIdx).addImm(0)
|
||||||
.addReg(SrcReg, getKillRegState(isKill));
|
.addReg(SrcReg, getKillRegState(isKill)).addMemOperand(MMO);
|
||||||
else
|
else
|
||||||
llvm_unreachable("Cannot store this register to stack slot!");
|
llvm_unreachable("Cannot store this register to stack slot!");
|
||||||
}
|
}
|
||||||
@@ -54,13 +62,21 @@ void MSP430InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
|||||||
const TargetRegisterClass *RC) const{
|
const TargetRegisterClass *RC) const{
|
||||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||||
|
MachineFunction &MF = *MBB.getParent();
|
||||||
|
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||||
|
|
||||||
|
MachineMemOperand *MMO =
|
||||||
|
MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FrameIdx),
|
||||||
|
MachineMemOperand::MOLoad, 0,
|
||||||
|
MFI.getObjectSize(FrameIdx),
|
||||||
|
MFI.getObjectAlignment(FrameIdx));
|
||||||
|
|
||||||
if (RC == &MSP430::GR16RegClass)
|
if (RC == &MSP430::GR16RegClass)
|
||||||
BuildMI(MBB, MI, DL, get(MSP430::MOV16rm))
|
BuildMI(MBB, MI, DL, get(MSP430::MOV16rm))
|
||||||
.addReg(DestReg).addFrameIndex(FrameIdx).addImm(0);
|
.addReg(DestReg).addFrameIndex(FrameIdx).addImm(0).addMemOperand(MMO);
|
||||||
else if (RC == &MSP430::GR8RegClass)
|
else if (RC == &MSP430::GR8RegClass)
|
||||||
BuildMI(MBB, MI, DL, get(MSP430::MOV8rm))
|
BuildMI(MBB, MI, DL, get(MSP430::MOV8rm))
|
||||||
.addReg(DestReg).addFrameIndex(FrameIdx).addImm(0);
|
.addReg(DestReg).addFrameIndex(FrameIdx).addImm(0).addMemOperand(MMO);
|
||||||
else
|
else
|
||||||
llvm_unreachable("Cannot store this register to stack slot!");
|
llvm_unreachable("Cannot store this register to stack slot!");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user