]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update. cvs/libc20x-ud-970319
authorUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 1997 02:20:57 +0000 (02:20 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 1997 02:20:57 +0000 (02:20 +0000)
1997-03-20 01:49  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/libm-ieee754/s_tanhl.c (__tanhl): Correct handling of
-inf.

* Makeconfig: (rpath-link): Add math/ directory.
(math-objdir): New variable.
(link-extra-lib): Define to special version when
$(common-objpfx)!=$(objpfx) to allow libraries outside
$(common-objpfx) be linked to the application.

* math/Makefile: Add rules to build and run test programs.
* math/libm-test.c (_GNU_SOURCE): Define only if still undefined.
(check_equal): Correct check for error.
(ceil_test): Fix typo.
(log_test): Fix typo.
(floor_test): Fix typo.
(pow_test): Fix typos.
(log10_test): Allow slight incorrectness for `log10(e)'.
(modf_test): New functions to test `modf' et.al.
(hypot_test): Rewrite test completely.
Patch partly by Andreas Jaeger.
* math/test-double.h (__NO_MATH_INLINES): Define only if not
already defined.
* math/test-float.h: Likewise.
* math/test-logdouble.h: Likewise.

* setjmp/setjmp.h: Change references of ANSI C to ISO C.
* setjmp/tst-setjmp.c: Correct and extend test suite.
* sysdeps/i386/__longjmp.S: Update copyright.
* sysdeps/i386/bsd-_setjmp.S: Correct fatal bug in jump to
`__sigsetjmp' in PIC code.
* sysdeps/i386/bsd-setjmp.S: Likewise.

* sysdeps/libm-i387/e_pow.S: Correct recognition of mantissa
overflow.
* sysdeps/libm-i387/e_powf.S: Likewise.
* sysdeps/libm-i387/s_expm1.S: Handle x == +-0 as a special
case since expm1(-0) == -0.
* sysdeps/libm-i387/s_expm1f.S: Likewise.
* sysdeps/libm-i387/s_expm1l.S: Likewise.
* sysdeps/libm-ieee754/s_modf.c: Optimize code by avoiding unneeded
access to FP number.
* sysdeps/libm-ieee754/s_modff.c: Likewise.
* sysdeps/libm-ieee754/s_modfl.c: Correct former completely bogus
code.  It never worked correctly.
* sysdeps/libm-ieee754/s_tanh.c: Handle x == +-0 as a special
case since tanh(-0) == -0.
* sysdeps/libm-ieee754/s_tanhf.c: Likewise.

1997-03-19 21:13  Ulrich Drepper  <drepper@cygnus.com>

* stdlib/strtod.c (STRTOL): Use wchar_t as type for `decimal' and
`thousands' to support systems with sizeof(wchar_t) !=
sizeof(wint_t).  Blargh.

* sysdeps/unix/sysv/linux/socketbits.h: Remove definition of
SOL_IP, SOL_TCP, SOL_UDP, and SOL_IPX as they are defined in
appropriate headers.

* sysdeps/unix/sysv/linux/writev.c: Don't use MAX_IOVEC.  Test for
UIO_FASTIOV and set to 8 if not available.
* sysdeps/unix/sysv/linux/readv.c: Likewise.
Patch by HJ Lu.

* sysdeps/unix/sysv/linux/xstat.c: Include <kernel_stat.h>, not
"kernel_stat.h".
* sysdeps/unix/sysv/linux/lxstat.c: Likewise.
* sysdeps/unix/sysv/linux/fxstat.c: Likewise.
Reported by fabsoft@fabsoft2.zarm.uni-bremen.de.

32 files changed:
BUGS [new file with mode: 0644]
ChangeLog
Makeconfig
math/Makefile
math/libm-test.c
math/test-double.c
math/test-float.c
math/test-longdouble.c
setjmp/setjmp.h
setjmp/tst-setjmp.c
stdlib/strtod.c
sysdeps/i386/__longjmp.S
sysdeps/i386/bsd-_setjmp.S
sysdeps/i386/bsd-setjmp.S
sysdeps/libm-i387/e_pow.S
sysdeps/libm-i387/e_powf.S
sysdeps/libm-i387/s_expm1.S
sysdeps/libm-i387/s_expm1f.S
sysdeps/libm-i387/s_expm1l.S
sysdeps/libm-ieee754/s_modf.c
sysdeps/libm-ieee754/s_modff.c
sysdeps/libm-ieee754/s_modfl.c
sysdeps/libm-ieee754/s_tanh.c
sysdeps/libm-ieee754/s_tanhf.c
sysdeps/libm-ieee754/s_tanhl.c
sysdeps/unix/bsd/osf/.cvsignore [new file with mode: 0644]
sysdeps/unix/sysv/linux/fxstat.c
sysdeps/unix/sysv/linux/lxstat.c
sysdeps/unix/sysv/linux/readv.c
sysdeps/unix/sysv/linux/socketbits.h
sysdeps/unix/sysv/linux/writev.c
sysdeps/unix/sysv/linux/xstat.c

diff --git a/BUGS b/BUGS
new file mode 100644 (file)
index 0000000..5b839a0
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,39 @@
+           List of known bugs (certainly very incomplete)
+           ----------------------------------------------
+
+Time-stamp: <1997-03-20T02:33:37+0100 drepper>
+
+This following list contains those bugs which I'm aware of.  Please
+make sure that bugs you report are not listed here.  I you can fix one
+of these bugs I'll certainly be glad to receive a patch.
+
+Severity: [  *] to [***]
+
+
+[***]  Profiling currently does not work with programs using NSS.
+
+[***]  At least on Linux/Alpha, there seem to be problems with dynamically
+       loading NSS modules in certain situations.
+       [PR libc/137]
+
+[ **]  For GNU libc on Linux, there is still no solution for the UTMP
+       problem.
+       [Among others: PR libc/39]
+
+[ **]  There are problems with signal handling when using LinuxThreads.
+
+[ **]  The `cbrtl' function is inaccurate.  The algorithm used for `double'
+       and `float' is not usable.
+
+[ **]  Not really a bug, but it could lead to such:
+       The RPC code is ugly ugly ugly.  It's more or less verbatim taken
+       from Sun's code and therefore mostly lacks complete prototypes and
+       (more important) the use of `const'.  It *definitely* needs to be
+       cleaned.
+
+[  *]  The precision of the `sinhl' and/or `asinhl' function do not seem
+       to be the best.
+
+[  *]  The syslog function should print to the console if the LOG_CONS
+       flag was given.
+       [PR libc/72]
index 3346ffbf2f1803566143f47bba13d76ed0343311..87de29fb6f6399845ebc1eb7cfda646dade45184 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,74 @@
+1997-03-20 01:49  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/libm-ieee754/s_tanhl.c (__tanhl): Correct handling of
+       -inf.
+
+       * Makeconfig: (rpath-link): Add math/ directory.
+       (math-objdir): New variable.
+       (link-extra-lib): Define to special version when
+       $(common-objpfx)!=$(objpfx) to allow libraries outside
+       $(common-objpfx) be linked to the application.
+
+       * math/Makefile: Add rules to build and run test programs.
+       * math/libm-test.c (_GNU_SOURCE): Define only if still undefined.
+       (check_equal): Correct check for error.
+       (ceil_test): Fix typo.
+       (log_test): Fix typo.
+       (floor_test): Fix typo.
+       (pow_test): Fix typos.
+       (log10_test): Allow slight incorrectness for `log10(e)'.
+       (modf_test): New functions to test `modf' et.al.
+       (hypot_test): Rewrite test completely.
+       Patch partly by Andreas Jaeger.
+       * math/test-double.h (__NO_MATH_INLINES): Define only if not
+       already defined.
+       * math/test-float.h: Likewise.
+       * math/test-logdouble.h: Likewise.
+
+       * setjmp/setjmp.h: Change references of ANSI C to ISO C.
+       * setjmp/tst-setjmp.c: Correct and extend test suite.
+       * sysdeps/i386/__longjmp.S: Update copyright.
+       * sysdeps/i386/bsd-_setjmp.S: Correct fatal bug in jump to
+       `__sigsetjmp' in PIC code.
+       * sysdeps/i386/bsd-setjmp.S: Likewise.
+
+       * sysdeps/libm-i387/e_pow.S: Correct recognition of mantissa
+       overflow.
+       * sysdeps/libm-i387/e_powf.S: Likewise.
+       * sysdeps/libm-i387/s_expm1.S: Handle x == +-0 as a special
+       case since expm1(-0) == -0.
+       * sysdeps/libm-i387/s_expm1f.S: Likewise.
+       * sysdeps/libm-i387/s_expm1l.S: Likewise.
+       * sysdeps/libm-ieee754/s_modf.c: Optimize code by avoiding unneeded
+       access to FP number.
+       * sysdeps/libm-ieee754/s_modff.c: Likewise.
+       * sysdeps/libm-ieee754/s_modfl.c: Correct former completely bogus
+       code.  It never worked correctly.
+       * sysdeps/libm-ieee754/s_tanh.c: Handle x == +-0 as a special
+       case since tanh(-0) == -0.
+       * sysdeps/libm-ieee754/s_tanhf.c: Likewise.
+
+1997-03-19 21:13  Ulrich Drepper  <drepper@cygnus.com>
+
+       * stdlib/strtod.c (STRTOL): Use wchar_t as type for `decimal' and
+       `thousands' to support systems with sizeof(wchar_t) !=
+       sizeof(wint_t).  Blargh.
+
+       * sysdeps/unix/sysv/linux/socketbits.h: Remove definition of
+       SOL_IP, SOL_TCP, SOL_UDP, and SOL_IPX as they are defined in
+       appropriate headers.
+
+       * sysdeps/unix/sysv/linux/writev.c: Don't use MAX_IOVEC.  Test for
+       UIO_FASTIOV and set to 8 if not available.
+       * sysdeps/unix/sysv/linux/readv.c: Likewise.
+       Patch by HJ Lu.
+
+       * sysdeps/unix/sysv/linux/xstat.c: Include <kernel_stat.h>, not
+       "kernel_stat.h".
+       * sysdeps/unix/sysv/linux/lxstat.c: Likewise.
+       * sysdeps/unix/sysv/linux/fxstat.c: Likewise.
+       Reported by fabsoft@fabsoft2.zarm.uni-bremen.de.
+
 1997-03-19 01:40  Ulrich Drepper  <drepper@cygnus.com>
 
        * sysdeps/unix/sysv/sco3.2.4/Dist: New file.
index cd0e4799a1156125c543da2ef699f8ea7cc568a8..10bca6018a128b243e8fef1f5d08088191367d60 100644 (file)
@@ -347,7 +347,8 @@ else
 default-rpath = $(libdir)
 endif
 # This is how to find at build-time things that will be installed there.
-rpath-link = $(common-objdir):$(elfobjdir):$(nssobjdir)
+rpath-link = $(common-objdir):$(mathobjdir):$(elfobjdir):$(nssobjdir)
+mathobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)math)
 elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
 nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
 else
@@ -356,7 +357,13 @@ endif
 endif
 ifndef link-extra-libs
 ifeq (yes,$(build-shared))
+ifneq ($(common-objpfx),$(objpfx))
+link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),\
+       $(wildcard $(common-objpfx)$(lib).so$($(notdir $(lib)).so-version) \
+                  $(objpfx)$(lib).so$($(notdir $(lib)).so-version)))
+else
 link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).so$($(notdir $(lib)).so-version))
+endif
 else
 link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).a)
 endif
index c4ed312c2b8a9820bb89d54ac7a530692162509e..5b1f090b5fe874e0f6c867fed3e8e9e3256fc078 100644 (file)
@@ -64,6 +64,20 @@ routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts))
 long-c-yes = $(calls:=l)
 distribute += $(long-c-yes:=.c)
 
+# Rules for the test suite.
+tests = test-float test-double $(test-longdouble-$(long-double-fcts))
+# We do the `long double' tests only if this data type is available and
+# distrinct from `double'.
+#
+# XXX This test is disabled for now since the functions are too buggy.
+#test-longdouble-yes = test-longdouble
+
+LDLIBS-test-float = libm
+LDLIBS-test-double = libm
+LDLIBS-test-longdouble = libm
+
+distribute += libm-test.c
+
 
 # The -lieee module sets the _LIB_VERSION_ switch to IEEE mode
 # for error handling in the -lm functions.
index 98e3cbad5db5ae9b1ed58d067ae99e222c49733b..a0482df75844307b7d894e000322ddab08518fd3 100644 (file)
@@ -41,9 +41,9 @@
 /* This program isn't finished yet.
    It has tests for acos, acosh, asin, asinh, atan, atan2, atanh,
    cbrt, ceil, cos, cosh, exp, exp2, expm1, fabs, floor, fpclassify,
-   frexp, ldexp,
-   log, log10, log1p, log2, logb,
-   pow, sin, sinh, tan, tanh, fabs, hypot.
+   frexp, hypot, ldexp,
+   log, log10, log1p, log2, logb, modf,
+   pow, sin, sinh, tan, tanh.
    Tests for the other libm-functions will come later.
 
    The routines using random variables are still under construction. I don't
@@ -66,7 +66,9 @@
    log2.  */
 #undef ISO_9X_IMPLEMENTED
 
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
 
 #include <math.h>
 #include <float.h>
@@ -192,7 +194,7 @@ check_equal (MATHTYPE computed, MATHTYPE supplied, MATHTYPE eps, MATHTYPE * diff
 
   *diff = FUNC(fabs) (computed - supplied);
 
-  if (*diff <= eps || signbit (computed) != signbit (supplied))
+  if (*diff <= eps && (signbit (computed) == signbit (supplied) || eps != 0.0))
     return 1;
 
   return 0;
@@ -211,7 +213,7 @@ output_result_bool (const char *test_name, int result)
     {
       if (verbose)
        printf ("Fail: %s\n", test_name);
-      noErrors++;
+      ++noErrors;
     }
 
   fpstack_test (test_name);
@@ -592,7 +594,7 @@ ceil_test (void)
   check_isinfn ("ceil (-inf) == -inf", FUNC(ceil) (minus_infty));
 
   check ("ceil (pi) == 4", FUNC(ceil) (M_PI), 4.0);
-  check ("ceil (-pi) == -3", FUNC(ceil) (-M_PI), 3.0);
+  check ("ceil (-pi) == -3", FUNC(ceil) (-M_PI), -3.0);
 }
 
 
@@ -802,7 +804,7 @@ log_test (void)
   check_isinfp ("log (+inf) == +inf", FUNC(log) (plus_infty));
 
   check_eps ("log (e) == 1", FUNC(log) (M_E), 1, CHOOSE (0, 0, 9e-8L));
-  check ("log (1/e) == -1", FUNC(log) (1.0 / M_E), 1);
+  check ("log (1/e) == -1", FUNC(log) (1.0 / M_E), -1);
   check ("log (2) == M_LN2", FUNC(log) (2), M_LN2);
   check ("log (10) == M_LN10", FUNC(log) (10), M_LN10);
 }
