File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -709,13 +709,27 @@ void M68kInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
709709 bool ToSR = DstReg == M68k::SR;
710710
711711 if (FromCCR) {
712- assert (M68k::DR8RegClass.contains (DstReg) &&
713- " Need DR8 register to copy CCR" );
714- Opc = M68k::MOV8dc;
712+ if (M68k::DR8RegClass.contains (DstReg))
713+ Opc = M68k::MOV8dc;
714+ else if (M68k::DR16RegClass.contains (DstReg))
715+ Opc = M68k::MOV16dc;
716+ else if (M68k::DR32RegClass.contains (DstReg))
717+ Opc = M68k::MOV16dc;
718+ else {
719+ LLVM_DEBUG (dbgs () << " Cannot copy CCR to " << RI.getName (DstReg) << ' \n ' );
720+ llvm_unreachable (" Invalid register for MOVE from CCR" );
721+ }
715722 } else if (ToCCR) {
716- assert (M68k::DR8RegClass.contains (SrcReg) &&
717- " Need DR8 register to copy CCR" );
718- Opc = M68k::MOV8cd;
723+ if (M68k::DR8RegClass.contains (SrcReg))
724+ Opc = M68k::MOV8cd;
725+ else if (M68k::DR16RegClass.contains (SrcReg))
726+ Opc = M68k::MOV16cd;
727+ else if (M68k::DR32RegClass.contains (SrcReg))
728+ Opc = M68k::MOV16cd;
729+ else {
730+ LLVM_DEBUG (dbgs () << " Cannot copy " << RI.getName (SrcReg) << " to CCR\n " );
731+ llvm_unreachable (" Invalid register for MOVE to CCR" );
732+ }
719733 } else if (FromSR || ToSR)
720734 llvm_unreachable (" Cannot emit SR copy instruction" );
721735
You can’t perform that action at this time.
0 commit comments