This is an archive of the discontinued LLVM Phabricator instance.

[mips][microMIPS] Create microMIPS64r6 subtarget and implement DALIGN, DAUI, DAHI, DATI, DEXT, DEXTM and DEXTU instructions
ClosedPublic

Authored by hvarga on Jul 3 2015, 5:20 AM.

Details

Summary

The patch creates microMIPS64r6 subtarget and implements DALIGN, DAUI, DAHI, DATI, DEXT, DEXTM and DEXTU instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

hvarga updated this revision to Diff 29010.Jul 3 2015, 5:20 AM
hvarga retitled this revision from to [mips][microMIPS] Create microMIPS64r6 subtarget and impelment DALIGN, DAUI, DAHI, DATI, DEXT, DEXTM and DEXTU instructions.
hvarga updated this object.
hvarga added subscribers: petarj, llvm-commits.
hvarga updated this revision to Diff 29011.Jul 3 2015, 6:00 AM

Added new empty line in valid.s file.

hvarga retitled this revision from [mips][microMIPS] Create microMIPS64r6 subtarget and impelment DALIGN, DAUI, DAHI, DATI, DEXT, DEXTM and DEXTU instructions to [mips][microMIPS] Create microMIPS64r6 subtarget and implement DALIGN, DAUI, DAHI, DATI, DEXT, DEXTM and DEXTU instructions.
dsanders added inline comments.Jul 6 2015, 7:03 AM
lib/Target/Mips/Disassembler/MipsDisassembler.cpp
850 ↗(On Diff #29011)

hasMips64r6() isn't needed. The predicates are cumulative so hasMips32r6() is true for MIPS64r6 too.

lib/Target/Mips/MicroMips32r6InstrInfo.td
286 ↗(On Diff #29011)

I'm on the fence about this. For consistency with the other namespaces, we shouldn't add '_64r6' but equally more descriptive names are generally a good thing.

lib/Target/Mips/MicroMips64r6InstrFormats.td
1 ↗(On Diff #29011)

80 cols?

14 ↗(On Diff #29011)

Please use the naming convention we used for MIPS32r6/MIPS64r6.

The prefix should match the major opcode name. Then (where necessary) something to disambiguate variations of the major opcode. Lastly a '_FM' suffix.

For example:

DOUBLE_ADD_UPPER_IMM -> DAUI_FM.
DOUBLE_EXT_BIT_FIELD -> POOL32S_EXTBITS_FM.
CONCAT_EXTRACT -> POOL32S_DALIGN_FM.
lib/Target/Mips/MicroMips64r6InstrInfo.td
1 ↗(On Diff #29011)

80 cols?

43 ↗(On Diff #29011)

Optional nit: DAHI_DATI_DESC_BASE? It's easier to format when the names aren't so long and we generally don't expand the mnemonic to the words it stands for.

Similarly for the other lengthy *_DESC_BASE's below.

43–45 ↗(On Diff #29011)

Indentation

56–57 ↗(On Diff #29011)

Indendation

90–100 ↗(On Diff #29011)

Why do some of these use StdMMR6Rel and others use R6MM6Rel?

hvarga updated this revision to Diff 29163.Jul 7 2015, 4:35 AM
hvarga marked 9 inline comments as done.

Updated according to the comments from dsanders.

dsanders accepted this revision.Aug 11 2015, 3:36 AM
dsanders edited edge metadata.

LGTM with the '-*- tablegen -*-' issue fixed.

lib/Target/Mips/MicroMips64r6InstrFormats.td
1–2 ↗(On Diff #29163)

Unfortunately, this bit needs to be on the first line. It tells emacs (and presumably other editors) what the file format is.

I'd drop the redundant 'Mips64r6' in 'Mips64r6 Instruction Formats'.

lib/Target/Mips/MicroMips64r6InstrInfo.td
2 ↗(On Diff #29163)

Likewise

This revision is now accepted and ready to land.Aug 11 2015, 3:36 AM
This revision was automatically updated to reflect the committed changes.