@@ -828,7 +830,7 @@ log10_test (void)
   check ("log10 (100) == 2", FUNC(log10) (100.0), 2);
   check ("log10 (10000) == 4", FUNC(log10) (10000.0), 4);
   check_eps ("log10 (e) == M_LOG10E", FUNC(log10) (M_E), M_LOG10E,
-            CHOOSE (0, 0, 9e-8));
+            CHOOSE (9e-20, 0, 9e-8));
 }
 
 
@@ -895,6 +897,42 @@ logb_test (void)
 }
 
 
+static void
+modf_test (void)
+{
+  MATHTYPE result, intpart;
+
+  result = FUNC(modf) (plus_infty, &intpart);
+  check ("modf (+inf, &x) returns +0", result, 0);
+  check_isinfp ("modf (+inf, &x) set x to +inf", intpart);
+
+  result = FUNC(modf) (minus_infty, &intpart);
+  check ("modf (-inf, &x) returns -0", result, minus_zero);
+  check_isinfn ("modf (-inf, &x) sets x to -inf", intpart);
+
+  result = FUNC(modf) (nan_value, &intpart);
+  check_isnan ("modf (NaN, &x) returns NaN", result);
+  check_isnan ("modf (-inf, &x) sets x to NaN", intpart);
+
+  result = FUNC(modf) (0, &intpart);
+  check ("modf (0, &x) returns 0", result, 0);
+  check ("modf (0, &x) sets x to 0", intpart, 0);
+
+  result = FUNC(modf) (minus_zero, &intpart);
+  check ("modf (-0, &x) returns -0", result, minus_zero);
+  check ("modf (-0, &x) sets x to -0", intpart, minus_zero);
+
+  result = FUNC(modf) (2.5, &intpart);
+  check ("modf (2.5, &x) returns 0.5", result, 0.5);
+  check ("modf (2.5, &x) sets x to 2", intpart, 2);
+
+  result = FUNC(modf) (-2.5, &intpart);
+  check ("modf (-2.5, &x) returns -0.5", result, -0.5);
+  check ("modf (-2.5, &x) sets x to -2", intpart, -2);
+
+}
+
+
 static void
 sin_test (void)
 {
@@ -971,58 +1009,33 @@ floor_test (void)
   check_isinfn ("floor (-inf) == -inf", FUNC(floor) (minus_infty));
 
   check ("floor (pi) == 3", FUNC(floor) (M_PI), 3.0);
-  check ("floor (-pi) == -4", FUNC(floor) (-M_PI), 4.0);
+  check ("floor (-pi) == -4", FUNC(floor) (-M_PI), -4.0);
 }
 
 
 static void
