enforcing mode matching in SET

David S. Miller davem@dm.cobaltmicro.com
Thu Aug 13 04:50:00 GMT 1998


Does this mean I should be writing explicit truncations inside
patterns for things such as:

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

This doesn't make any sense to me in these particular kinds of cases
and from my testing the compiler groks this and what is going on just
fine.  Logically the result of a comparison is a boolean (or rather,
somthing like STORE_FLAG_VALUE) which can have arbitrary mode for it's
result, what matters is the mode used wrt. to the items being
compared.  Anyways, so my question is should I code this as:

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

If so I'll do the Sparc fixes after I finish up some other bug hunting
in the new Sparc backend.

Later,
David S. Miller
davem@dm.cobaltmicro.com



More information about the Gcc mailing list