Syntax help about TableGen

Hi all,

I am trying to replace selectcc with our own IL like cmp_eq_cmpval. The formats for cmp_eq_cmpval and select_cc are described in the comments. The following is my code.
However, the 1st operand (highlighted with bold red color, i.e., (type:$src1)) is illegal, and its error is “error:Illegal operand for the ‘ZERO_EQrirr’ instruction!” Could anybody here point me out
what kind of solution can be? Thanks!

// Multiclasses that deal with the cmp instruction.
// cmp_eq_cmpval(cmpval) dst, src0, src1, src2
// select_cc lhs, rhs, true, false, cond

def cond_seteq_setoeq : PatLeaf <(cond), [{

return N->get() == ISD::SETEQ || N->get() == ISD::SETOEQ;

multiclass CmpRelop<RegisterClass reg, ValueType type,
string conststr, PatLeaf cc, string ccstr> {
def rirr : ILFormat<IL_OP_CMP,
(outs GPR_32:$dst),
(ins (reg:$src0), (type:$src1), (reg:$src2), (reg:$src3)),
!strconcat(IL_OP_CMP.Text, “_($ccstr)_cmpval($conststr) $dst, $src0, $src2, $src3”),
[(set GPR_32:$dst,
(selectcc (type reg:$src0), (type:$src1), (type reg:$src2), (type reg:$src3), cc))]>;

multiclass CmpRelopExpand {
defm EQ : CmpRelop<GPR_32, f32, conststr, cond_seteq_setoeq, “eq”>;

defm ZERO_ : CmpRelopExpand<“0.0”>;

Hi Ke,

        (ins (reg:$src0), (type:$src1), (reg:$src2), (reg:$src3)),

I'd have put the problem here. Using a ValueType in the pattern later
is fine, but members of (ins) and (outs) lists have to be instances of
Operand or a register class.

If a full 32 or 64-bit immediate is permitted, i32imm/i64imm should be
OK, otherwise you may need to create your own version.