This is an archive of the discontinued LLVM Phabricator instance.

[mips][microMIPS] Implement SB, SBE, SCE, SH and SHE instructions
ClosedPublic

Authored by hvarga on Aug 6 2015, 5:38 AM.

Details

Summary

The patch implements microMIPS32r6 SB, SBE, SCE, SH and SHE instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

hvarga updated this revision to Diff 31444.Aug 6 2015, 5:38 AM
hvarga retitled this revision from to [mips][microMIPS] Implement SB, SBE, SCE, SH and SHE instructions.
hvarga updated this object.
hvarga added subscribers: petarj, llvm-commits.
dsanders accepted this revision.Aug 21 2015, 6:42 AM
dsanders edited edge metadata.

LGTM with a few nits

lib/Target/Mips/Disassembler/MipsDisassembler.cpp
260–262 ↗(On Diff #31444)

Nit: Indentation

1151–1153 ↗(On Diff #31444)

Nit: Indentation

lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
771 ↗(On Diff #31444)

Nit: Indentation

773–774 ↗(On Diff #31444)

Nit: Indentation

lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.h
176–177 ↗(On Diff #31444)

Nit: Indentation

lib/Target/Mips/MicroMips32r6InstrFormats.td
201–226 ↗(On Diff #31444)

Please break out the fields of addr using variables.

For example:

bits<21> addr;
let Inst{20-16} = addr{20-16};
let Inst{15-0}  = addr{15-0};

should be something like:

bits<21> addr;
bits<5> base = addr{20-16};
bits<16> offset = addr{15-0};
let Inst{20-16} = base;
let Inst{15-0}  = offset;

This helps to document the unusual encoding we use for addr fields.

lib/Target/Mips/MicroMips32r6InstrInfo.td
122–129 ↗(On Diff #31444)

This belongs at the top of the file, before the *_ENC classes.

294 ↗(On Diff #31444)

Nit: Indentation

300 ↗(On Diff #31444)

Nit: Indentation

This revision is now accepted and ready to land.Aug 21 2015, 6:42 AM
dsanders added inline comments.Aug 21 2015, 7:03 AM
lib/Target/Mips/MicroMips32r6InstrFormats.td
201–226 ↗(On Diff #31444)

Forgot to say: These format classes don't follow the naming convention.

'STORE_EVA_FM_MMR6' should be POOL32C_<something>_FM_MMR6

STORE_FM_MMR6 ought to be SB32_<something>_FM_MMR6 and SH32_<something>_FM_MMR6 but it's good to share the code. Maybe SX32_... or SB32_SH32_...

This revision was automatically updated to reflect the committed changes.