This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to add new instruction


apollo <apollow@gmail.com> 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.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]