-hypot_report (const char *test_name, MATHTYPE computed, MATHTYPE expected)
+hypot_test (void)
 {
-  MATHTYPE diff;
-  int result;
-
-  result = check_equal (computed, expected, 0, &diff);
-
-  if (result)
-    {
-      if (verbose > 2)
-       printf ("Pass: %s\n", test_name);
-    }
-  else
-    {
-      if (verbose)
-       printf ("Fail: %s\n", test_name);
-      if (verbose > 1)
-       {
-         printf ("Result:\n");
-         printf (" is:         %.20" PRINTF_EXPR, computed);
-         printf (" should be:  %.20" PRINTF_EXPR, expected);
-         printf (" difference: %.20" PRINTF_EXPR "\n", diff);
-       }
-      noErrors++;
-    }
-  fpstack_test (test_name);
-  output_result (test_name, result,
-                computed, expected, diff, PRINT, PRINT);
-}
+  MATHTYPE a;
 
+  a = random_greater (0);
+  check_isinfp_ext ("hypot (+inf, x) == +inf", FUNC(hypot) (plus_infty, a), a);
+  check_isinfp_ext ("hypot (-inf, x) == +inf", FUNC(hypot) (minus_infty, a), a);
 
-static void
-hypot_test (void)
-{
-  MATHTYPE a = FUNC(hypot) (12.4L, 0.7L);
+  check_isnan ("hypot (NaN, NaN) == NaN", FUNC(hypot) (nan_value, nan_value));
 
-  hypot_report ("hypot (x,y) == hypot (y,x)", FUNC(hypot) (0.7L, 12.4L), a);
-  hypot_report ("hypot (x,y) == hypot (-x,y)", FUNC(hypot) (-12.4L, 0.7L), a);
-  hypot_report ("hypot (x,y) == hypot (-y,x)", FUNC(hypot) (-0.7L, 12.4L), a);
-  hypot_report ("hypot (x,y) == hypot (-x,-y)", FUNC(hypot) (-12.4L, -0.7L), a);
-  hypot_report ("hypot (x,y) == hypot (-y,-x)", FUNC(hypot) (-0.7L, -12.4L), a);
+  a = FUNC(hypot) (12.4L, 0.7L);
+  check ("hypot (x,y) == hypot (y,x)", FUNC(hypot) (0.7L, 12.4L), a);
+  check ("hypot (x,y) == hypot (-x,y)", FUNC(hypot) (-12.4L, 0.7L), a);
+  check ("hypot (x,y) == hypot (-y,x)", FUNC(hypot) (-0.7L, 12.4L), a);
+  check ("hypot (x,y) == hypot (-x,-y)", FUNC(hypot) (-12.4L, -0.7L), a);
+  check ("hypot (x,y) == hypot (-y,-x)", FUNC(hypot) (-0.7L, -12.4L), a);
   check ("hypot (x,0) == fabs (x)", FUNC(hypot) (-0.7L, 0), 0.7L);
   check ("hypot (x,0) == fabs (x)", FUNC(hypot) (0.7L, 0), 0.7L);
   check ("hypot (x,0) == fabs (x)", FUNC(hypot) (-1.0L, 0), 1.0L);
-  check ("hypot (x,0) == fabs (x)", FUNC(hypot) (-1.0L, 0), 1.0L);
-  check ("hypot (x,0) == fabs (x)", FUNC(hypot) (-5.7e7L, 0), 5.7e7L);
+  check ("hypot (x,0) == fabs (x)", FUNC(hypot) (1.0L, 0), 1.0L);
   check ("hypot (x,0) == fabs (x)", FUNC(hypot) (-5.7e7L, 0), 5.7e7L);
+  check ("hypot (x,0) == fabs (x)", FUNC(hypot) (5.7e7L, 0), 5.7e7L);
 }
 
 
