[llvm] [RISCV][MC] Create an AsmOperand for carry-in vmask (PR #124317)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 10:11:48 PST 2025


================
@@ -293,6 +293,16 @@ static DecodeStatus DecodeVRM8RegisterClass(MCInst &Inst, uint32_t RegNo,
   return MCDisassembler::Success;
 }
 
+static DecodeStatus DecodeVMV0RegisterClass(MCInst &Inst, uint32_t RegNo,
----------------
mshockwave wrote:

I didn't reuse `decodeVMaskReg` here because it accepts arbitrary `vm` field value, while we only accept `vm = 0` for carry-in vmask. Put it differently, if the input is an invalid encoding with `vm=1` on instruction with carry-in mask, `decodeVMaskReg` puts a NoRegister as the MCOperand and crashes the program, rather than printing out a nice error message.

https://github.com/llvm/llvm-project/pull/124317


More information about the llvm-commits mailing list