diff options
author | Craig Topper <craig.topper@sifive.com> | 2024-10-06 19:27:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-06 19:27:18 -0700 |
commit | 35f196645079cf499bdc48863ed5a42a0bc375de (patch) | |
tree | 1eee62eb43e809a1f1366744429bf136cba2d342 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | 8c1547055eaf65003f3e6fd024195f4926ff2356 (diff) | |
download | llvm-35f196645079cf499bdc48863ed5a42a0bc375de.zip llvm-35f196645079cf499bdc48863ed5a42a0bc375de.tar.gz llvm-35f196645079cf499bdc48863ed5a42a0bc375de.tar.bz2 |
[RISCV] Only disassemble fcvtmod.w.d if the rounding mode is rtz. (#111308)
If we disassemble other rounding modes, we'll print something that can't
be parsed.
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp index 7c8206cb..be0a612 100644 --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp +++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp @@ -375,6 +375,16 @@ static DecodeStatus decodeFRMArg(MCInst &Inst, uint32_t Imm, int64_t Address, return MCDisassembler::Success; } +static DecodeStatus decodeRTZArg(MCInst &Inst, uint32_t Imm, int64_t Address, + const MCDisassembler *Decoder) { + assert(isUInt<3>(Imm) && "Invalid immediate"); + if (Imm != RISCVFPRndMode::RTZ) + return MCDisassembler::Fail; + + Inst.addOperand(MCOperand::createImm(Imm)); + return MCDisassembler::Success; +} + static DecodeStatus decodeRVCInstrRdRs1ImmZero(MCInst &Inst, uint32_t Insn, uint64_t Address, const MCDisassembler *Decoder); |