This is an archive of the discontinued LLVM Phabricator instance.

[mips][microMIPS] Add CodeGen support for SLL16, SRL16, SLL, SLLV, SRA, SRAV, SRL and SRLV instructions
ClosedPublic

Authored by zbuljan on Mar 9 2016, 5:13 AM.

Details

Summary

The patch adds CodeGen support for microMIPSr6 SLL16, SRL16, SLL, SLLV, SRA, SRAV, SRL and SRLV instructions:

  • added DAG patterns for proper selection of shift instructions
  • added alias definitions for microMIPS instructions
  • separated microMIPS instructions from equivalent MIPS instructions using NotInMicroMips predicate
  • updated .ll files with tests for microMIPSr6 instructions
  • added tests for the standard encodings
  • added invalid operand tests
  • fixed opcode strings in desc. classes for a couple of 16-bit instructions

Diff Detail

Event Timeline

zbuljan updated this revision to Diff 50123.Mar 9 2016, 5:13 AM
zbuljan retitled this revision from to [mips][microMIPS] Add CodeGen support for SLL16, SRL16, SLL, SLLV, SRA, SRAV, SRL and SRLV instructions.
zbuljan updated this object.
zbuljan added subscribers: petarj, llvm-commits.
sdardis requested changes to this revision.Apr 15 2016, 1:51 AM
sdardis edited edge metadata.

Comments inlined. Can you rebase and repost?

test/CodeGen/Mips/llvm-ir/ashr.ll
229

Since you've posted this patch, the LLVM backend for MIPS was changed to use the static relocation model, so this should be:

jals      __ashrti3
test/MC/Disassembler/Mips/micromips32r3/valid-el.txt
192–200

sllv, srav and srlv appear twice here. Once is enough. There are more occurrences in the other tests.

This revision now requires changes to proceed.Apr 15 2016, 1:51 AM
zbuljan updated this revision to Diff 54166.Apr 19 2016, 12:49 AM
zbuljan edited edge metadata.

Rebased to work with TOT.
Added -relocation-model=pic switch to microMIPS CodeGen tests for consistency with other tests.
Removed redundant tests for sllv, srav and srlv.

sdardis accepted this revision.Apr 19 2016, 3:37 AM
sdardis edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Apr 19 2016, 3:37 AM
This revision was automatically updated to reflect the committed changes.