@@ -1084,9 +1097,9 @@ pow_test (void)
   check_isinfp ("pow (-inf, 11.1) == +inf", FUNC(pow) (minus_infty, 11.1));
   check_isinfp ("pow (-inf, 1001.1) == +inf", FUNC(pow) (minus_infty, 1001.1));
 
-  check ("pow (-inf, -1) == -0", FUNC(pow) (-minus_infty, -1), minus_zero);
-  check ("pow (-inf, -11) == -0", FUNC(pow) (-minus_infty, -11), minus_zero);
-  check ("pow (-inf, -1001) == -0", FUNC(pow) (-minus_infty, -1001), minus_zero);
+  check ("pow (-inf, -1) == -0", FUNC(pow) (minus_infty, -1), minus_zero);
+  check ("pow (-inf, -11) == -0", FUNC(pow) (minus_infty, -11), minus_zero);
+  check ("pow (-inf, -1001) == -0", FUNC(pow) (minus_infty, -1001), minus_zero);
 
   check ("pow (-inf, -2) == +0", FUNC(pow) (minus_infty, -2), 0);
   check ("pow (-inf, -12) == +0", FUNC(pow) (minus_infty, -12), 0);
@@ -1189,8 +1202,8 @@ pow_test (void)
             FUNC(pow) (minus_infty, x), minus_zero, x);
 
   x = ((rand () % 1000000) + 1) * -2.0;        /* Get random even integer < 0 */
-  check_ext ("pow (-inf, y) == -0 for y < 0 and not an odd integer",
-            FUNC(pow) (minus_infty, x), minus_zero, x);
+  check_ext ("pow (-inf, y) == 0 for y < 0 and not an odd integer",
+            FUNC(pow) (minus_infty, x), 0.0, x);
 
   x = (rand () % 1000000) * 2.0 + 1;   /* Get random odd integer > 0 */
   check_ext ("pow (+0, y) == +0 for y an odd integer > 0",
@@ -1497,6 +1510,7 @@ main (int argc, char *argv[])
   log2_test ();
 #endif
   logb_test ();
+  modf_test ();
   sin_test ();
   sinh_test ();
   tan_test ();
index 5f562a098f879991c8d08fc6cddf25a318bc0551..1f4ff8e0d036e40b53613de14ab96a8bd3795cc4 100644 (file)
@@ -24,6 +24,8 @@
 #define CHOOSE(Clongdouble,Cdouble,Cfloat) Cdouble
 #define PRINTF_EXPR "e"
 
-#define __NO_MATH_INLINES
+#ifndef __NO_MATH_INLINES
+# define __NO_MATH_INLINES
+#endif
 
 #include "libm-test.c"
index fa9f2bcd9c01d132b8454c5a6c4fcbf084ee5ddc..de918a38860ffd68fce91f96ab21c05f4de5f938 100644 (file)
@@ -24,6 +24,8 @@
 #define CHOOSE(Clongdouble,Cdouble,Cfloat) Cfloat
 #define PRINTF_EXPR "e"
 
-#define __NO_MATH_INLINES
+#ifndef __NO_MATH_INLINES
+# define __NO_MATH_INLINES
+#endif
 
 #include "libm-test.c"
index 9eebe5a5e9844d8bc2befabac990347ca1f6baf3..eb9b57ae9603d2e4d7e0fbcbfc79deee3fc43954 100644 (file)
@@ -24,6 +24,8 @@
 #define CHOOSE(Clongdouble,Cdouble,Cfloat) Clongdouble
 #define PRINTF_EXPR "Le"
 
-#define __NO_MATH_INLINES
+#ifndef __NO_MATH_INLINES
+# define __NO_MATH_INLINES
+#endif
 
 #include "libm-test.c"
index 75abb18c6dcf73a807fe9b3a04e388bc070ae2e7..eb4305f5bdd4c0cad2554b984fcaf94280bb560c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -51,7 +51,7 @@ extern int __sigsetjmp __P ((jmp_buf __env, int __savemask));
 #ifndef        __FAVOR_BSD
 /* Set ENV to the current position and return 0, not saving the signal mask.
    This is just like `sigsetjmp (ENV, 0)'.
-   The ANSI C standard says `setjmp' is a macro.  */
+   The ISO C standard says `setjmp' is a macro.  */
 #define        setjmp(env)     __sigsetjmp ((env), 0)
 #else
 /* We are in 4.3 BSD-compatibility mode in which `setjmp'
@@ -61,7 +61,7 @@ extern int __sigsetjmp __P ((jmp_buf __env, int __savemask));
 
 #ifdef __USE_BSD
 /* Set ENV to the current position and return 0, not saving the signal mask.
-   This is the 4.3 BSD name for ANSI `setjmp'.  */
+   This is the 4.3 BSD name for ISO `setjmp'.  */
 #define _setjmp(env)   __sigsetjmp ((env), 0)
 #endif
 
index 6147ae95674d536860ad6a39afcc3c5a37ad742c..b4cba1177df493269f5f794fa467049b1f418847 100644 (file)
@@ -54,8 +54,14 @@ main (void)
 
   if (!lose && value == 10)
     {
-      /* Do a second test, this time without `setjmp' being a macro.  */
+      /* Do a second test, this time without `setjmp' being a macro.
+         This is not required by ISO C but we have this for compatibility.  */
 #undef setjmp
+      extern int setjmp (jmp_buf);
+
+      last_value = -1;
+      lose = 0;
+
       value = setjmp (env);
       if (value != last_value + 1)
        {
@@ -75,6 +81,33 @@ main (void)
        }
     }
 
