[MIPS] Fix useDeprecatedPositionallyEncodedOperands errors.
authorJames Y Knight <jyknight@google.com>
Mon, 19 Sep 2022 20:17:18 +0000 (16:17 -0400)
committerJames Y Knight <jyknight@google.com>
Wed, 26 Oct 2022 18:06:08 +0000 (14:06 -0400)
commit26fdad031ca8baa2196a6c8c40c0a23c066e611e
treea6b1e5545f3ea464312aa6b708b30fc56fa40c06
parent23394cd81092b10fea92a9e3959354865082fad1
[MIPS] Fix useDeprecatedPositionallyEncodedOperands errors.

This is a follow-on to https://reviews.llvm.org/D134073.

The number of MIPS16 changes here is a bit surprising. Many of the
fields with mismatched names were NOT previously choosing the correct
argument positionally, but instead doing something completely wrong
(e.g. it would encode a register where an immediate was expected).

But, machine-code generation for MIPS16 has never actually functioned.
It's also fully untested, thus, the MIPS16 changes, despite changing
behavior, breaks (and fixes) zero tests. This change does not fix
MIPS16 output, but it ought to be at least incrementally less broken.

Outside MIPS16, I believe the only functional change is to the 'ginvi'
instruction: it was previously encoding garbage into a field which was
specified to be '00'. Fortunately, it was covered by tests -- and the
tests were testing the incorrect behavior. So, fixed.

Differential Revision: https://reviews.llvm.org/D134220
13 files changed:
llvm/lib/Target/Mips/MicroMips32r6InstrFormats.td
llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td
llvm/lib/Target/Mips/MicroMipsInstrFormats.td
llvm/lib/Target/Mips/Mips.td
llvm/lib/Target/Mips/Mips16InstrFormats.td
llvm/lib/Target/Mips/Mips16InstrInfo.td
llvm/lib/Target/Mips/Mips32r6InstrInfo.td
llvm/lib/Target/Mips/MipsEVAInstrFormats.td
llvm/lib/Target/Mips/MipsEVAInstrInfo.td
llvm/test/MC/Disassembler/Mips/ginv/valid-el.txt
llvm/test/MC/Disassembler/Mips/ginv/valid-micromips-el.txt
llvm/test/MC/Disassembler/Mips/ginv/valid-micromips.txt
llvm/test/MC/Disassembler/Mips/ginv/valid.txt