]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 5 Dec 2000 06:36:53 +0000 (06:36 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 5 Dec 2000 06:36:53 +0000 (06:36 +0000)
* sysdeps/i386/fpu/e_scalb.S: Handle NaN as first parameter correctly.
* sysdeps/i386/fpu/e_scalbf.S: Likewise.
* sysdeps/i386/fpu/e_scalbl.S: Likewise.
* math/w_scalb.c: Don't use matherr except in SVID mode.
* math/w_scalbf.c: Likewise.
* math/w_scalbl.c: Likewise.
* math/test-misc.c: Add test for NaN and scalbl.
Reported by Fred J. Tydeman <tydeman@tybor.com>.

2000-12-04  Ulrich Drepper  <drepper@redhat.com>

ChangeLog
math/test-misc.c
math/w_scalb.c
math/w_scalbf.c
math/w_scalbl.c
sysdeps/i386/fpu/e_scalb.S
sysdeps/i386/fpu/e_scalbf.S
sysdeps/i386/fpu/e_scalbl.S

index 23a2cd9a02740a5b022112607756595ff65baffa..8d399f5b48c3955c1528178c80f40f2332f09672 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-12-04  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/i386/fpu/e_scalb.S: Handle NaN as first parameter correctly.
+       * sysdeps/i386/fpu/e_scalbf.S: Likewise.
+       * sysdeps/i386/fpu/e_scalbl.S: Likewise.
+       * math/w_scalb.c: Don't use matherr except in SVID mode.
+       * math/w_scalbf.c: Likewise.
+       * math/w_scalbl.c: Likewise.
+       * math/test-misc.c: Add test for NaN and scalbl.
+       Reported by Fred J. Tydeman <tydeman@tybor.com>.
+
 2000-12-04  Ulrich Drepper  <drepper@redhat.com>
 
        * configure.in: Define HAVE_ASM_GLOBAL_DOT_NAME for AIX.
index 098695f73fd693155bc7a9bb5bf387152b22f2f8..514035554c03395c419ecb84fde2769c5c402cd4 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <math.h>
 #include <stdio.h>
+#include <string.h>
 
 
 int
@@ -75,6 +76,26 @@ main (void)
       }
   }
 # endif
+
+#if 0
+  {
+    int e;
+    long double r = frexpl (LDBL_MIN * LDBL_EPSILON, &e);
+
+    if (r != 0.5)
+      {
+       printf ("frexpl (LDBL_MIN * LDBL_EPSILON, ...): mantissa wrong: %Lg\n",
+               r);
+       result = 1;
+      }
+    else if (e != -16444)
+      {
+       printf ("frexpl (LDBL_MIN * LDBL_EPSILON, ...): exponent wrong: %d\n",
+               e);
+       result = 1;
+      }
+  }
+#endif
 #endif
 
   {
@@ -120,8 +141,9 @@ main (void)
     }
   if (fpclassify (nextafterl (LDBL_MIN, LDBL_MIN / 2.0)) != FP_SUBNORMAL)
     {
-      printf ("fpclassify (LDBL_MIN-epsilon) failed: %d\n",
-             fpclassify (nextafterl (LDBL_MIN, LDBL_MIN / 2.0)));
+      printf ("fpclassify (LDBL_MIN-epsilon) failed: %d (%Lg)\n",
+             fpclassify (nextafterl (LDBL_MIN, LDBL_MIN / 2.0)),
+             nextafterl (LDBL_MIN, LDBL_MIN / 2.0));
       result = 1;
     }
 #endif
@@ -161,6 +183,29 @@ main (void)
        result = 1;
       }
   }
+
+  /* Special NaNs in x86 long double.  Test for scalbl.  */
+  {
+    union
+    {
+      char b[10];
+      long double d;
+    } u =
+      { .b = { 0, 1, 0, 0, 0, 0, 0, 0xc0, 0xff, 0x7f } };
+    long double r;
+
+    r = scalbl (u.d, 0.0);
+    if (!isnan (r))
+      {
+       puts ("scalbl(NaN, 0) does not return NaN");
+       result = 1;
+      }
+    else if (memcmp (&r, &u.d, sizeof (double)) != 0)
+      {
+       puts ("scalbl(NaN, 0) does not return the same NaN");
+       result = 1;
+      }
+  }
 #endif
 
   return result;
