This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Another patch for nextafterl and friends
- To: GNU C Library <libc-alpha at sourceware dot cygnus dot com>
- Subject: Another patch for nextafterl and friends
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Thu, 21 Dec 2000 13:47:26 -0800
We need also change ieee_long_double_shape_type for ia64. I believe
there is a typo in sysdeps/ieee754/ldbl-96/math_ldbl.h. But I could
be wrong.
We can remove the dead branch in sysdeps/i386/fpu/s_nextafterl.c like
if (esx >= 0) {
...
}
else {
...
if (esx == 0) {
}
else {
...
}
...
}
I don't think the if (esx == 0) code can be reached.
Here is a patch.
--
H.J. Lu (hjl@valinux.com)
--
2000-12-21 H.J. Lu <hjl@gnu.org>
* sysdeps/ia64/fpu/math_ldbl.h (ieee_long_double_shape_type):
Make sign_exponent element signed.
* sysdeps/ieee754/ldbl-96/math_ldbl.h (ieee_long_double_shape_type):
Fix a typo.
* sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Remove dead
branch.
Index: sysdeps/ia64/fpu/math_ldbl.h
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/ia64/fpu/math_ldbl.h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 math_ldbl.h
--- sysdeps/ia64/fpu/math_ldbl.h 2000/09/30 22:13:03 1.1.1.1
+++ sysdeps/ia64/fpu/math_ldbl.h 2000/12/21 21:36:16
@@ -13,7 +13,7 @@ typedef union
struct
{
unsigned int empty0:32;
- unsigned int sign_exponent:16;
+ int sign_exponent:16;
unsigned int empty1:16;
u_int32_t msw;
u_int32_t lsw;
@@ -31,7 +31,7 @@ typedef union
{
u_int32_t lsw;
u_int32_t msw;
- unsigned int sign_exponent:16;
+ int sign_exponent:16;
unsigned int empty1:16;
unsigned int empty0:32;
} parts;
Index: sysdeps/i386/fpu/s_nextafterl.c
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/i386/fpu/s_nextafterl.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 s_nextafterl.c
--- sysdeps/i386/fpu/s_nextafterl.c 2000/12/21 17:11:34 1.1.1.4
+++ sysdeps/i386/fpu/s_nextafterl.c 2000/12/21 21:36:54
@@ -88,14 +88,10 @@ static char rcsid[] = "$NetBSD: $";
/* x < y, x -= ulp */
if(lx==0) {
if (hx <= 0x80000000) {
- if (esx == 0)
- hx = 0;
- else {
esx -= 1;
hx = hx - 1;
if ((esx&0x7fff) > 0)
hx |= 0x80000000;
- }
} else
hx -= 1;
}
Index: sysdeps/ieee754/ldbl-96/math_ldbl.h
===================================================================
RCS file: /work/cvs/gnu/glibc/sysdeps/ieee754/ldbl-96/math_ldbl.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 math_ldbl.h
--- sysdeps/ieee754/ldbl-96/math_ldbl.h 2000/12/19 23:15:31 1.1.1.2
+++ sysdeps/ieee754/ldbl-96/math_ldbl.h 2000/12/21 21:36:32
@@ -12,8 +12,8 @@ typedef union
long double value;
struct
{
- unsigned int sign_exponent:16;
- int empty:16;
+ int sign_exponent:16;
+ unsigned int empty:16;
u_int32_t msw;
u_int32_t lsw;
} parts;