This is the mail archive of the gcc-patches@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: mn10300 64-bit clean-up


On Sat, May 20, 2000 at 05:32:41PM -0300, Alexandre Oliva wrote:
> To be really sure, we'd have to ensure that 0xffffffff is not
> sign-extended, as it may be in a K&R C compiler.  Do we care?
> How about `s/0xffffffff/(((((unsigned long)1) << 16) << 16) - 1)/'?

I don't believe 0xffffffff will be sign extended in any K&R compiler
(not for the least part in that 64-bit K&R is a breed that nearly 
never existed).  Writing the constant the other way is just obtuse.

For ISO C, either we have 32-bit int, in which case 0xffffffff doesn't
quite fit and the constant has type unsigned int, or int is larger, 
in which case the sign bit is not set and the constant is zero extended.

> No, I'm extracting the high word in case HOST_WIDE_INT is 64-bits
> long.  It will be exactly -1 or 0 in the 32-bits case.

Oh, I see.  Perhaps that was obvious in the larger context, 
which I didn't look at.


r~

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