diff options
author | Min-Yih Hsu <min.hsu@sifive.com> | 2025-01-24 13:02:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-24 13:02:33 -0800 |
commit | 074a25fb2678dacb4f3c6a24d5f907788c858e7a (patch) | |
tree | 4920aa972c672eb1076f33dc14ffbf3088aa57a8 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | d398c0c97aa0bfaeed5647f75bc37c87b8142f79 (diff) | |
download | llvm-074a25fb2678dacb4f3c6a24d5f907788c858e7a.zip llvm-074a25fb2678dacb4f3c6a24d5f907788c858e7a.tar.gz llvm-074a25fb2678dacb4f3c6a24d5f907788c858e7a.tar.bz2 |
[RISCV][MC] Create an AsmOperand for carry-in vmask (#124317)
Previously we used a fixed assembly string as well as encoding for the
carry-in vector mask, since it will always be there. However, this makes
both AsmParser and disassembler to either create a garbage MCOperand for
the mask or fail to add one as a whole. This wouldn't be a problem for
majority of the cases but tools like llvm-mca who relies on MCInst will
fail to account for the register dependency on these mask operands.
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 a0b87f7..1c4f322 100644 --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp +++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp @@ -297,6 +297,16 @@ static DecodeStatus DecodeVRM8RegisterClass(MCInst &Inst, uint32_t RegNo, return MCDisassembler::Success; } +static DecodeStatus DecodeVMV0RegisterClass(MCInst &Inst, uint32_t RegNo, + uint64_t Address, + const MCDisassembler *Decoder) { + if (RegNo) + return MCDisassembler::Fail; + + Inst.addOperand(MCOperand::createReg(RISCV::V0)); + return MCDisassembler::Success; +} + static DecodeStatus decodeVMaskReg(MCInst &Inst, uint32_t RegNo, uint64_t Address, const MCDisassembler *Decoder) { |