Sign extension of const_int rtx

Paul Brook paul@codesourcery.com
Thu Jan 20 18:14:00 GMT 2005


In arm.c:const_ok_for_arm we have the following comment, in the context of an 
SImode constant:

  /* For machines with >32 bit HOST_WIDE_INT, the bits above bit 31 must
     be all zero, or all one.  */

This implies that constants are always sign extended if HOST_WIDE_INT is wider 
than the effective mode of the constant. Empirically this seems to be the 
case.

Is assumption true, and if so is it documented anywhere?I looked through 
rtl.texi and can't see anything.

Needless to say the arm backend breaks if the assumption is violated.

Paul



More information about the Gcc mailing list