Patch for incorrect execute/divconst-2.c)

Richard Earnshaw rearnsha@arm.com
Tue May 30 09:31:00 GMT 2000


> > Date: Tue, 30 May 2000 11:54:54 +0100
> > From: Richard Earnshaw <rearnsha@arm.com>
> > 
> > 
> > geoffk@cygnus.com said:
> > > Sure.  Assuming that DImode is 2*HOST_BITS_PER_WIDE_INT wide, - (1 <<
> > > (HOST_BITS_PER_WIDE_INT - 1) is a CONST_INT, and (1 <<
> > > (HOST_BITS_PER_WIDE_INT - 1) is a CONST_DOUBLE.   CONST_INTs are
> > > sign-extended, so that -1 has the same representation in all modes.
> > 
> > 
> > I've never seen anything like this written down before (not that I'm 
> > disputing what you are saying).  Can you add something like this to 
> > rtl.texi (under const_double) to make this explicit.
> 
> It is already pretty explicit:
> 
> @item (const_double:@var{m} @var{addr} @var{i0} @var{i1} @dots{})
> Represents ... an integer constant too large to fit into
> @code{HOST_BITS_PER_WIDE_INT} bits ...
> 
> However, it could probably be made clearer in the description of
> CONST_INT that it is sign-extended.  I don't suppose you could propose
> wording?

It's the definition of "too big" that is key to this, and IMO it was never 
clear (at least, I can't claim to have ever fully understood the 
subtleties).  Maybe it could all be clarified by an example:

Note, CONST_INT is sign-extended to the target mode size, so on a host 
where HOST_WIDE_INT is 32-bits,

	(set (reg:DI r1) (const_int(-2147483648)))

will set r1 to the bit pattern (0xffff ffff 8000 0000) on a target machine 
where DImode is 64 bits.





More information about the Gcc-patches mailing list