+  if (!lose && value == 10)
+    {
+      /* And again for the `__setjmp' function.  */
+      extern int __setjmp (jmp_buf);
+
+      last_value = -1;
+      lose = 0;
+
+      value = __setjmp (env);
+      if (value != last_value + 1)
+       {
+         fputs("Shouldn't have ", stdout);
+         lose = 1;
+       }
+      last_value = value;
+      switch (value)
+       {
+       case 0:
+         puts("Saved environment.");
+         jump (0);
+       default:
+         printf ("Jumped to %d.\n", value);
+         if (value < 10)
+           jump (value + 1);
+       }
+    }
+
   if (lose || value != 10)
     puts ("Test FAILED!");
   else
index 5d892b94cb2761c66b0c66f6ad6ff30aed6130ad..cff75bd4ad380dc24eec13039cafad07a48903ce 100644 (file)
@@ -383,15 +383,13 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   typedef unsigned int wint_t;
 #endif
   /* The radix character of the current locale.  */
-  wint_t decimal;
+  wchar_t decimal;
   /* The thousands character of the current locale.  */
-  wint_t thousands;
+  wchar_t thousands;
   /* The numeric grouping specification of the current locale,
      in the format described in <locale.h>.  */
   const char *grouping;
 
-  assert (sizeof (wchar_t) == sizeof (wint_t));
-
   if (group)
     {
       grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
@@ -400,10 +398,9 @@ INTERNAL (STRTOF) (nptr, endptr, group)
       else
        {
          /* Figure out the thousands separator character.  */
-         if (mbtowc ((wchar_t *) &thousands,
-                     _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP),
+         if (mbtowc (&thousands, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP),
                      strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0)
-           thousands = (wint_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
+           thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
          if (thousands == L'\0')
            grouping = NULL;
        }
@@ -417,7 +414,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   /* Find the locale's decimal point character.  */
   if (mbtowc ((wchar_t *) &decimal, _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT),
              strlen (_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT))) <= 0)
-    decimal = (wint_t) *_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
+    decimal = (wchar_t) *_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
   assert (decimal != L'\0');
 
   /* Prepare number representation.  */
@@ -445,7 +442,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   /* Return 0.0 if no legal string is found.
      No character is used even if a sign was found.  */
   if ((c < L_('0') || c > L_('9'))
-      && ((wint_t) c != decimal || cp[1] < L_('0') || cp[1] > L_('9')))
+      && ((wchar_t) c != decimal || cp[1] < L_('0') || cp[1] > L_('9')))
     {
       int matched = 0;
       /* Check for `INF' or `INFINITY'.  */
@@ -511,14 +508,14 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   start_of_digits = startp = cp;
 
   /* Ignore leading zeroes.  This helps us to avoid useless computations.  */
-  while (c == L_('0') || (thousands != L'\0' && (wint_t) c == thousands))
+  while (c == L_('0') || (thousands != L'\0' && (wchar_t) c == thousands))
     c = *++cp;
 
   /* If no other digit but a '0' is found the result is 0.0.
      Return current read pointer.  */
   if ((c < L_('0') || c > L_('9')) &&
       (base == 16 && (c < TOLOWER (L_('a')) || c > TOLOWER (L_('f')))) &&
-      (wint_t) c != decimal &&
+      (wchar_t) c != decimal &&
       (base == 16 && (cp == start_of_digits || TOLOWER (c) != L_('p'))) &&
       (base != 16 && TOLOWER (c) != L_('e')))
     {
@@ -540,7 +537,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
       if ((c >= L_('0') && c <= L_('9'))
          || (base == 16 && TOLOWER (c) >= L_('a') && TOLOWER (c) <= L_('f')))
        ++dig_no;
-      else if (thousands == L'\0' || (wint_t) c != thousands)
+      else if (thousands == L'\0' || (wchar_t) c != thousands)
        /* Not a digit or separator: end of the integer part.  */
        break;
       c = *++cp;
@@ -590,7 +587,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
 
   /* Read the fractional digits.  A special case are the 'american style'
      numbers like `16.' i.e. with decimal but without trailing digits.  */
-  if ((wint_t) c == decimal)
+  if ((wchar_t) c == decimal)
     {
       c = *++cp;
       while (c >= L_('0') && c <= L_('9') ||
@@ -693,7 +690,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
   if (lead_zero)
     {
       /* Find the decimal point */
-      while ((wint_t) *startp != decimal)
+      while ((wchar_t) *startp != decimal)
        ++startp;
       startp += lead_zero + 1;
       exponent -= base == 16 ? 4 * lead_zero : lead_zero;
index cb33a89de15961c1309ae0b8233aead861e40338..f6331d496d545dc66540663e5a830ce0d6bd41d2 100644 (file)
@@ -1,21 +1,21 @@
 /* longjmp for i386.
-Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <sysdep.h>
 #define _ASM
index a7ee5dbc1e20630742c774cec8805cd790f71191..47972b28d1517df9215370001b72b23990c0c9c4 100644 (file)
@@ -1,21 +1,21 @@
 /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  i386 version.
-Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+   Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
    We cannot do it in C because it must be a tail-call, so frame-unwinding
@@ -29,5 +29,17 @@ ENTRY (_setjmp)
        pushl $0                /* Push second argument of zero.  */
        pushl %ecx              /* Push back first argument.  */
        pushl %eax              /* Push back return PC.  */
-       jmp JUMPTARGET (C_SYMBOL_NAME (__sigsetjmp))
+#ifdef PIC
+       /* We cannot use the PLT, because it requires that %ebx be set, but
+           we can't save and restore our caller's value.  Instead, we do an
+           indirect jump through the GOT, using for the temporary register
+           %ecx, which is call-clobbered.  */
+       call here
+here:  popl %ecx
+       addl $_GLOBAL_OFFSET_TABLE_+[.-here], %ecx
+       movl C_SYMBOL_NAME(__sigsetjmp@GOT)(%ecx), %ecx
+       jmp *%ecx
+#else
+       jmp __sigsetjmp
+#endif
 END (_setjmp)
index 239a8c41f2f8e803ef72b8fe4ed2b2ea2b91d9a1..411eaf1eb24fe304a10ee2058d20336af434899b 100644 (file)
@@ -1,21 +1,21 @@
 /* BSD `setjmp' entry point to `sigsetjmp (..., 1)'.  i386 version.
-Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+   Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 /* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
    We cannot do it in C because it must be a tail-call, so frame-unwinding
@@ -29,5 +29,17 @@ ENTRY (setjmp)
        pushl $1                /* Push second argument of one.  */
        pushl %ecx              /* Push back first argument.  */
        pushl %eax              /* Push back return PC.  */
-       jmp JUMPTARGET (C_SYMBOL_NAME (__sigsetjmp))
+#ifdef PIC
+       /* We cannot use the PLT, because it requires that %ebx be set, but
+           we can't save and restore our caller's value.  Instead, we do an
+           indirect jump through the GOT, using for the temporary register
+           %ecx, which is call-clobbered.  */
+       call here
+here:  popl %ecx
+       addl $_GLOBAL_OFFSET_TABLE_+[.-here], %ecx
+       movl C_SYMBOL_NAME(__sigsetjmp@GOT)(%ecx), %ecx
+       jmp *%ecx
+#else
+       jmp __sigsetjmp
+#endif
 END (setjmp)
index ab6b454339659dc7b8ff04c58f9fe63530e02890..e665326438fcbadb8726e8d251184008809d85af 100644 (file)
@@ -308,7 +308,7 @@ ENTRY(__ieee754_pow)
        andb    $1, %al
        jz      24f             // jump if not odd
        cmpl    $0xffe00000, %edx
-       jbe     24f             // does not fit in mantissa bits
+       jae     24f             // does not fit in mantissa bits
        // It's an odd integer.
        fldl    MO(mzero)
        ret
index 48316464ef0580afa6f5d420f0fcae2a9ccb6b68..102cd4e3af9d76041cac4bb2e397b35be074f7d4 100644 (file)
@@ -300,7 +300,7 @@ ENTRY(__ieee754_powf)
        testb   $1, %dl
        jz      24f             // jump if not odd
        cmpl    $0xff000000, %edx
-       jbe     24f             // does not fit in mantissa bits
+       jae     24f             // does not fit in mantissa bits
        // It's an odd integer.
        fldl    MO(mzero)
        ret
index e1b198d604e3278ba9d4972c44ba3c7d5563318d..92beaf0776e408faf03586b588f510a8e27c38b8 100644 (file)
@@ -51,15 +51,17 @@ ENTRY(__expm1)
        fldl    4(%esp)         // x
        fxam                    // Is NaN or +-Inf?
        fstsw   %ax
+       movb    $0x45, %ch
+       andb    %ah, %ch
+       cmpb    $0x40, %ch
+       je      3f              // If +-0, jump.
 #ifdef PIC
        call    1f
 1:     popl    %edx
        addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
 #endif
-       movb    $0x45, %ch
-       andb    %ah, %ch
        cmpb    $0x05, %ch
-       je      2f              // Is +-Inf, jump.
+       je      2f              // If +-Inf, jump.
 
        fldt    MO(l2e)         // log2(e) : x
        fmulp                   // log2(e)*x
index 8626fee45db96d8f2e82433117f3dd4bb4d4bb27..45a60fe010e9b8ea1b61b328f11bf8d38f444905 100644 (file)
@@ -51,15 +51,17 @@ ENTRY(__expm1f)
        flds    4(%esp)         // x
        fxam                    // Is NaN or +-Inf?
        fstsw   %ax
+       movb    $0x45, %ch
+       andb    %ah, %ch
+       cmpb    $0x40, %ch
+       je      3f              // If +-0, jump.
 #ifdef PIC
        call    1f
 1:     popl    %edx
        addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
 #endif
-       movb    $0x45, %ch
-       andb    %ah, %ch
        cmpb    $0x05, %ch
-       je      2f              // Is +-Inf, jump.
+       je      2f              // If +-Inf, jump.
 
        fldt    MO(l2e)         // log2(e) : x
        fmulp                   // log2(e)*x
index 46290ca4a9eb22836d5a4938a8433b64adf3cdbc..13fa698cc79d0ab4b6ff10be4d1e6f521ce94e70 100644 (file)
@@ -51,15 +51,17 @@ ENTRY(__expm1l)
        fldt    4(%esp)         // x
        fxam                    // Is NaN or +-Inf?
        fstsw   %ax
+       movb    $0x45, %ch
+       andb    %ah, %ch
+       cmpb    $0x40, %ch
+       je      3f              // If +-0, jump.
 #ifdef PIC
        call    1f
 1:     popl    %edx
        addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
 #endif
-       movb    $0x45, %ch
-       andb    %ah, %ch
        cmpb    $0x05, %ch
-       je      2f              // Is +-Inf, jump.
+       je      2f              // If +-Inf, jump.
 
        fldt    MO(l2e)         // log2(e) : x
        fmulp                   // log2(e)*x
index 8075c5f81336d6de383d16da8e7879248af4586d..888d4f416db954598c9a2fc46b19677ca3d92f26 100644 (file)
@@ -51,10 +51,8 @@ static double one = 1.0;
            } else {
                i = (0x000fffff)>>j0;
                if(((i0&i)|i1)==0) {            /* x is integral */
-                   u_int32_t high;
                    *iptr = x;
-                   GET_HIGH_WORD(high,x);
-                   INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */
+                   INSERT_WORDS(x,i0&0x80000000,0);    /* return +-0 */
                    return x;
                } else {
                    INSERT_WORDS(*iptr,i0&(~i),0);
@@ -64,8 +62,10 @@ static double one = 1.0;
        } else if (j0>51) {             /* no fraction part */
            u_int32_t high;
            *iptr = x*one;
-           GET_HIGH_WORD(high,x);
-           INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */
+           /* We must handle NaNs separately.  */
+           if (j0 == 0x400 && ((i0 & 0xfffff) | i1))
+             return x*one;
+           INSERT_WORDS(x,i0&0x80000000,0);    /* return +-0 */
            return x;
        } else {                        /* fraction part in low x */
            i = ((u_int32_t)(0xffffffff))>>(j0-20);
index 85f22c10e59b2f0da65b7f3f04430ce707e98172..60f7f1ec29601633526ce29d400da8c998951b37 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -57,8 +57,10 @@ static float one = 1.0;
        } else {                        /* no fraction part */
            u_int32_t ix;
            *iptr = x*one;
-           GET_FLOAT_WORD(ix,x);
-           SET_FLOAT_WORD(x,ix&0x80000000);    /* return +-0 */
+           /* We must handle NaNs separately.  */
+           if (j0 == 0x80 && (i0 & 0x7fffff))
+             return x*one;
+           SET_FLOAT_WORD(x,i0&0x80000000);    /* return +-0 */
            return x;
        }
 }
index 433c936240283e2d31c36a07b1197b80e261d6d8..324fe9fde62b5f44cd0ea12787e76dbf01e2aeb4 100644 (file)
@@ -55,32 +55,29 @@ static long double one = 1.0;
            } else {
                i = (0xffffffff)>>j0;
                if(((i0&i)|i1)==0) {            /* x is integral */
-                   u_int32_t high;
                    *iptr = x;
-                   GET_HIGH_WORD(high,x);
-                   INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */
+                   SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
                    return x;
                } else {
-                   INSERT_WORDS(*iptr,i0&(~i),0);
+                   SET_LDOUBLE_WORDS(*iptr,se,i0&(~i),0);
                    return x - *iptr;
                }
            }
        } else if (j0>63) {             /* no fraction part */
-           u_int32_t high;
            *iptr = x*one;
-           GET_HIGH_WORD(high,x);
-           INSERT_WORDS(x,high&0x80000000,0);  /* return +-0 */
+           /* We must handle NaNs separately.  */
+           if (j0 == 0x4000 && ((i0 & 0x7fffffff) | i1))
+             return x*one;
+           SET_LDOUBLE_WORDS(x,se&0x8000,0,0); /* return +-0 */
            return x;
        } else {                        /* fraction part in low x */
            i = ((u_int32_t)(0xffffffff))>>(j0-20);
            if((i1&i)==0) {             /* x is integral */
-               u_int32_t high;
                *iptr = x;
-               GET_HIGH_WORD(high,x);
-               INSERT_WORDS(x,high&0x80000000,0);      /* return +-0 */
+               INSERT_WORDS(x,se&0x8000,0);    /* return +-0 */
                return x;
            } else {
-               INSERT_WORDS(*iptr,i0,i1&(~i));
+               SET_LDOUBLE_WORDS(*iptr,se,i0,i1&(~i));
                return x - *iptr;
            }
        }
index 208b459b356bbdda6b7b65bebe39da7906a3b016..944f96386f93cbdbcaa9da701686ada4c010b58e 100644 (file)
@@ -55,10 +55,10 @@ static double one=1.0, two=2.0, tiny = 1.0e-300;
 #endif
 {
        double t,z;
-       int32_t jx,ix;
+       int32_t jx,ix,lx;
 
     /* High word of |x|. */
-       GET_HIGH_WORD(jx,x);
+       EXTRACT_WORDS(jx,lx,x);
        ix = jx&0x7fffffff;
 
     /* x is INF or NaN */
@@ -69,6 +69,8 @@ static double one=1.0, two=2.0, tiny = 1.0e-300;
 
     /* |x| < 22 */
        if (ix < 0x40360000) {          /* |x|<22 */
+           if ((ix | lx) == 0)
+               return x;               /* x == +-0 */
            if (ix<0x3c800000)          /* |x|<2**-55 */
                return x*(one+x);       /* tanh(small) = small */
            if (ix>=0x3ff00000) {       /* |x|>=1  */
index b989ef3565b208ff5f45ef101c27b82c7a06e8ea..2a0ca9f3dfc6d708367b87c60038e4fc31d698fc 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -40,13 +40,15 @@ static float one=1.0, two=2.0, tiny = 1.0e-30;
        ix = jx&0x7fffffff;
 
     /* x is INF or NaN */
-       if(ix>=0x7f800000) { 
+       if(ix>=0x7f800000) {
            if (jx>=0) return one/x+one;    /* tanh(+-inf)=+-1 */
            else       return one/x-one;    /* tanh(NaN) = NaN */
        }
 
     /* |x| < 22 */
        if (ix < 0x41b00000) {          /* |x|<22 */
+           if (ix == 0)
+               return x;               /* x == +-0 */
            if (ix<0x24000000)          /* |x|<2**-55 */
                return x*(one+x);       /* tanh(small) = small */
            if (ix>=0x3f800000) {       /* |x|>=1  */
index f7ea3f4216660d8da533bcde5d3c162c9aca68eb..1e3dc3b61304364bf26f9a1bf56ab360074c3da7 100644 (file)
@@ -68,12 +68,15 @@ static long double one=1.0, two=2.0, tiny = 1.0e-4900L;
 
     /* x is INF or NaN */
        if(ix==0x7fff) {
-           if (se>=0x7fff) return one/x+one;    /* tanhl(+-inf)=+-1 */
-           else            return one/x-one;    /* tanhl(NaN) = NaN */
+           /* for NaN it's not important which branch: tanhl(NaN) = NaN */
+           if (se&0x8000) return one/x-one;    /* tanhl(-inf)= -1; */
+           else           return one/x+one;    /* tanhl(+inf)=+1 */
        }
 
     /* |x| < 23 */
        if (ix < 0x4003 || (ix == 0x4003 && j0 < 0xb8000000u)) {/* |x|<23 */
+           if ((ix|j0|j1) == 0)
+               return x;               /* x == +- 0 */
            if (ix<0x3fc8)              /* |x|<2**-55 */
                return x*(one+x);       /* tanh(small) = small */
            if (ix>=0x3fff) {   /* |x|>=1  */
diff --git a/sysdeps/unix/bsd/osf/.cvsignore b/sysdeps/unix/bsd/osf/.cvsignore
new file mode 100644 (file)
index 0000000..c9147fd
--- /dev/null
@@ -0,0 +1 @@
+=*
index 103218711bf37378dc5e23581f26d3fe2d8d5acd..5aa02dcac85504b41559ab8d61dd868b8ef009b4 100644 (file)
@@ -21,7 +21,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 
-#include "kernel_stat.h"
+#include <kernel_stat.h>
 
 extern int __syscall_fstat (int, struct kernel_stat *);
 
index 713490cf661b318ea14da9ab432ae4416c22108f..11c903864662c83d12c29902e5252ecaf1fcf9ad 100644 (file)
@@ -21,7 +21,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 
-#include "kernel_stat.h"
+#include <kernel_stat.h>
 
 extern int __syscall_lstat (const char *, struct kernel_stat *);
 
index 458e8ffb38e36749d3b4133fec3e7e14ab8b989a..c8ff55ab45617f7647726ff3571879eab86e707a 100644 (file)
@@ -26,15 +26,12 @@ extern ssize_t __syscall_readv __P ((int, __const struct iovec *, int));
 
 
 /* Not all versions of the kernel support the large number of records.  */
-#undef MAX_IOVEC
-#ifdef UIO_FASTIOV
-# define MAX_IOVEC     UIO_FASTIOV
-#else
-# define MAX_IOVEC     8       /* 8 is a safe number. */
+#ifndef UIO_FASTIOV
+# define UIO_FASTIOV   8       /* 8 is a safe number.  */
 #endif
 
 
-/* We should deal with kernel which have a smaller UIO_MAXIOV as well
+/* We should deal with kernel which have a smaller UIO_FASTIOV as well
    as a very big count.  */
 ssize_t
 readv (fd, vector, count)
@@ -47,7 +44,7 @@ readv (fd, vector, count)
 
   bytes_read = __syscall_readv (fd, vector, count);
 
-  if (bytes_read < 0 && errno == EINVAL && count > MAX_IOVEC)
+  if (bytes_read < 0 && errno == EINVAL && count > UIO_FASTIOV)
     {
       int i;
 
@@ -55,10 +52,10 @@ readv (fd, vector, count)
       __set_errno (errno_saved);
 
       bytes_read = 0;
-      for (i = 0; i < count; i += MAX_IOVEC)
+      for (i = 0; i < count; i += UIO_FASTIOV)
        {
          ssize_t bytes = __syscall_readv (fd, vector + i,
-                                          MIN (count - i, MAX_IOVEC));
+                                          MIN (count - i, UIO_FASTIOV));
 
          if (bytes < 0)
            return bytes;
index 166971a384cd4287aa622e50213097182d15ade9..101afc268c75b71f6ec10c8b9bdbffec497f3f7b 100644 (file)
@@ -83,14 +83,13 @@ enum __socket_type
 #define        AF_INET6        PF_INET6
 #define        AF_MAX          PF_MAX
 
-/* Socket level values.  */
-#define SOL_IP          0
-#define SOL_TCP         6
-#define SOL_UDP         17
+/* Socket level values.  Others are defined in the appropriate headers.
+
+   XXX These definitions also should go into the appropriate headers as
+   far as they are available.  */
 #define SOL_IPV6        41
 #define SOL_ICMPV6      58
 #define SOL_RAW                255
-#define SOL_IPX         256
 #define SOL_AX25        257
 #define SOL_ATALK       258
 #define SOL_NETROM      259
index 11afd81d2e1d5f95eb7855df8fb7c3dee11a037d..d147186b515972fd8bc43230ab370e73f641382a 100644 (file)
 extern ssize_t __syscall_writev __P ((int, const struct iovec *, int));
 
 /* Not all versions of the kernel support the large number of records.  */
-#undef MAX_IOVEC
-#ifdef UIO_FASTIOV
-# define MAX_IOVEC     UIO_FASTIOV
-#else
-# define MAX_IOVEC     8       /* 8 is a safe number. */
+#ifndef UIO_FASTIOV
+# define UIO_FASTIOV   8       /* 8 is a safe number.  */
 #endif
 
 
-/* We should deal with kernel which have a smaller UIO_MAXIOV as well
+/* We should deal with kernel which have a smaller UIO_FASTIOV as well
    as a very big count.  */
 ssize_t
 writev (fd, vector, count)
@@ -46,7 +43,7 @@ writev (fd, vector, count)
 
   bytes_written = __syscall_writev (fd, vector, count);
 
-  if (bytes_written < 0 && errno == EINVAL && count > MAX_IOVEC)
+  if (bytes_written < 0 && errno == EINVAL && count > UIO_FASTIOV)
     {
       int i;
 
@@ -54,10 +51,10 @@ writev (fd, vector, count)
       __set_errno (errno_saved);
 
       bytes_written = 0;
-      for (i = 0; i < count; i += MAX_IOVEC)
+      for (i = 0; i < count; i += UIO_FASTIOV)
        {
          ssize_t bytes = __syscall_writev (fd, vector + i,
-                                           MIN (count - i, MAX_IOVEC));
+                                           MIN (count - i, UIO_FASTIOV));
 
          if (bytes < 0)
            return bytes_written > 0 ? bytes_written : bytes;
index be49b9d1de0b7fe1d73eda1471cc4b3a239d094a..aa120f5193037269ad76805ef2aeb41d388ff36a 100644 (file)
@@ -21,7 +21,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 
-#include "kernel_stat.h"
+#include <kernel_stat.h>
 
 extern int __syscall_stat (const char *, struct kernel_stat *);