forked from OSchip/llvm-project
Replace copyRegToReg with copyPhysReg for Alpha.
llvm-svn: 108065
This commit is contained in:
parent
e501ff7cc6
commit
7198d32fc6
|
@ -141,36 +141,25 @@ unsigned AlphaInstrInfo::InsertBranch(MachineBasicBlock &MBB,
|
|||
return 2;
|
||||
}
|
||||
|
||||
bool AlphaInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
const TargetRegisterClass *DestRC,
|
||||
const TargetRegisterClass *SrcRC,
|
||||
DebugLoc DL) const {
|
||||
//cerr << "copyRegToReg " << DestReg << " <- " << SrcReg << "\n";
|
||||
if (DestRC != SrcRC) {
|
||||
// Not yet supported!
|
||||
return false;
|
||||
}
|
||||
|
||||
if (DestRC == Alpha::GPRCRegisterClass) {
|
||||
void AlphaInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI, DebugLoc DL,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
bool KillSrc) const {
|
||||
if (Alpha::GPRCRegClass.contains(DestReg, SrcReg)) {
|
||||
BuildMI(MBB, MI, DL, get(Alpha::BISr), DestReg)
|
||||
.addReg(SrcReg)
|
||||
.addReg(SrcReg);
|
||||
} else if (DestRC == Alpha::F4RCRegisterClass) {
|
||||
.addReg(SrcReg, getKillRegState(KillSrc));
|
||||
} else if (Alpha::F4RCRegClass.contains(DestReg, SrcReg)) {
|
||||
BuildMI(MBB, MI, DL, get(Alpha::CPYSS), DestReg)
|
||||
.addReg(SrcReg)
|
||||
.addReg(SrcReg);
|
||||
} else if (DestRC == Alpha::F8RCRegisterClass) {
|
||||
.addReg(SrcReg, getKillRegState(KillSrc));
|
||||
} else if (Alpha::F8RCRegClass.contains(DestReg, SrcReg)) {
|
||||
BuildMI(MBB, MI, DL, get(Alpha::CPYST), DestReg)
|
||||
.addReg(SrcReg)
|
||||
.addReg(SrcReg);
|
||||
.addReg(SrcReg, getKillRegState(KillSrc));
|
||||
} else {
|
||||
// Attempt to copy register that is not GPR or FPR
|
||||
return false;
|
||||
llvm_unreachable("Attempt to copy register that is not GPR or FPR");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -45,12 +45,10 @@ public:
|
|||
MachineBasicBlock *FBB,
|
||||
const SmallVectorImpl<MachineOperand> &Cond,
|
||||
DebugLoc DL) const;
|
||||
virtual bool copyRegToReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
const TargetRegisterClass *DestRC,
|
||||
const TargetRegisterClass *SrcRC,
|
||||
DebugLoc DL) const;
|
||||
virtual void copyPhysReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI, DebugLoc DL,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
bool KillSrc) const;
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
|
|
Loading…
Reference in New Issue