summaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-01-12 12:17:56 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-01-12 12:17:56 +0000
commit01d330be4cbc84e2209bf3f42dc95d4b38de282f (patch)
tree5706bdcb4af60d63f8569a96c549f1edca0c1b62 /gcc/real.c
parent2c15b0b46af4457857511cb745d035711871c940 (diff)
downloadgcc-01d330be4cbc84e2209bf3f42dc95d4b38de282f.tar.gz
(toe64): Use Intel bit pattern for little-endian XFmode Inf.
(e64toe): Likewise; also check the exponent field properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8734 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 484d84cd552..31b60cf7bd7 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1,6 +1,6 @@
/* real.c - implementation of REAL_ARITHMETIC, REAL_VALUE_ATOF,
and support for XFmode IEEE extended real floating point arithmetic.
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
Contributed by Stephen L. Moshier (moshier@world.std.com).
This file is part of GNU CC.
@@ -2957,9 +2957,9 @@ e64toe (pe, y)
*p-- = *e++;
}
#endif
- p = yy;
- q = y;
#ifdef INFINITY
+ /* Point to the exponent field and check max exponent cases. */
+ p = &yy[NE - 1];
if (*p == 0x7fff)
{
#ifdef NANS
@@ -2967,7 +2967,9 @@ e64toe (pe, y)
{
for (i = 0; i < 4; i++)
{
- if (pe[i] != 0)
+ if ((i != 3 && pe[i] != 0)
+ /* Anything but 0x8000 here, including 0, is a NaN. */
+ || (i == 3 && pe[i] != 0x8000))
{
enan (y, (*p & 0x8000) != 0);
return;
@@ -2993,6 +2995,8 @@ e64toe (pe, y)
return;
}
#endif /* INFINITY */
+ p = yy;
+ q = y;
for (i = 0; i < NE; i++)
*q++ = *p++;
}
@@ -3385,6 +3389,17 @@ toe64 (a, b)
}
else
{
+#ifdef INFINITY
+ if (eiisinf (a))
+ {
+ /* Intel long double infinity significand. */
+ *q-- = 0x8000;
+ *q-- = 0;
+ *q-- = 0;
+ *q = 0;
+ return;
+ }
+#endif
for (i = 0; i < 4; i++)
*q-- = *p++;
}