The RTL template is used to define which insns match the particular pattern and how to find their operands. For named patterns, the RTL template also says how to construct an insn from specified operands.
Construction involves substituting specified operands into a copy of the template.
Matching involves determining the values that serve as the operands in the insn being matched. Both of these activities are controlled by special expression types that direct matching and substitution of the operands. This expression is a placeholder for operand number n of the insn. When constructing an insn, operand number n will be substituted at this point. Operand numbers must be chosen consecutively counting from zero in each instruction pattern.