From: Richard Henderson Date: Wed, 8 Sep 1999 23:09:38 +0000 (-0700) Subject: gengenrtl.c (CONST_DOUBLE_FORMAT): Take the size REAL_ARITHMETIC will use into account. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b6b4c6c6f9aef8cdcf37eb3c2518eff0b68a787f;p=gcc.git gengenrtl.c (CONST_DOUBLE_FORMAT): Take the size REAL_ARITHMETIC will use into account. * gengenrtl.c (CONST_DOUBLE_FORMAT): Take the size REAL_ARITHMETIC will use into account. Expand the max width to 5. * rtl.c: Likewise. From-SVN: r29216 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce1571ced6e..abf78065e55 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Sep 8 16:07:52 1999 Richard Henderson + + * gengenrtl.c (CONST_DOUBLE_FORMAT): Take the size REAL_ARITHMETIC + will use into account. Expand the max width to 5. + * rtl.c: Likewise. + Wed Sep 8 16:01:14 1999 Richard Henderson * ggc-simple.c (ggc_free_rtx): Poison the correct amount diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index e6d932cbd46..e1addb64007 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -30,19 +30,45 @@ Boston, MA 02111-1307, USA. */ /* Calculate the format for CONST_DOUBLE. This depends on the relative widths of HOST_WIDE_INT and REAL_VALUE_TYPE. - We only need to go out to e0wwww, since min(HOST_WIDE_INT)==32 and - max(LONG_DOUBLE_TYPE_SIZE)==128. - This is duplicated in rtl.c. + + We need to go out to e0wwwww, since REAL_ARITHMETIC assumes 16-bits + per element in REAL_VALUE_TYPE. + + This is duplicated in rtl.c. + A number of places assume that there are always at least two 'w' slots in a CONST_DOUBLE, so we provide them even if one would suffice. */ -#if HOST_BITS_PER_WIDE_INT >= LONG_DOUBLE_TYPE_SIZE + +#ifdef REAL_ARITHMETIC +#if LONG_DOUBLE_TYPE_SIZE == 96 +#define REAL_WIDTH (11*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT +#elif LONG_DOUBLE_TYPE_SIZE == 128 +#define REAL_WIDTH (19*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT +#elif HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT +#define REAL_WIDTH (7*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT +#endif +#endif /* REAL_ARITHMETIC */ + +#ifndef REAL_WIDTH +#if HOST_BITS_PER_WIDE_INT*2 >= LONG_DOUBLE_TYPE_SIZE +#define REAL_WIDTH 2 +#elif HOST_BITS_PER_WIDE_INT*3 >= LONG_DOUBLE_TYPE_SIZE +#define REAL_WIDTH 3 +#elif HOST_BITS_PER_WIDE_INT*4 >= LONG_DOUBLE_TYPE_SIZE +#define REAL_WIDTH 4 +#endif +#endif /* REAL_WIDTH */ + +#if REAL_WIDTH == 1 #define CONST_DOUBLE_FORMAT "e0ww" -#elif HOST_BITS_PER_WIDE_INT*2 >= LONG_DOUBLE_TYPE_SIZE +#elif REAL_WIDTH == 2 #define CONST_DOUBLE_FORMAT "e0ww" -#elif HOST_BITS_PER_WIDE_INT*3 >= LONG_DOUBLE_TYPE_SIZE +#elif REAL_WIDTH == 3 #define CONST_DOUBLE_FORMAT "e0www" -#elif HOST_BITS_PER_WIDE_INT*4 >= LONG_DOUBLE_TYPE_SIZE +#elif REAL_WIDTH == 4 #define CONST_DOUBLE_FORMAT "e0wwww" +#elif REAL_WIDTH == 5 +#define CONST_DOUBLE_FORMAT "e0wwwww" #else #define CONST_DOUBLE_FORMAT /* nothing - will cause syntax error */ #endif diff --git a/gcc/rtl.c b/gcc/rtl.c index 1c5bf6db4cb..4164c689c6c 100644 --- a/gcc/rtl.c +++ b/gcc/rtl.c @@ -42,22 +42,47 @@ Boston, MA 02111-1307, USA. */ extern struct obstack *rtl_obstack; - /* Calculate the format for CONST_DOUBLE. This depends on the relative widths of HOST_WIDE_INT and REAL_VALUE_TYPE. - We only need to go out to e0wwww, since min(HOST_WIDE_INT)==32 and - max(LONG_DOUBLE_TYPE_SIZE)==128. + + We need to go out to e0wwwww, since REAL_ARITHMETIC assumes 16-bits + per element in REAL_VALUE_TYPE. + This is duplicated in gengenrtl.c. + A number of places assume that there are always at least two 'w' slots in a CONST_DOUBLE, so we provide them even if one would suffice. */ -#if HOST_BITS_PER_WIDE_INT >= LONG_DOUBLE_TYPE_SIZE + +#ifdef REAL_ARITHMETIC +#if LONG_DOUBLE_TYPE_SIZE == 96 +#define REAL_WIDTH (11*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT +#elif LONG_DOUBLE_TYPE_SIZE == 128 +#define REAL_WIDTH (19*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT +#elif HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT +#define REAL_WIDTH (7*8 + HOST_BITS_PER_WIDE_INT)/HOST_BITS_PER_WIDE_INT +#endif +#endif /* REAL_ARITHMETIC */ + +#ifndef REAL_WIDTH +#if HOST_BITS_PER_WIDE_INT*2 >= LONG_DOUBLE_TYPE_SIZE +#define REAL_WIDTH 2 +#elif HOST_BITS_PER_WIDE_INT*3 >= LONG_DOUBLE_TYPE_SIZE +#define REAL_WIDTH 3 +#elif HOST_BITS_PER_WIDE_INT*4 >= LONG_DOUBLE_TYPE_SIZE +#define REAL_WIDTH 4 +#endif +#endif /* REAL_WIDTH */ + +#if REAL_WIDTH == 1 #define CONST_DOUBLE_FORMAT "e0ww" -#elif HOST_BITS_PER_WIDE_INT*2 >= LONG_DOUBLE_TYPE_SIZE +#elif REAL_WIDTH == 2 #define CONST_DOUBLE_FORMAT "e0ww" -#elif HOST_BITS_PER_WIDE_INT*3 >= LONG_DOUBLE_TYPE_SIZE +#elif REAL_WIDTH == 3 #define CONST_DOUBLE_FORMAT "e0www" -#elif HOST_BITS_PER_WIDE_INT*4 >= LONG_DOUBLE_TYPE_SIZE +#elif REAL_WIDTH == 4 #define CONST_DOUBLE_FORMAT "e0wwww" +#elif REAL_WIDTH == 5 +#define CONST_DOUBLE_FORMAT "e0wwwww" #else #define CONST_DOUBLE_FORMAT /* nothing - will cause syntax error */ #endif