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]

Re: enforcing mode matching in SET


	(set (match_operand:SI 0 "register_operand" "=&r")
		(ne:DI (match_operand:DI 1 "register_operand" "r")
		       (const_int 0)))

The NE operator should be SImode.  There is no need for a truncate operator,
and it would be undesirable to add one.

For a comparison operator, the mode of the comparison is obtained from its
operands.  The mode of the comparison operator itself indicates the mode of
the result of the comparison, which may be a different mode than the inputs.
(See also the "RTL comparison" and "RTL comparison operations" sections of
rtl.texi.)

For example, the cmpsi_insn pattern in sparc.md has
  [(set (reg:CC 100)
        (compare:CC (match_operand:SI 0 "register_operand" "r")
                    (match_operand:SI 1 "arith_operand" "rI")))]
This is an SImode compare producing a CCmode result.  EQ/NE/LT/etc all work
similarly.

Jim


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