Use the right instructions to copy between GPR and the more strictive tGPR classes. t2MOV does not match the RC requirements.

llvm-svn: 77175
This commit is contained in:
Evan Cheng 2009-07-27 00:33:08 +00:00
parent 0e5b149930
commit 186332f898
2 changed files with 12 additions and 5 deletions

View File

@ -612,7 +612,7 @@ ARMBaseInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
} }
if (DestRC == ARM::GPRRegisterClass) if (DestRC == ARM::GPRRegisterClass)
AddDefaultCC(AddDefaultPred(BuildMI(MBB, I, DL, get(getOpcode(ARMII::MOVr)), AddDefaultCC(AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::MOVr),
DestReg).addReg(SrcReg))); DestReg).addReg(SrcReg)));
else if (DestRC == ARM::SPRRegisterClass) else if (DestRC == ARM::SPRRegisterClass)
AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::FCPYS), DestReg) AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::FCPYS), DestReg)

View File

@ -84,14 +84,21 @@ Thumb2InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
DebugLoc DL = DebugLoc::getUnknownLoc(); DebugLoc DL = DebugLoc::getUnknownLoc();
if (I != MBB.end()) DL = I->getDebugLoc(); if (I != MBB.end()) DL = I->getDebugLoc();
if ((DestRC == ARM::GPRRegisterClass && if (DestRC == ARM::GPRRegisterClass &&
SrcRC == ARM::tGPRRegisterClass) || SrcRC == ARM::GPRRegisterClass) {
(DestRC == ARM::tGPRRegisterClass &&
SrcRC == ARM::GPRRegisterClass)) {
AddDefaultCC(AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::t2MOVr), AddDefaultCC(AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::t2MOVr),
DestReg).addReg(SrcReg))); DestReg).addReg(SrcReg)));
return true; return true;
} else if (DestRC == ARM::GPRRegisterClass &&
SrcRC == ARM::tGPRRegisterClass) {
BuildMI(MBB, I, DL, get(ARM::tMOVtgpr2gpr), DestReg).addReg(SrcReg);
return true;
} else if (DestRC == ARM::tGPRRegisterClass &&
SrcRC == ARM::GPRRegisterClass) {
BuildMI(MBB, I, DL, get(ARM::tMOVgpr2tgpr), DestReg).addReg(SrcReg);
return true;
} }
// Handle SPR, DPR, and QPR copies.
return ARMBaseInstrInfo::copyRegToReg(MBB, I, DestReg, SrcReg, DestRC, SrcRC); return ARMBaseInstrInfo::copyRegToReg(MBB, I, DestReg, SrcReg, DestRC, SrcRC);
} }