The patch implements microMIPSr6 BC16, BEQZC16 and BNEZC16 instructions.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/Mips/AsmParser/MipsAsmParser.cpp | ||
---|---|---|
1705–1708 ↗ | (On Diff #29653) | Nit: These two cases are identical. Put both case-statements in front of one copy of the code. |
2131–2134 ↗ | (On Diff #29653) | '|| hasMips64r6()' is redundant since the predicates are cumulative. Also use the ternary operator: if (inMicroMipsMode()) Inst.setOpcode(hasMips32r6() ? Mips::BC16_MMR6 : Mips::BC16_MM) |
2150 ↗ | (On Diff #29653) | This does the right thing but we shouldn't list all the compact branches explicitly. Test whether the instruction has a delay slot instead. |
lib/Target/Mips/MicroMips32r6InstrInfo.td | ||
151 ↗ | (On Diff #29653) | Don't use Predicates directly, it causes lots of trouble that is hard to debug. People try to add a predicate and end up accidentally removing some. For example, these instructions lack the predicates that ISA_MICROMIPS32R6 is supposed to add. Inherit from PredicateControl (you already do this since you inherit from MipsR6Inst) and set each mutually exclusive group independently. Likewise for the other occasions you override Predicates. |
lib/Target/Mips/MicroMipsInstrInfo.td | ||
931 ↗ | (On Diff #29653) | As above, don't override Predicates. Use PredicateControl's members or preferably, add a ISA_MICROMIPS and use that instead. |
Both case-statements placed in front of one copy of the code in MipsAsmParser::expandInstruction.
hasMips64r6() removed in MipsAsmParser::expandUncondBranchMMPseudo because it was redundant.
Added test for delay slot of instruction at the end of MipsAsmParser::expandUncondBranchMMPseudo.
Added MicroMipsR6Inst16 class for 16-bit instructions.
Classes changed so they inherit from MicroMipsR6Inst16 (PredicateControl) in MicroMips32r6InstrInfo.td.
Subsets of PredicateControl used instead of the Predicates list.
Added ISA_MICROMIPS and used instead of Predicates in MicroMipsInstrInfo.td.