summaryrefslogtreecommitdiff
path: root/gcc/gengenrtl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-09-08 16:09:38 -0700
committerRichard Henderson <rth@gcc.gnu.org>1999-09-08 16:09:38 -0700
commitb6b4c6c6f9aef8cdcf37eb3c2518eff0b68a787f (patch)
tree9acd07cb03001cf82fde8716c9b81dcec93213bd /gcc/gengenrtl.c
parent38792a9487a36149fc3af8ee550fc26839ebb65c (diff)
downloadgcc-b6b4c6c6f9aef8cdcf37eb3c2518eff0b68a787f.tar.gz
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
Diffstat (limited to 'gcc/gengenrtl.c')
-rw-r--r--gcc/gengenrtl.c40
1 files changed, 33 insertions, 7 deletions
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