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: Modes on CONST_INTs


> 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.

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