[RISCV] Rework how implied SP operands work in the disassembler. NFC
authorCraig Topper <craig.topper@sifive.com>
Tue, 16 May 2023 16:43:38 +0000 (09:43 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 16 May 2023 16:43:38 +0000 (09:43 -0700)
commit8f43c3f49ecea404458a2fbde126e20c6d404a14
treee76fb37def812af74fd23628273d74cd05d6ae94
parent2f4c96097a3cbf9d07eab699efd25f767bb4fdd5
[RISCV] Rework how implied SP operands work in the disassembler. NFC

Previously we added the SP operands when an immediate operand was added
to certain opcodes.

This patch moves it to a post processing step using the information
in MCInstrDesc. This avoids an explicit opcode list in RISCVDisassembler.cpp.

In considered using a custom DecoderMethod, but the bit swizzling we
need to do for the immediates on these instructions made that
unattractive.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D149931
llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp