How to mapping Intrinsic function to multiple riscv instruction?

I am trying to add some extended Intrinsic functions that have multiple parameters. Currently, I can only implement mapping from one function to one riscv instruction based on tablegen, but I want to map a function to multiple riscv instructions.
What should I do? Is there any code or case introduction?
looking forward to your reply. Thank you !

You can emit multiple instructions in tblgen. I don’t have an intrinsic example, here’s non-intrinsic example.

def : Pat<(i64 (and GPR:$rs1, 0xffffffff)), (SRLI (SLLI GPR:$rs1, 32), 32)>;

Another option is to emit the multiple instructions from RISCVISelDAGToDAG.cpp. There are already some examples in there like Intrinsic::riscv_vmsgeu

@topperc thanks for your help.
I have another question, for example, my intrinsics function has four parameters, and I want to generate two instructions. One instruction uses the first two parameters, and the other instruction uses the last two parameters. The two instructions have no dependencies. Can this be achieved using tablegen?

I don’t think tblgen can emit independent instructions.

ok, i will try some test like Intrinsic::riscv_vmsgeu :smiley: