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 @@ -757,13 +757,27 @@ void M68kInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
757757 bool ToSR = DstReg == M68k::SR;
758758
759759 if (FromCCR) {
760- assert (M68k::DR8RegClass.contains (DstReg) &&
761- " Need DR8 register to copy CCR" );
762- Opc = M68k::MOV8dc;
760+ if (M68k::DR8RegClass.contains (DstReg))
761+ Opc = M68k::MOV8dc;
762+ else if (M68k::DR16RegClass.contains (DstReg))
763+ Opc = M68k::MOV16dc;
764+ else if (M68k::DR32RegClass.contains (DstReg))
765+ Opc = M68k::MOV16dc;
766+ else {
767+ LLVM_DEBUG (dbgs () << " Cannot copy CCR to " << RI.getName (DstReg) << ' \n ' );
768+ llvm_unreachable (" Invalid register for MOVE from CCR" );
769+ }
763770 } else if (ToCCR) {
764- assert (M68k::DR8RegClass.contains (SrcReg) &&
765- " Need DR8 register to copy CCR" );
766- Opc = M68k::MOV8cd;
771+ if (M68k::DR8RegClass.contains (SrcReg))
772+ Opc = M68k::MOV8cd;
773+ else if (M68k::DR16RegClass.contains (SrcReg))
774+ Opc = M68k::MOV16cd;
775+ else if (M68k::DR32RegClass.contains (SrcReg))
776+ Opc = M68k::MOV16cd;
777+ else {
778+ LLVM_DEBUG (dbgs () << " Cannot copy " << RI.getName (SrcReg) << " to CCR\n " );
779+ llvm_unreachable (" Invalid register for MOVE to CCR" );
780+ }
767781 } else if (FromSR || ToSR)
768782 llvm_unreachable (" Cannot emit SR copy instruction" );
769783
You can’t perform that action at this time.
0 commit comments