(immed_double_const): Sign-extend constants when they

have the most significant bit set for the target.

From-SVN: r7027
This commit is contained in:
Jim Wilson 1994-04-11 10:22:33 -07:00
parent 7373d92d2f
commit 2ba3a0ecef
1 changed files with 13 additions and 0 deletions

View File

@ -1785,6 +1785,19 @@ immed_double_const (i0, i1, mode)
/* We cannot represent this value as a constant. */
abort ();
/* If this would be an entire word for the target, but is not for
the host, then sign-extend on the host so that the number will look
the same way on the host that it would on the target.
For example, when building a 64 bit alpha hosted 32 bit sparc
targeted compiler, then we want the 32 bit unsigned value -1 to be
represented as a 64 bit value -1, and not as 0x00000000ffffffff.
The later confuses the sparc backend. */
if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT && BITS_PER_WORD == width
&& (i0 & ((HOST_WIDE_INT) 1 << (width - 1))))
i0 |= ((HOST_WIDE_INT) (-1) << width);
/* If MODE fits within HOST_BITS_PER_WIDE_INT, always use a CONST_INT.
??? Strictly speaking, this is wrong if we create a CONST_INT