This is an archive of the discontinued LLVM Phabricator instance.

[mips] Include EVA instructions in the Std2MicroMips mapping tables
ClosedPublic

Authored by abeserminji on Jan 5 2018, 9:15 AM.

Details

Summary

This patch includes EVA instructions in Std2MicroMips mapping tables required for direct object emission.

Diff Detail

Repository
rL LLVM

Event Timeline

abeserminji created this revision.Jan 5 2018, 9:15 AM

Can you provide a test case for this? You can generate a .mir file with the stop-after option of llc, then modify by hand the stores and loads to use the MIPS eva instructions. The test case should then use start-after= with -mattr=+micromips, produce an object file, then disassemble the object for and check that the resulting object file contains only micromips instructions.

Added test case.

I forgot to mention that I didn't succeed to provoke generation of CACHEE and PREFE, although I did succeed in inserting them manually.
If that's ok I can add them just like this to test
CACHEE %1, 5, 2
PREFE %1, 5, 2
and add additional CHECKs.

Yes, adding them manually is fine. We haven't implemented support for _builtin_prefetch or _builtin_mips_cache, so that's the only way to test them.

test/CodeGen/Mips/micromips-eva.mir
4–7 ↗(On Diff #130913)

This can be removed from the test case.

55–61 ↗(On Diff #130913)

All this and the "#0"s from the function definitions can be removed from the test case.

abeserminji set the repository for this revision to rL LLVM.

Comments resolved

abeserminji marked 2 inline comments as done.Jan 29 2018, 5:42 AM
sdardis accepted this revision.Jan 29 2018, 6:38 AM

LGTM.

During review, I spotted that the left/right eva stores and loads are not in the instruction mapping tables and that they have incorrect DAG patterns associated with them but that can be submitted as a separate patch.

lib/Target/Mips/MicroMipsInstrInfo.td
786–796 ↗(On Diff #131787)

Nit: These lines are overly long.

test/CodeGen/Mips/micromips-eva.mir
211–212 ↗(On Diff #131787)

Nit: align the instruction text with the other instructions.

This revision is now accepted and ready to land.Jan 29 2018, 6:38 AM
abeserminji marked 2 inline comments as done.

Comments resolved.

This revision was automatically updated to reflect the committed changes.