This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
x86_64 and HOST_WIDE_INT changes fix
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com, patches at x86-64 dot org
- Subject: x86_64 and HOST_WIDE_INT changes fix
- From: Jan Hubicka <jh at suse dot cz>
- Date: Sun, 6 May 2001 01:27:03 +0200
Hi,
Changing of HOST_WIDE_INT has brought some problems for x86_64 port.
The split_double now attempts to split TImode constant, instead
of DImode, so we need to work by hand.
ix86_split_to_parts contains stubble problem when combining the
values together.
Honza
Sun May 6 01:26:03 CEST 2001 Jan Hubicka <jh@suse.cz>
* i386.c (split_di): Avoid use of split_double
(ix86_split_to_parts): Fix handling of 64bit case.
Index: i386.c
===================================================================
RCS file: /home/cvs/Repository/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.66
diff -c -3 -p -r1.66 i386.c
*** i386.c 2001/05/03 15:57:53 1.66
--- i386.c 2001/05/05 22:24:28
*************** split_di (operands, num, lo_half, hi_hal
*** 5479,5485 ****
{
rtx op = operands[num];
if (CONSTANT_P (op))
! split_double (op, &lo_half[num], &hi_half[num]);
else if (! reload_completed)
{
lo_half[num] = gen_lowpart (SImode, op);
--- 5484,5507 ----
{
rtx op = operands[num];
if (CONSTANT_P (op))
! {
! if (GET_CODE (op) == CONST_INT)
! {
! lo_half[num] = GEN_INT (trunc_int_for_mode (INTVAL (op), SImode));
! if (HOST_BITS_PER_WIDE_INT > 32)
! hi_half[num] = GEN_INT (trunc_int_for_mode ((INTVAL (op) >> 31) >> 1,
! SImode));
! else
! hi_half[num] = (1 << 31) != 0 ? constm1_rtx : const0_rtx;
! }
! else if (GET_CODE (op) == CONST_DOUBLE && HOST_BITS_PER_WIDE_INT == 32)
! {
! lo_half[num] = GEN_INT (trunc_int_for_mode (CONST_DOUBLE_LOW (op), SImode));
! hi_half[num] = GEN_INT (trunc_int_for_mode (CONST_DOUBLE_HIGH (op), SImode));
! }
! else
! abort ();
! }
else if (! reload_completed)
{
lo_half[num] = gen_lowpart (SImode, op);
*************** ix86_split_to_parts (operand, parts, mod
*** 8021,8027 ****
REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, l);
/* Do not use shift by 32 to avoid warning on 32bit systems. */
if (HOST_BITS_PER_WIDE_INT >= 64)
! parts[0] = GEN_INT (l[0] + ((l[1] << 31) << 1));
else
parts[0] = immed_double_const (l[0], l[1], DImode);
parts[1] = GEN_INT (l[2]);
--- 8043,8050 ----
REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, l);
/* Do not use shift by 32 to avoid warning on 32bit systems. */
if (HOST_BITS_PER_WIDE_INT >= 64)
! parts[0] = GEN_INT ((l[0] & (((HOST_WIDE_INT) 2 << 31) - 1))
! + ((((HOST_WIDE_INT)l[1]) << 31) << 1));
else
parts[0] = immed_double_const (l[0], l[1], DImode);
parts[1] = GEN_INT (l[2]);