This is an archive of the discontinued LLVM Phabricator instance.

[mips][microMIPS] Implement ADDQ.PH, ADDQ_S.W, ADDQH.PH, ADDQH.W, ADDSC, ADDU.PH, ADDU_S.QB, ADDWC and ADDUH.QB instructions
ClosedPublic

Authored by zbuljan on Sep 24 2015, 5:46 AM.

Details

Summary

The patch implements microMIPSDSP instructions: ADDQ.PH, ADDQ_S.W, ADDQH.PH, ADDQH.W, ADDSC, ADDU.PH, ADDU_S.QB, ADDWC and ADDUH.QB.

Diff Detail

Repository
rL LLVM

Event Timeline

zbuljan updated this revision to Diff 35611.Sep 24 2015, 5:46 AM
zbuljan retitled this revision from to [mips][microMIPS] Implement ADDQ.PH, ADDQ_S.W, ADDQH.PH, ADDQH.W, ADDSC, ADDU.PH, ADDU_S.QB, ADDWC and ADDUH.QB instructions.
zbuljan updated this object.
zbuljan added subscribers: petarj, llvm-commits.
dsanders added inline comments.Oct 6 2015, 2:22 AM
lib/Target/Mips/MicroMipsDSPInstrFormats.td
13–14 ↗(On Diff #35611)

It's very important that you put these in the correct category. PredicateControl only works if each sub-list is a mutually exclusive group.

HasDSP is an InsnPredicate. InMicroMips is an AdditionalPredicate.

20 ↗(On Diff #35611)

Please rename 'instr_asm' to 'opstr' to match MMCDSPInst. instr_asm is likely to be confused for assembly mnemonics which is not how it's used (the assembly syntax is defined by the *_DESC class).

32–33 ↗(On Diff #35611)

Likewise

lib/Target/Mips/MipsDSPInstrFormats.td
31–33 ↗(On Diff #35611)

HasDSPR2 is an InsnPredicate not an EncodingPredicate.

test/MC/Disassembler/Mips/micromips_dsp.txt
1 ↗(On Diff #35611)

(about filename):
I've been trying to organize test/MC/Disassembler/Mips the same way as test/MC/Mips but other work has been taking priority so I haven't renamed all the files yet.

Could you name this file test/MC/Disassembler/Mips/micromips-dsp/valid.txt?

5 ↗(On Diff #35611)

Nit: The blank lines in this file are unnecessary. If any double-spaced files have crept back in could you fix them? Thanks

test/MC/Disassembler/Mips/micromips_dspr2.txt
1 ↗(On Diff #35611)

(about filename):
I've been trying to organize test/MC/Disassembler/Mips the same way as test/MC/Mips but other work has been taking priority so I haven't renamed all the files yet.

Could you name this file test/MC/Disassembler/Mips/micromips-dspr2/valid.txt?

2 ↗(On Diff #35611)

Likewise

test/MC/Mips/micromips32r6/micromips-dsp-instructions.s
1 ↗(On Diff #35611)

(about filename):
I didn't spot this on the previous patch, but this is in the wrong directory too. At test/MC/Mips we have a directory for each ISA and each ASE. DSP is an ASE so this should be in test/MC/Mips/micromips-dsp/valid.txt

I'll correct the repo.

zbuljan updated this revision to Diff 37236.Oct 13 2015, 4:42 AM

InMicroMips set as AdditionalPredicates.
'instr_asm' parameter renamed to 'opstr'.
HasDSPR2 set as InsnPredicates.
Assembler and disassembler test files renamed and moved to micromips-dsp and micromips-dspr2 subfolders.
Deleted unnecessary blank lines.

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

LGTM. I've mentioned a merge conflict you'll get due to upstream changes below.

test/MC/Mips/micromips32r6/micromips-dsp-instructions.s
1 ↗(On Diff #35611)

You'll need to apply this to test/MC/Mips/micromips-dsp/valid.txt instead of test/MC/Mips/micromips32r6/micromips-dsp-instructions.s since I've fixed the layout in the repo.

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