diff options
author | Craig Topper <craig.topper@sifive.com> | 2025-03-26 19:58:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-26 19:58:35 -0700 |
commit | d58f57228d46a73059d507eef252a8dfae14f256 (patch) | |
tree | 4e417c9b8d18fc52ee224bc28677529dfb904e07 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | e54f31a20c23b2b1fdb524a63b84361703613c4e (diff) | |
download | llvm-d58f57228d46a73059d507eef252a8dfae14f256.zip llvm-d58f57228d46a73059d507eef252a8dfae14f256.tar.gz llvm-d58f57228d46a73059d507eef252a8dfae14f256.tar.bz2 |
[RISCV] Use named sub-operands to simplify encoding/decoding for CoreV Reg-Reg instructions. (#133181)
We can name the sub-operands using a DAG in the 'ins'. This allows those
names to be matched to the encoding fields. This removes the need for a
custom encoder/decoder that treats the 2 sub-operands as a single 10-bit
value.
While doing this, I noticed the base and offset names in the
MIOperandInfo were swapped relative to how the operands are parsed and
printed. Assuming that I've correctly understood the parsing/print
format as "offset(base)".
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp index 93cbf66..46b0141 100644 --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp +++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp @@ -507,9 +507,6 @@ static DecodeStatus decodeXTHeadMemPair(MCInst &Inst, uint32_t Insn, static DecodeStatus decodeZcmpRlist(MCInst &Inst, uint32_t Imm, uint64_t Address, const void *Decoder); -static DecodeStatus decodeRegReg(MCInst &Inst, uint32_t Insn, uint64_t Address, - const MCDisassembler *Decoder); - static DecodeStatus decodeZcmpSpimm(MCInst &Inst, uint32_t Imm, uint64_t Address, const void *Decoder); @@ -621,15 +618,6 @@ static DecodeStatus decodeZcmpRlist(MCInst &Inst, uint32_t Imm, return MCDisassembler::Success; } -static DecodeStatus decodeRegReg(MCInst &Inst, uint32_t Insn, uint64_t Address, - const MCDisassembler *Decoder) { - uint32_t Rs1 = fieldFromInstruction(Insn, 0, 5); - uint32_t Rs2 = fieldFromInstruction(Insn, 5, 5); - DecodeGPRRegisterClass(Inst, Rs1, Address, Decoder); - DecodeGPRRegisterClass(Inst, Rs2, Address, Decoder); - return MCDisassembler::Success; -} - static DecodeStatus decodeZcmpSpimm(MCInst &Inst, uint32_t Imm, uint64_t Address, const void *Decoder) { Inst.addOperand(MCOperand::createImm(Imm)); |