This patch implements microMIPSr6 MTC0, MTC1, MTC2, MTHC0, MTHC1, MTHC2, DMTC0, DMTC1, DMTC2 instructions.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Fixed typo in instruction encoding in lib/Target/Mips/MicroMips64r6InstrInfo.td for dmtc1 and dmtc2.
I believe the changes to test/MC/Mips/{mips32r5mips32r6,mips64r5,mips64r6}/invalid.s while welcome are unnecessary given that this patch deals with microMIPSR6. Those should be split out as a separate patch.
I've noticed a possible error in the documentation that shows dmtc2 as syntactically taking a selector but having no field for encoding it in the binary instruction. In contrast mtc2 and mthc2 do not syntactically have a selector. I'm awaiting clarification on that issue.
Thanks,
Simon
lib/Target/Mips/MicroMips32r6InstrInfo.td | ||
---|---|---|
556 ↗ | (On Diff #48181) | Space after "NoItinerary," |
test/MC/Disassembler/Mips/micromips32r6/valid.txt | ||
266 ↗ | (On Diff #48181) | Missing instruction on the last line. I presume it's mthc2. Also can you add the cases with no selector, i.e. "mtc0 $5, $9", "mthc0 $5, $9". |
test/MC/Disassembler/Mips/micromips64r6/valid.txt | ||
172 ↗ | (On Diff #48181) | No selector case here too. Also can you add the mt* cases as well here. |
test/MC/Mips/micromips64r6/invalid.s | ||
134 ↗ | (On Diff #48181) | Add mtc0, mthc0 cases here. |
test/MC/Mips/micromips64r6/valid.s | ||
157 ↗ | (On Diff #48181) | Can you add the mt* cases here too? |
In addition to Simon's comments ...
lib/Target/Mips/MicroMips32r6InstrInfo.td | ||
---|---|---|
580–581 ↗ | (On Diff #48181) | As with the MFHC1 patch, we need a 64-bit FPU version of MTHC1. |
Instructions that access coprocessor 2 don't have a selector. The Impl field should be treated as a 5 bit register field for consistency with binutils.
Instructions that access coprocessor 2 don't have a selector. The Impl field should be treated as a 5 bit register field for consistency with binutils.
I'm surprised by this but it's correct. It's worth mentioning that this only applies to microMIPS though. The assembler has traditionally accepted a sel operand for the other ISA's.