aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-01-12 07:17:56 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-01-12 07:17:56 -0500
commit82e974d406df50ed795223e0dc5308c0c9ed7744 (patch)
tree5706bdcb4af60d63f8569a96c549f1edca0c1b62
parent5ee38d52b40b29556c946ded546b61d9eb355d01 (diff)
downloadgcc-82e974d406df50ed795223e0dc5308c0c9ed7744.zip
gcc-82e974d406df50ed795223e0dc5308c0c9ed7744.tar.gz
gcc-82e974d406df50ed795223e0dc5308c0c9ed7744.tar.bz2
(toe64): Use Intel bit pattern for little-endian XFmode Inf.
(e64toe): Likewise; also check the exponent field properly. From-SVN: r8734
-rw-r--r--gcc/real.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 484d84c..31b60cf 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++;
}