This is the mail archive of the
mailing list for the GCC project.
Re: how to add new instruction
apollo <firstname.lastname@example.org> writes:
> DEF_RTL_EXPR(NEWINSN, "newinsn", "ei", 'x'), i use "ei" here, because
> the first operand is real type, and the second one is int type.
> however, when i changed the "ei" in rtl definition to "ee", it works
> well. i don't know why? what's the problem with "ei"?
The codes in "ei" do not refer to the types of the operands which the
instruction takes. They refer to the types of the operands to use
when creating the RTL structures. If your new instruction takes two
operands, as apparently it does, you need to use "ee". An 'i' means
that the RTL structure uses an integer; this is true when the field
holds a number, such as a register number. An operand of the machine
instruction is always represented by 'e'. That might then turn out to
be, say, a CONST_INT, when code is generated.