Page MenuHomePhabricator

[mips] Fix encoding of the `mov.d` command for microMIPS R6
ClosedPublic

Authored by atanasyan on Mar 6 2019, 1:33 PM.

Details

Summary

Before this change LLVM emits non-microMIPS variant of the mov.d command for microMIPS code.

Diff Detail

Event Timeline

atanasyan created this revision.Mar 6 2019, 1:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2019, 1:33 PM

FMOV_D64_MM cannot be selected. Maybe you can do the following change instead in file
/lib/Target/Mips/MipsSEInstrInfo.cpp
line 147:

else if (Mips::FGR64RegClass.contains(DestReg, SrcReg))
  Opc = isMicroMips ? Mips::FMOV_D64_MM : Mips::FMOV_D64;
atanasyan updated this revision to Diff 190077.Mar 11 2019, 6:29 AM
  • Select microMIPS R6 variant of the mov.d instruction in the MipsSEInstrInfo::copyPhysReg method.

BTW this variant requires less changes in the source code but I'm concerned a bit that almost all other instructions handled in the MipsSEInstrInfo::copyPhysReg are mapped to their microMIPS counterparts by mappings in the td files.

microMIPS r6 handles float move with FMOV_S_MMR6 instruction mappings in .td file, with that in mind we should do the same with the double move instruction.
Despite the fact that change in /lib/Target/Mips/MipsSEInstrInfo.cpp results in the same output for this test, it should be addressed in another patch. Goal of that patch would be to properly select microMIPS move instruction based on register class used in copy instruction.

Petar.Avramovic accepted this revision.Mar 12 2019, 8:50 AM

LGTM for the initial version of the patch.

This revision is now accepted and ready to land.Mar 12 2019, 8:50 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the thorough review.