I have a question about instruction operands

There is my instruction.

let hasSideEffects = 1, mayLoad = 1, mayStore = 1, Predicates = [HasBuddyExt] in 
def flush : RVInstR<0b0000111, 0b011, OPC_CUSTOM_3, (outs),
                    (ins GPR:$rs1), "flush", "$rs1"> {
  let rs2 = 0;
  let rd = 0;
}

I have encountered this problem.

 Instruction 'flush' was provided 2 operands but expected only 1!
def: PatGprGpr<int_riscv_flush, flush>;
^
anonymous_59292:        (flush GPR:{ *:[i32] m1:[i64] }:$rs1, GPR:{}:$rs2)

I don’t know why there is such a problem, in my opinion, the ins is GPR:$rs1,there should be only one operand here. If anyone can help me, I would be grateful,thanks!

PatGprGpr is for GPR+GPR->GPR instructions. You want just PatGpr.

2 Likes

Thanks!