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 May 21, 2000, Horst von Brand <vonbrand@sleipnir.valparaiso.cl> wrote:

> Alexandre Oliva <aoliva@cygnus.com> said:
> [...]

>> -	  low = GEN_INT ((INTVAL (value) << rshift) >> rshift);
>> -	  high = GEN_INT ((INTVAL (value) << lshift) >> rshift);
>> +	  /* Set sign_bit to the most significant bit of a word.  */
>> +	  sign_bit = 1;
>> +	  sign_bit <<= BITS_PER_WORD - 1;

> What's wrong with "1 << (BITS_PER_WORD - 1)"?

`1' is `int', but I want an `unsigned HOST_WIDE_INT', that is unsigned
and possibly wider.

>> +	  mask--;

> Why not just ~0, BTW?

Because I only want the BITS_PER_WORD portion to be set; any more
significant bits should remain 0.

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me


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