This is an archive of the discontinued LLVM Phabricator instance.

[mips] Correct the definition of m(f|t)c(0|2)
ClosedPublic

Authored by sdardis on Jan 2 2018, 2:28 AM.

Details

Summary

These instructions are defined as taking a GPR register and a
coprocessor register for ISAs up to MIPS32. MIPS32 extended the
definition to allow a selector--a value from 0 to 32--to access
another register.

These instructions are now internally defined as being MIPS-I
instructions, but are rejected for pre-MIPS32 ISA's if they have
an explicit selector which is non-zero. This deviates slightly from
GAS's behaviour which rejects assembly instructions with an
explicit selector for pre-MIPS32 ISAs.

E.g:

mfc0 $4, $5, 0

is rejected by GAS for MIPS-I to MIPS-V but will be accepted
with this patch for MIPS-I to MIPS-V.

Diff Detail

Repository
rL LLVM

Event Timeline

sdardis created this revision.Jan 2 2018, 2:28 AM
sdardis updated this revision to Diff 128404.Jan 2 2018, 3:42 AM

I missed updating some tests.

This revision is now accepted and ready to land.Jan 3 2018, 3:39 AM
This revision was automatically updated to reflect the committed changes.