Remove dependency on MRegisterInfo::getRegClass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brian Gaeke 2004-10-29 21:42:27 +00:00
parent 717582290f
commit b13fac70ca
2 changed files with 30 additions and 4 deletions

View File

@ -25,10 +25,23 @@ SparcV8RegisterInfo::SparcV8RegisterInfo()
: SparcV8GenRegisterInfo(V8::ADJCALLSTACKDOWN,
V8::ADJCALLSTACKUP) {}
static const TargetRegisterClass *getClass(unsigned SrcReg) {
if (SparcV8::IntRegsRegisterClass->contains(SrcReg))
return SparcV8::IntRegsRegisterClass;
else if (SparcV8::FPRegsRegisterClass->contains(SrcReg))
return SparcV8::FPRegsRegisterClass;
else if (SparcV8::DFPRegsRegisterClass->contains(SrcReg))
return SparcV8::DFPRegsRegisterClass;
else {
std::cerr << "Error: register of unknown class found: " << SrcReg << "\n";
abort ();
}
}
void SparcV8RegisterInfo::
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned SrcReg, int FrameIdx) const {
const TargetRegisterClass *RC = getRegClass(SrcReg);
const TargetRegisterClass *RC = getClass(SrcReg);
// On the order of operands here: think "[FrameIdx + 0] = SrcReg".
if (RC == SparcV8::IntRegsRegisterClass)
@ -47,7 +60,7 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
void SparcV8RegisterInfo::
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned DestReg, int FrameIdx) const {
const TargetRegisterClass *RC = getRegClass(DestReg);
const TargetRegisterClass *RC = getClass(DestReg);
if (RC == SparcV8::IntRegsRegisterClass)
BuildMI (MBB, I, V8::LD, 2, DestReg).addFrameIndex (FrameIdx).addSImm (0);
else if (RC == SparcV8::FPRegsRegisterClass)

View File

@ -25,10 +25,23 @@ SparcV8RegisterInfo::SparcV8RegisterInfo()
: SparcV8GenRegisterInfo(V8::ADJCALLSTACKDOWN,
V8::ADJCALLSTACKUP) {}
static const TargetRegisterClass *getClass(unsigned SrcReg) {
if (SparcV8::IntRegsRegisterClass->contains(SrcReg))
return SparcV8::IntRegsRegisterClass;
else if (SparcV8::FPRegsRegisterClass->contains(SrcReg))
return SparcV8::FPRegsRegisterClass;
else if (SparcV8::DFPRegsRegisterClass->contains(SrcReg))
return SparcV8::DFPRegsRegisterClass;
else {
std::cerr << "Error: register of unknown class found: " << SrcReg << "\n";
abort ();
}
}
void SparcV8RegisterInfo::
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned SrcReg, int FrameIdx) const {
const TargetRegisterClass *RC = getRegClass(SrcReg);
const TargetRegisterClass *RC = getClass(SrcReg);
// On the order of operands here: think "[FrameIdx + 0] = SrcReg".
if (RC == SparcV8::IntRegsRegisterClass)
@ -47,7 +60,7 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
void SparcV8RegisterInfo::
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned DestReg, int FrameIdx) const {
const TargetRegisterClass *RC = getRegClass(DestReg);
const TargetRegisterClass *RC = getClass(DestReg);
if (RC == SparcV8::IntRegsRegisterClass)
BuildMI (MBB, I, V8::LD, 2, DestReg).addFrameIndex (FrameIdx).addSImm (0);
else if (RC == SparcV8::FPRegsRegisterClass)