This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: enforcing mode matching in SET
- To: "David S. Miller" <davem at dm dot cobaltmicro dot com>
- Subject: Re: enforcing mode matching in SET
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Thu, 13 Aug 1998 16:21:05 -0700
- cc: jfc at tiac dot net, egcs at cygnus dot com, rth at cygnus dot com, amylaar at cygnus dot com
(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