This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Modes on CONST_INTs
- To: hans-peter dot nilsson at axis dot com (Hans-Peter Nilsson)
- Subject: Re: Modes on CONST_INTs
- From: Joern Rennecke <amylaar at redhat dot com>
- Date: Tue, 28 Nov 2000 02:11:04 +0000 (GMT)
- Cc: geoffk at redhat dot com, hans-peter dot nilsson at axis dot com, bernds at redhat dot com, gcc at gcc dot gnu dot org
> Right. Also, having the signedness/unsignedness property
> available would find more bugs, as Michael Meissner pointed out.
No, the signedness / unsignedness is solely a property of the operation
that operates on the constant.
Consider:
(set (reg:HI 1) (const_int -1))
(set (cc0) (compare (reg:HI 1) (const_int 0)))
(set (reg:SI 2) (ugt:HI (cc0) (const_int 0)))
(set (cc0) (compare (reg:HI 1) (const_int 0)))
(set (reg:SI 3) (gt:HI (cc0) (const_int 0)))
The constant (const_int -1) has no intrinsic signedness. It is the
ugt operation that is unsigned and gt that is signed.