The patch implements microMIPS32r6 CFC1, CFC2, CTC1 and CTC2 instructions.
Details
Diff Detail
Event Timeline
Forgot to add CFC1 and CTC1 to instruction mapping tables. CFC2 and CTC2 instructions don't have an existing mips implementation.
Two major changes required.
a) cfc1 is already defined for microMIPS in MicroMipsInstrFPU.def and was not re-encoded for R6, so we don't need to reimplement it here.
b) We don't currently define cfc2 for microMIPS, so that instruction can be moved to MicroMipsInstrInfo.td and adjusted.
Thanks.
lib/Target/Mips/MicroMips32r6InstrInfo.td | ||
---|---|---|
78–81 | ||
lib/Target/Mips/MipsInstrFPU.td | ||
364–367 ↗ | (On Diff #64094) | These instructions need to be marked as ISA_MIPS32, and the StdMMR6Rel can be dropped. |
test/MC/Disassembler/Mips/micromips32r6/valid.txt | ||
65–68 | These should also be duplicated into the other micromips directories in disassembler. | |
test/MC/Mips/micromips32r6/valid.s | ||
50–53 | Likewise these tests should be duplicated into test/MC/Mips/micromips/. |
Removed my implementation of CFC1/CFC2, using existing micromips implementation.
CFC2 and CTC2 implementations are now in microMipsInstrInfo
Added dissasembler tests for microMipsr3
Added valid.s test file for microMipsr3 which somehow didn't exist.
Note: Didn't put ISA_MIPS32 to Mips CFC/CTC implementations because it causes Mips1 to Mips5 tests to fail.
LGTM with the nit & instruction itinerary defined.
lib/Target/Mips/MicroMipsInstrInfo.td | ||
---|---|---|
664–671 ↗ | (On Diff #66458) | The let line should have the same indentation as the defs above. The defs inside the let block should be indented by a further two spaces. Similar to the change you made in MipsInstrFPU.td Also, can you define the instruction itinerary for ctc2/cfc2 and use it here? You can copy the details from II_CTC1/II_CFC2. |
We don't need to implement cfc for microMIPSR6 as it was not re-encoded for R6. cfc2 was also not re-encoded for R6, so it should be added to MicroMipsInstrInfo.td.