This is an archive of the discontinued LLVM Phabricator instance.

[mips][microMIPS] Implement LB, LBE, LBU and LBUE instructions
ClosedPublic

Authored by hvarga on Jul 30 2015, 12:16 AM.

Details

Summary

The patch implements microMIPS32r6 LB, LBE, LBU and LBUE instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

hvarga updated this revision to Diff 31002.Jul 30 2015, 12:16 AM
hvarga retitled this revision from to [mips][microMIPS] Implement LB, LBE, LBU and LBUE instructions.
hvarga updated this object.
hvarga added subscribers: petarj, llvm-commits.
hvarga updated this revision to Diff 37240.Oct 13 2015, 5:51 AM

Rebased from trunk.

dsanders requested changes to this revision.Oct 14 2015, 3:42 AM
dsanders edited edge metadata.
dsanders added inline comments.
lib/Target/Mips/Disassembler/MipsDisassembler.cpp
249–258 ↗(On Diff #37240)

Indentation

1167–1169 ↗(On Diff #37240)

Indentation

1177–1180 ↗(On Diff #37240)

I don't think this block is correct. LBE_MMR6 and LBUE_MMR6 have one output (Reg) and two inputs (Base and Offset). This code adds one output (Reg) and three inputs (Reg, Base, and Offset). There's also no need for the condition since only LBE_MMR6+LBUE_MMR6 will call this decoder.

If it is correct, then there's some formatting issues here (redundant braces, and space between ')' and '{').

1190–1192 ↗(On Diff #37240)

Indentation

1200–1202 ↗(On Diff #37240)

I don't think this block is correct. LB_MMR6 and LBU_MMR6 have one output (Reg) and two inputs (Base and Offset). This code adds one output (Reg) and three inputs (Reg, Base, and Offset). There's also no need for the condition since only LB_MMR6+LBU_MMR6 will call this decoder.

If it is correct, then there's some formatting issues here (redundant braces, and space between ')' and '{').

lib/Target/Mips/MicroMips32r6InstrFormats.td
136 ↗(On Diff #37240)

Naming convention: This is a bit trickier than usual since LB is in LB32 and LBU is in LBU32 so we don't have a single major opcode to use as a prefix. I think we should have:

class LB32_FM_MMR6 : MipsR6Inst {
  ...
  let Inst{31-26} = 0b000111
  ...
}
class LBU32_FM_MMR6 : LB32_FM_MMR6 {
  let Inst{31-26} = 0b000101
}
148 ↗(On Diff #37240)

Naming convention: LBE/LBUE are in POOL32C so this should be POOL32C_LB_LBU_FM_MMR6

lib/Target/Mips/MicroMips32r6InstrInfo.td
287 ↗(On Diff #37240)

Indentation

289 ↗(On Diff #37240)

Why three inputs? (mem_mm_16 has two operands inside it) These instructions don't read the result register.

I think you need to remove $rt from here and update AsmString, Constraints, and the decoder accordingly.

299 ↗(On Diff #37240)

Indentation and 80 cols

test/MC/Mips/micromips32r6/valid.s
205 ↗(On Diff #37240)

Blank line at EOF

This revision now requires changes to proceed.Oct 14 2015, 3:42 AM
hvarga updated this revision to Diff 37449.Oct 14 2015, 11:55 PM
hvarga edited edge metadata.

Fix according the comments from dsanders.

dsanders accepted this revision.Oct 16 2015, 2:47 AM
dsanders edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 16 2015, 2:47 AM
This revision was automatically updated to reflect the committed changes.