From 14ea22e96c0b6fce54e2451c69c96c429177b62c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 15 Feb 1998 19:31:34 +0000 Subject: Update. 1998-02-15 Ulrich Drepper * nss/nsswitch.c (__nss_lookup): Return 1 if this was the last module. * nss/getXXent_r.c: If no more module is found don't try to call setXXent functions but leave unsuccessfully. * malloc/obstack.h: Cleanups. * sysdeps/wordsize-32/stdint.h: New file. * sysdeps/wordsize-64/stdint.h: New file. * sysdeps/generic/stdint.h: New file. * sysdeps/wordsize-32/inttypes.h: Adopt to use stdint.h. * sysdeps/wordsize-64/inttypes.h: Likewise. * stdlib/Makefile (headers): Add stdint.h. 1998-02-03 Paul Eggert * malloc/obstack.h (PTR_INT_TYPE): Use __PTRDIFF_TYPE__ if available. 1998-02-13 17:59 Zack Weinberg * timezone: New directory. * time/README, time/africa, time/antarctica, time/asia, time/australasia, time/backward, time/checktab.awk, time/etcetera, time/europe, time/factory, time/ialloc.c, time/iso3166.tab, time/leapseconds, time/northamerica, time/pacificnew, time/private.h, time/scheck.c, time/solar87, time/solar88, time/solar89, time/southamerica, time/systemv, time/test-tz.c, time/tzfile.h, time/tzselect.ksh, time/yearistype, time/zdump.c, time/zic.c, time/zone.tab: Moved to timezone. * time/tzfile.c: Include tzfile.h from timezone subdir. * time/tzset.c: Likewise. * time/Makefile: Cut out all code relating to timezones... * timezone/Makefile: ...and paste it in here. * Makefile (subdirs): Add timezone. 1998-02-13 18:45 H.J. Lu * libc.map (_sys_nerr): Added. * sysdeps/unix/sysv/linux/errlist.c (_sys_nerr): Make it versioned symbol. 1998-02-15 17:16 Ulrich Drepper * sysdeps/unix/sysv/linux/bits/socket.h: Define PF_KEY and pseudo_AF_KEY instead of pseudo_PF_KEY and AF_KEY. Reported by Craig Metz . 1998-01-22 Andreas Schwab * nss/nss_files/files-parse.c (LOOKUP_NAME_CASE): Use __strcasecmp instead of strcasecmp. * nss/nss_files/files-alias.c (get_next_alias): Likewise. * wctype/wctype.h (_ISwbit): Avoid warning with gcc before 2.8. 1998-02-15 16:55 Ulrich Drepper * socket/sys/socket.h (setsockopt): Make OPTVAL parameter const. Patch by Dean Gaudet . 1998-02-15 16:53 Ulrich Drepper * sysdeps/generic/Dist: Add getresgid.c and getresuid.c. 1998-02-15 10:49 Zack Weinberg * sysdeps/unix/sysv/linux/poll.c: If compiled against a kernel with no poll syscall, just include the BSD version. * sysdeps/unix/sysv/linux/getresuid.c: If compiled against a kernel without the syscall, include the stub version. * sysdeps/unix/sysv/linux/getresgid.c: Likewise. * sysdeps/generic/getresuid.c: New file. * sysdeps/generic/getresgid.c: New file. 1998-02-15 Ulrich Drepper * stdio-common/vfscanf.c: Correct last change a bit. --- math/test-reduce.c | 207 ----------------------------------------------------- 1 file changed, 207 deletions(-) delete mode 100644 math/test-reduce.c (limited to 'math') diff --git a/math/test-reduce.c b/math/test-reduce.c deleted file mode 100644 index 5149ead341..0000000000 --- a/math/test-reduce.c +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Geoffrey Keating , 1997. - - 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. - - 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 is a generic program for comparing two precisions of a one-input - mathematical function. It is amazingly good at detecting when GCC - folds constants improperly. */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#include -#include -#include -#include -#include -#include - -#define TSMALL float -#define RSMALL(rfun) ({ unsigned rnum = (rfun); *(float *) &rnum; }) -#define TBIG double -#define XDIFF (24) -#define REDUCE(x) \ - ({ union ieee754_float u = { x }; u.ieee.exponent = 0x80; x = u.f; }) -#define ABS(x) fabs(x) - -#define string_0(x) #x -#define string_1(x) string_0(x) -#define TBIG_NAME string_1(TBIG) -#define TSMALL_NAME string_1(TSMALL) - -#define R_NEAREST 1 -#define R_ZERO 2 -#define R_UP 4 -#define R_DOWN 8 -#define R_ALL (R_NEAREST|R_ZERO|R_UP|R_DOWN) -static fenv_t rmodes[4]; -static const char * const rmnames[4] = -{ "near","zero","+Inf","-Inf" }; - -static int quiet = 0; - -#ifdef FE_ALL_INVALID -static const int invalid_exceptions = (FE_ALL_INVALID - | FE_INVALID | FE_DIVBYZERO); -#else -static const int invalid_exceptions = (FE_INVALID | FE_DIVBYZERO); -#endif - -static int -checkit (char *fname, - TSMALL (*fsmall) (TSMALL), TBIG (*fbig) (TBIG), - unsigned smalltries, unsigned largetries) -{ - unsigned int i, nerrors = 0, nwarn; - - int tryone (TSMALL fval) - { - int rmode; - int excepts, exceptsb; - TSMALL fres; - TBIG fvalb, fresb, diff; - char warn; - - fvalb = (TBIG) fval; - - for (rmode = 0; rmode < 4; ++rmode) - { - fesetenv (rmodes + rmode); - fres = fsmall (fval); - excepts = fetestexcept (invalid_exceptions); - fesetenv (rmodes + rmode); - fresb = fbig (fvalb); - exceptsb = fetestexcept (invalid_exceptions); - - if (excepts != exceptsb) - { - unsigned char *fvp = (unsigned char *) &fval; - size_t j; - - printf ("%s(", fname); - for (j = 0; j < sizeof (TSMALL); j++) - printf ("%02x", fvp[j]); - printf ("),%s: exceptions %s: %08x, %s: %08x\n", - rmnames[rmode], - TBIG_NAME, exceptsb, TSMALL_NAME, excepts); - if (++nerrors > 10) - return 1; - } - - diff = ABS (fres - (TSMALL) fresb); - if (fres == (TSMALL) fresb - || isnan (fres) && isnan (fresb) - || logb (fresb) - logb (diff) < XDIFF - 1) - continue; - - if (logb (fresb) - logb (diff) < XDIFF) - { - if (++nwarn > 10 || quiet) - continue; - warn = 'w'; - } - else - { - if (++nerrors > 10) - return 1; - warn = 'e'; - } - - { - TSMALL fresbs = (TSMALL) fresb; - unsigned char *fvp = (unsigned char *) &fval; - unsigned char *frp = (unsigned char *) &fres; - unsigned char *frpb = (unsigned char *) &fresb; - unsigned char *frpbs = (unsigned char *) &fresbs; - size_t j; - - printf ("%s(",fname); - for (j = 0; j < sizeof (TSMALL); ++j) - printf ("%02x", fvp[j]); - printf ("),%s: %s ", rmnames[rmode], TBIG_NAME); - for (j = 0; j < sizeof (TBIG); ++j) - printf ("%02x", frpb[j]); - printf (" ("); - for (j = 0; j < sizeof (TSMALL); ++j) - printf ("%02x", frpbs[j]); - printf ("), %s ", TSMALL_NAME); - for (j = 0; j < sizeof (TSMALL); ++j) - printf ("%02x", frp[j]); - printf (" %c\n", warn); - } - } - return 0; - } - - nwarn = 0; - for (i = 0; i < smalltries; i++) - { - TSMALL fval; - - fval = RSMALL (rand () ^ rand () << 16); - REDUCE (fval); - if (tryone (fval)) - break; - } - - printf ("%s-small: %d errors, %d (%0.2f%%) inaccuracies\n", - fname, nerrors, nwarn, - nwarn * 0.25 / ((double) smalltries)); - - nwarn = 0; - for (i = 0; i < largetries; ++i) - { - TSMALL fval; - - fval = RSMALL (rand () ^ rand () << 16); - if (tryone (fval)) - break; - } - - printf ("%s-large: %d errors, %d (%0.2f%%) inaccuracies\n", - fname, nerrors, nwarn, - nwarn * 0.25 / ((double) largetries)); - return nerrors == 0; -} - -int -main (void) -{ - int r; - - _LIB_VERSION = _IEEE_; - - /* Set up environments for rounding modes. */ - fesetenv (FE_DFL_ENV); - fesetround (FE_TONEAREST); - fegetenv (rmodes + 0); - fesetround (FE_TOWARDSZERO); - fegetenv (rmodes + 1); - fesetround (FE_UPWARD); - fegetenv (rmodes + 2); - fesetround (FE_DOWNWARD); - fegetenv (rmodes + 3); - - /* Seed the RNG. */ - srand (time (0)); - - /* Do it. */ - r = checkit ("exp2", exp2f, exp2, 1 << 20, 1 << 15); - r &= checkit ("exp", expf, exp, 1 << 20, 1 << 15); - return r ? 0 : 1; -} -- cgit 1.4.1