From 7799b7b3350fdcadc6dfb8821fb49b7772c96701 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 15 Apr 1997 01:38:39 +0000 Subject: Update. 1997-04-15 03:14 Ulrich Drepper * wcsmbs/wcsstr.c: Add weak alias wcswcs for Unix98 compliance. * math/Makefile (libm-calls): Add s_sincos and s_cproj. * math/mathcalls.h: Add prototype for sincos. * sysdeps/i386/fpu/__math.h: Warn about restriction on arguments to inlined sin and cos function. Define functions new in ISO C 9X when __USE_ISOC9X is defined. Add optimized version of finite. Rewrite sincos function to handle too large arguments. * sysdeps/libm-i387/s_cos.S: Better code alignment. * sysdeps/libm-i387/s_cosl.S: Likewise. * sysdeps/libm-i387/s_sin.S: Likewise. * sysdeps/libm-i387/s_sinl.S: Likewise. * sysdeps/libm-i387/s_finite.S: Yet better code. * sysdeps/libm-i387/s_finitef.S: Likewise. * sysdeps/libm-i387/s_sincos.S: New file. * sysdeps/libm-i387/s_sincosf.S: New file. * sysdeps/libm-i387/s_sincosl.S: New file. * sysdeps/libm-ieee754/s_sincos.c: New file. * sysdeps/libm-ieee754/s_sincosf.c: New file. * sysdeps/libm-ieee754/s_sincosl.c: New file. * sysdeps/libm-ieee754/s_ccosh.c: Change to use sincos function. * sysdeps/libm-ieee754/s_ccoshf.c: Likewise. * sysdeps/libm-ieee754/s_ccoshl.c: Likewise. * sysdeps/libm-ieee754/s_cexp.c: Likewise. * sysdeps/libm-ieee754/s_cexpf.c: Likewise. * sysdeps/libm-ieee754/s_cexpl.c: Likewise. * sysdeps/libm-ieee754/s_csinh.c: Likewise. * sysdeps/libm-ieee754/s_csinhf.c: Likewise. * sysdeps/libm-ieee754/s_csinhl.c: Likewise. * sysdeps/libm-ieee754/s_ctan.c: Likewise. * sysdeps/libm-ieee754/s_ctanf.c: Likewise. * sysdeps/libm-ieee754/s_ctanl.c: Likewise. * sysdeps/libm-ieee754/s_ctanh.c: Likewise. * sysdeps/libm-ieee754/s_ctanhf.c: Likewise. * sysdeps/libm-ieee754/s_ctanhl.c: Likewise. * sysdeps/libm-ieee754/s_cosl.c: Correct check for range. * sysdeps/libm-ieee754/s_sinl.c: Likewise. * sysdeps/libm-ieee754/s_roundtol.c: Fix typos. * sysdeps/libm-ieee754/s_roundtoll.c: Likewise. * nis/Makefile (services): Mention nisplus before compat. * nis/nis_call.c (__do_niscall): Change type of variable server_len to prevent warning. * nis/nss_compat/compat-grp.c (getgrent_next_file_plusgroup): Add cast to prevent warning. * nis/nss_compat/compat-pwd.c (getpwent_next_file_plususer): Likewise. * nis/nss_compat/compat-spwd.c (getspent_next_file_plususer): Likewise. * nis/nss_nisplus/nisplus-hosts.c (_nss_nisplus_parse_hostent): Change type of variable `i' to prevent warning. * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_parse_netent): Likewise. * nis/nss_nisplus/nisplus-proto.c (_nss_nisplus_parse_protoent): Likewise. * nis/nss_nisplus/nisplus-rpc.c (_nss_nisplus_parse_rpcent): Likewise. * nis/nss_nisplus/nisplus-service.c (_nss_nisplus_parse_servent): Likewise. * sysdeps/generic/Dist: Remove old math implementation files. * sysdeps/generic/mathimpl.h: Removed. * sysdeps/generic/trig.h: Removed. * sysdeps/generic/sincos.c: Removed. * sysdeps/generic/asincos.c: Removed. * sysdeps/generic/exp__E.c: Removed. * sysdeps/generic/log__L.c: Removed. 1997-04-13 17:18 Wolfram Gloger * malloc/malloc.c (fREe): Small optimization. Before returning, add fast check whether the heap containing top can go away. 1997-04-11 16:46 Wolfram Gloger * malloc/malloc.c (mALLOc, rEALLOc, cALLOc, mEMALIGn): When failing to allocate a new chunk, also try the main_arena. It may be that we are only running out of mmapped regions, and other arenas cannot be enlarged sufficiently. (new_heap, malloc_extend_top): Handle top_pad more consistently, i.e. only in new_heap(). 1997-04-13 21:10 Philip Blundell * sysdeps/posix/Makefile: Don't try to build and run mk-stdiolim if cross-compiling. * configure.in: Recognise "...linuxaout" OS names and turn off ELF. * configure.in: Add ARM support. * sysdeps/arm/Implies: New file. * sysdeps/arm/__longjmp.S: New file. * sysdeps/arm/bsd-_setjmp: New file. * sysdeps/arm/bsd-setjmp: New file. * sysdeps/arm/bytesex.h: New file. * sysdeps/arm/fpu_control.h: New file. * sysdeps/arm/jmp_buf.h: New file. * sysdeps/arm/setjmp.h: New file. * sysdeps/arm/sysdep.h: New file. * sysdeps/unix/arm/config.h: New file. 1997-04-14 04:03 Ulrich Drepper * sysdeps/libm-ieee754/s_cproj.c: New file. * sysdeps/libm-ieee754/s_cprojf.c: New file. * sysdeps/libm-ieee754/s_cprojl.c: New file. --- sysdeps/i386/fpu/__math.h | 69 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 19 deletions(-) (limited to 'sysdeps/i386/fpu/__math.h') diff --git a/sysdeps/i386/fpu/__math.h b/sysdeps/i386/fpu/__math.h index 86793babe5..080d0ec220 100644 --- a/sysdeps/i386/fpu/__math.h +++ b/sysdeps/i386/fpu/__math.h @@ -96,6 +96,7 @@ fabs (double __x) return __value; } +/* The argument range of this inline version is limited. */ __MATH_INLINE double sin (double __x); __MATH_INLINE double sin (double __x) @@ -108,6 +109,7 @@ sin (double __x) return __value; } +/* The argument range of this inline version is limited. */ __MATH_INLINE double cos (double __x); __MATH_INLINE double cos (double __x) @@ -371,7 +373,7 @@ ceil (double __x) /* Optimized versions for some non-standardized functions. */ -#ifdef __USE_MISC +#if defined __USE_ISOC9X || defined __USE_MISC __MATH_INLINE double hypot (double __x, double __y); __MATH_INLINE double @@ -424,22 +426,6 @@ atanh (double __x) return -0.5 * __log1p (-(__y + __y) / (1.0 + __y)) * __sgn1 (__x); } -__MATH_INLINE double coshm1 (double __x); -__MATH_INLINE double -coshm1 (double __x) -{ - register double __exm1 = __expm1 (fabs (__x)); - - return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1; -} - -__MATH_INLINE double acosh1p (double __x); -__MATH_INLINE double -acosh1p (double __x) -{ - return __log1p (__x + sqrt (__x) * sqrt (__x + 2.0)); -} - __MATH_INLINE double logb (double __x); __MATH_INLINE double logb (double __x) @@ -467,13 +453,58 @@ drem (double __x, double __y) return __value; } +/* This function is used in the `isfinite' macro. */ +__MATH_INLINE int __finite (double __x); +__MATH_INLINE int +__finite (double __x) +{ + register int __result; + __asm__ __volatile__ + ("orl $x0x800fffff, %0\n\t" + "incl %0\n\t" + "shrl $31, %0" + : "=q" (__result) : "0" (((int *) &__x)[1])); + return __result; +} +#endif + +#ifdef __USE_MISC +__MATH_INLINE double coshm1 (double __x); +__MATH_INLINE double +coshm1 (double __x) +{ + register double __exm1 = __expm1 (fabs (__x)); + + return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1; +} + +__MATH_INLINE double acosh1p (double __x); +__MATH_INLINE double +acosh1p (double __x) +{ + return __log1p (__x + sqrt (__x) * sqrt (__x + 2.0)); +} + __MATH_INLINE void sincos (double __x, double *__sinx, double *__cosx); __MATH_INLINE void sincos (double __x, double *__sinx, double *__cosx) { register double __cosr, __sinr; __asm __volatile__ - ("fsincos" + ("fsincos\n\t" + "fnstsw %%ax\n\t" + "testl $0x400, %%eax\n\t" + "jz 1f\n\t" + "fldpi\n\t" + "fadd %%st(0)\n\t" + "fxch %%st(1)\n\t" + "2: fprem1\n\t" + "fnstsw %%ax\n\t" + "testl $0x400, %%eax\n\t" + "jnz 2b\n\t" + "fstp %%st(1)\n\t" + "fsincos\n\t" + "1:" : "=t" (__cosr), "=u" (__sinr) : "0" (__x)); *__sinx = __sinr; @@ -484,7 +515,7 @@ __MATH_INLINE double sgn (double __x); __MATH_INLINE double sgn (double __x) { - return (__x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0)); + return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0); } __MATH_INLINE double pow2 (double __x); -- cgit v1.2.3