index e5c407a435948d7102ab495ea220ba9126e40c52..c981b858a9f870ec7ef2d254e4150f73e5be6b9e 100644 (file)
@@ -45,7 +45,7 @@ static char rcsid[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
 #else
        double z;
        z = __ieee754_scalb(x,fn);
-       if(_LIB_VERSION == _IEEE_) return z;
+       if(_LIB_VERSION != _SVID_) return z;
        if(!(__finite(z)||__isnan(z))&&__finite(x)) {
            return __kernel_standard(x,(double)fn,32); /* scalb overflow */
        }
index 488a717503489893089ff128e874e872996c8730..51056083e830adfada6072929ec2e7aaa3235438 100644 (file)
@@ -48,7 +48,7 @@ static char rcsid[] = "$NetBSD: w_scalbf.c,v 1.3 1995/05/10 20:49:50 jtc Exp $";
 #else
        float z;
        z = __ieee754_scalbf(x,fn);
-       if(_LIB_VERSION == _IEEE_) return z;
+       if(_LIB_VERSION != _SVID_) return z;
        if(!(__finitef(z)||__isnanf(z))&&__finitef(x)) {
            /* scalbf overflow */
            return (float)__kernel_standard((double)x,(double)fn,132);
index 3ca8d9601d727933bbed2513956d3d23faed23d9..6a7d30710481d58536435b22e69f504b9aeace96 100644 (file)
@@ -49,7 +49,7 @@ static char rcsid[] = "$NetBSD: $";
 #else
        long double z;
        z = __ieee754_scalbl(x,fn);
-       if(_LIB_VERSION == _IEEE_) return z;
+       if(_LIB_VERSION != _SVID_) return z;
        if(!(__finitel(z)||__isnanl(z))&&__finitel(x)) {
            return __kernel_standard(x,(double)fn,232); /* scalb overflow */
        }
index 7ff5541e2f9e0adf6e08588dae0ece7986e029ec..f463002617209cc2ecf098f9ff7fcd49c482b5ce 100644 (file)
@@ -50,7 +50,7 @@ ENTRY(__ieee754_scalb)
        fnstsw
        andl    $0x4500, %eax
        cmpl    $0x0100, %eax
-       je      2f
+       je      3f
        fld     %st(1)
        frndint
        fcomp   %st(2)
@@ -91,4 +91,8 @@ ENTRY(__ieee754_scalb)
 #endif
        fldl    MO(nan)
        ret
+
+       /* The first parameter is a NaN.  Return it.  */
+3:     fstp    %st(1)
+       ret
 END(__ieee754_scalb)
index 4222eecc97037a2ca35e28c98180c7b353170c25..4b5b0d07b379ab714da2e03273e7405c2179a761 100644 (file)
@@ -52,7 +52,7 @@ ENTRY(__ieee754_scalbf)
        fnstsw
        andl    $0x4500, %eax
        cmpl    $0x0100, %eax
-       je      2f
+       je      3f
        fld     %st(1)
        frndint
        fcomp   %st(2)
@@ -93,4 +93,8 @@ ENTRY(__ieee754_scalbf)
 #endif
        fldl    MO(nan)
        ret
+
+       /* The first parameter is a NaN.  Return it.  */
+3:     fstp    %st(1)
+       ret
 END(__ieee754_scalbf)
index 56cc833a56336423cc722afddb52bdb7d348f5aa..e8166fa9d5c262691a6963469f6dbaf4aacd666a 100644 (file)
@@ -52,7 +52,7 @@ ENTRY(__ieee754_scalbl)
        fnstsw
        andl    $0x4500, %eax
        cmpl    $0x0100, %eax
-       je      2f
+       je      3f
        fld     %st(1)
        frndint
        fcomp   %st(2)
@@ -93,4 +93,8 @@ ENTRY(__ieee754_scalbl)
 #endif
        fldl    MO(nan)
        ret
+
+       /* The first parameter is a NaN.  Return it.  */
+3:     fstp    %st(1)
+       ret
 END(__ieee754_scalbl)
This page took 0.052995 seconds and 5 git commands to generate.