[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r15558 - in /trunk: ./ libc/ libc/elf/ libc/math/ libc/nptl/ libc/string/ libc/sysdeps/ieee754/dbl-64/ libc/sysdeps/ieee754/...
- To: commits@xxxxxxxxxx
- Subject: [Commits] r15558 - in /trunk: ./ libc/ libc/elf/ libc/math/ libc/nptl/ libc/string/ libc/sysdeps/ieee754/dbl-64/ libc/sysdeps/ieee754/...
- From: joseph@xxxxxxxxxx
- Date: Tue, 25 Oct 2011 16:50:32 -0000
Author: joseph
Date: Tue Oct 25 16:50:31 2011
New Revision: 15558
Log:
Merge changes between r15532 and r15557 from /fsf/trunk.
Added:
trunk/libc/sysdeps/ieee754/dbl-64/sincostab.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/ieee754/dbl-64/sincostab.c
trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c
trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c
trunk/libc/sysdeps/x86_64/fpu/dla.h
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/dla.h
trunk/libc/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/doasin-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/doasin-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_asin.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_atan2.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_exp.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_exp.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_log.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_log.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/e_pow.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/e_pow.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/mptan-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/mptan-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_atan.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_sin.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/s_tan.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c
trunk/libc/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c
- copied unchanged from r15557, fsf/trunk/libc/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c
Removed:
trunk/libc/sysdeps/ieee754/dbl-64/sincos.tbl
trunk/libc/sysdeps/x86_64/dla.h
Modified:
trunk/ (props changed)
trunk/libc/ChangeLog
trunk/libc/config.make.in
trunk/libc/configure
trunk/libc/configure.in
trunk/libc/elf/dl-deps.c
trunk/libc/elf/dl-fini.c
trunk/libc/math/Makefile
trunk/libc/nptl/ChangeLog
trunk/libc/nptl/tst-cancel7.c
trunk/libc/nptl/tst-mutex6.c
trunk/libc/nptl/tst-mutex9.c
trunk/libc/nptl/tst-mutexpi6.c
trunk/libc/string/test-strchr.c
trunk/libc/sysdeps/ieee754/dbl-64/branred.c
trunk/libc/sysdeps/ieee754/dbl-64/doasin.c
trunk/libc/sysdeps/ieee754/dbl-64/dosincos.c
trunk/libc/sysdeps/ieee754/dbl-64/e_asin.c
trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c
trunk/libc/sysdeps/ieee754/dbl-64/e_atanh.c
trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c
trunk/libc/sysdeps/ieee754/dbl-64/e_fmod.c
trunk/libc/sysdeps/ieee754/dbl-64/e_j0.c
trunk/libc/sysdeps/ieee754/dbl-64/e_log.c
trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c
trunk/libc/sysdeps/ieee754/dbl-64/halfulp.c
trunk/libc/sysdeps/ieee754/dbl-64/mpa.c
trunk/libc/sysdeps/ieee754/dbl-64/mpa.h
trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c
trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h
trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c
trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c
trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h
trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.c
trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h
trunk/libc/sysdeps/ieee754/dbl-64/mptan.c
trunk/libc/sysdeps/ieee754/dbl-64/s_atan.c
trunk/libc/sysdeps/ieee754/dbl-64/s_ceil.c
trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c
trunk/libc/sysdeps/ieee754/dbl-64/s_floor.c
trunk/libc/sysdeps/ieee754/dbl-64/s_log1p.c
trunk/libc/sysdeps/ieee754/dbl-64/s_round.c
trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c
trunk/libc/sysdeps/ieee754/dbl-64/s_tan.c
trunk/libc/sysdeps/ieee754/dbl-64/sincos32.c
trunk/libc/sysdeps/ieee754/dbl-64/slowexp.c
trunk/libc/sysdeps/ieee754/dbl-64/slowpow.c
trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c
trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c
trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_round.c
trunk/libc/sysdeps/ieee754/flt-32/e_atanhf.c
trunk/libc/sysdeps/ieee754/flt-32/e_j0f.c
trunk/libc/sysdeps/ieee754/flt-32/s_ceilf.c
trunk/libc/sysdeps/ieee754/flt-32/s_expm1f.c
trunk/libc/sysdeps/ieee754/flt-32/s_floorf.c
trunk/libc/sysdeps/ieee754/flt-32/s_log1pf.c
trunk/libc/sysdeps/ieee754/flt-32/s_roundf.c
trunk/libc/sysdeps/ieee754/ldbl-96/e_atanhl.c
trunk/libc/sysdeps/ieee754/ldbl-96/e_j0l.c
trunk/libc/sysdeps/ieee754/ldbl-96/s_roundl.c
trunk/libc/sysdeps/x86_64/fpu/math_private.h
trunk/libc/sysdeps/x86_64/fpu/multiarch/Makefile
trunk/libc/wcsmbs/wcscmp.c
trunk/libc/wcsmbs/wcslen.c
trunk/libc/wcsmbs/wmemcmp.c
Propchange: trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 25 16:50:31 2011
@@ -1,1 +1,1 @@
-/fsf/trunk:15224-15532
+/fsf/trunk:15224-15557
Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Tue Oct 25 16:50:31 2011
@@ -1,4 +1,178 @@
+2011-10-25 Andreas Schwab <schwab@xxxxxxxxxx>
+
+ * wcsmbs/wcscmp.c (WCSCMP): Compare as wchar_t, not wint_t.
+ * wcsmbs/wmemcmp.c (WMEMCMP): Likewise.
+
+ * string/test-strchr.c (do_test): Don't generate NUL bytes.
+
+2011-10-25 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * sysdeps/ieee754/dbl-64/e_atanh.c: Use math_force_eval instead of a
+ useful if() expression.
+ * sysdeps/ieee754/dbl-64/e_j0.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_ceil.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_expm1.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_floor.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_log1p.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_round.c: Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c: Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c: Likewise.
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_round.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_atanhf.c: Likewise.
+ * sysdeps/ieee754/flt-32/e_j0f.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_ceilf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_expm1f.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_floorf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_log1pf.c: Likewise.
+ * sysdeps/ieee754/flt-32/s_roundf.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_atanhl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/e_j0l.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/s_roundl.c: Likewise.
+
+ * sysdeps/x86_64/fpu/math_private.h: Use VEX encoding when possible.
+
+2011-10-25 Andreas Schwab <schwab@xxxxxxxxxx>
+
+ * elf/dl-deps.c (_dl_map_object_deps): Remove always true
+ condition.
+ * elf/dl-fini.c (_dl_sort_fini): Likewise.
+
+2011-10-25 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * sysdeps/ieee754/dbl-64/branred.c: Move FMA4 code into separate
+ .text section. Avoid duplicate constants.
+ * sysdeps/ieee754/dbl-64/doasin.c: Likewise.
+ * sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_asin.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_exp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
+ * sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/mpa.c: Likewise.
+ * sysdeps/ieee754/dbl-64/mpa.h: Likewise.
+ * sysdeps/ieee754/dbl-64/mpatan.c: Likewise.
+ * sysdeps/ieee754/dbl-64/mpatan.h: Likewise.
+ * sysdeps/ieee754/dbl-64/mpatan2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/mpexp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/mpexp.h: Likewise.
+ * sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise.
+ * sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise.
+ * sysdeps/ieee754/dbl-64/mptan.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
+ * sysdeps/ieee754/dbl-64/sincos32.c: Likewise.
+ * sysdeps/ieee754/dbl-64/slowexp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/slowpow.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/brandred-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/doasin-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/e_log-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mpa-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mplog-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/mptan-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c: Likewise.
+ * sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c: Likewise.
+
+2011-10-24 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * sysdeps/x86_64/dla.h: Move to ...
+ * sysdeps/x86_64/fpu/dla.h: ...here.
+ (DLA_FMS): Some compilers fail to inline __builtin_fma in some
+ situations. Use __builtin_fma only for gcc 4.6 and up.
+
+ * config.make.in: Add have-mfma4 entry.
+ * configure.in: Substitute libc_cv_cc_fma4.
+ * math/Makefile (dbl-only-routines): Add sincostab.
+ * sysdeps/ieee754/dbl-64/dosincos.c: Don't include sincos.tbl.
+ Use __sincostab not sincos.
+ * sysdeps/ieee754/dbl-64/e_asin.c: Don't define aliases when function
+ name is a macro.
+ * sysdeps/ieee754/dbl-64/e_exp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise. Define singArctan2
+ using __copysign.
+ * sysdeps/ieee754/dbl-64/mpa.c: Don't export __acr. Don't define
+ __cr and __cpymn. Define __cpy unless NO___CPY is defined. Define
+ norm, denorm, and __mp_dbl unless NO___MP_DBL is defined.
+ * sysdeps/ieee754/dbl-64/mpa.h: Don't declare __acr, __cr, __cpymn,
+ and __inv.
+ * sysdeps/ieee754/dbl-64/mpsqrt.c: Make fastiroot static.
+ * sysdeps/ieee754/dbl-64/s_atan.c: Define __signArctan using
+ __copysign.
+ * sysdeps/ieee754/dbl-64/s_sin.c: Use __sincostab not sincos. Don't
+ define aliases when function name is a macro.
+ * sysdeps/ieee754/dbl-64/sincostab.c: Renamed from
+ sysdeps/ieee754/dbl-64/sincos.tbl.
+ * sysdeps/x86_64/fpu/multiarch/Makefile: Add entries to build
+ fma4-enabled routines.
+ * sysdeps/x86_64/fpu/multiarch/brandred-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/doasin-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_asin.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_atan2.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_exp.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_log-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_log.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/e_pow.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/mpa-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/mplog-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/mptan-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_atan.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_sin.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/s_tan.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c: New file.
+ * sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c: New file.
+
+ * sysdeps/ieee754/dbl-64/doasin.c: Adjust for DLA_FMA -> DLA_FMS
+ rename.
+ * sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
+ * sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
+ * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
+ * sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_atan.c: Likewise.
+ * sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
+
+2011-10-24 Andreas Schwab <schwab@xxxxxxxxxx>
+
+ * wcsmbs/wcslen.c: Don't define WCSLEN, reverse logic.
+
2011-10-23 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c: New file.
+
+ * sysdeps/ieee754/dbl-64/e_fmod.c (__ieee754_fmod): Add some branch
+ prediction.
+ * sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c: New file.
* string/strnlen.c: Don't define STRNLEN, reverse logic.
Remove unused variable magic_bits.
Modified: trunk/libc/config.make.in
==============================================================================
--- trunk/libc/config.make.in (original)
+++ trunk/libc/config.make.in Tue Oct 25 16:50:31 2011
@@ -59,6 +59,7 @@
enable-check-abi = @enable_check_abi@
have-forced-unwind = @libc_cv_forced_unwind@
have-fpie = @libc_cv_fpie@
+have-mfma4 = @libc_cv_cc_fma4@
gnu89-inline-CFLAGS = @gnu89_inline@
have-ssp = @libc_cv_ssp@
have-selinux = @have_selinux@
Modified: trunk/libc/configure
==============================================================================
--- trunk/libc/configure (original)
+++ trunk/libc/configure Tue Oct 25 16:50:31 2011
@@ -658,6 +658,7 @@
ldd_rewrite_script
use_ldconfig
libc_cv_as_i686
+libc_cv_cc_fma4
libc_cv_cc_novzeroupper
libc_cv_cc_avx
libc_cv_cc_sse4
@@ -8941,6 +8942,7 @@
+
if test $elf = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_ELF 1
Modified: trunk/libc/configure.in
==============================================================================
--- trunk/libc/configure.in (original)
+++ trunk/libc/configure.in Tue Oct 25 16:50:31 2011
@@ -2368,6 +2368,7 @@
AC_SUBST(libc_cv_cc_sse4)
AC_SUBST(libc_cv_cc_avx)
AC_SUBST(libc_cv_cc_novzeroupper)
+AC_SUBST(libc_cv_cc_fma4)
AC_SUBST(libc_cv_as_i686)
AC_SUBST(use_ldconfig)
Modified: trunk/libc/elf/dl-deps.c
==============================================================================
--- trunk/libc/elf/dl-deps.c (original)
+++ trunk/libc/elf/dl-deps.c Tue Oct 25 16:50:31 2011
@@ -627,7 +627,7 @@
while (1)
{
/* Keep track of which object we looked at this round. */
- seen[i] += seen[i] < 2;
+ ++seen[i];
struct link_map *thisp = l_initfini[i];
/* Find the last object in the list for which the current one is
Modified: trunk/libc/elf/dl-fini.c
==============================================================================
--- trunk/libc/elf/dl-fini.c (original)
+++ trunk/libc/elf/dl-fini.c Tue Oct 25 16:50:31 2011
@@ -44,7 +44,7 @@
while (1)
{
/* Keep track of which object we looked at this round. */
- seen[i] += seen[i] < 2;
+ ++seen[i];
struct link_map *thisp = maps[i];
/* Do not handle ld.so in secondary namespaces and object which
Modified: trunk/libc/math/Makefile
==============================================================================
--- trunk/libc/math/Makefile (original)
+++ trunk/libc/math/Makefile Tue Oct 25 16:50:31 2011
@@ -68,7 +68,7 @@
dbl-only-routines := branred doasin dosincos halfulp mpa mpatan2 \
mpatan mpexp mplog mpsqrt mptan sincos32 slowexp \
- slowpow
+ slowpow sincostab
libm-routines = $(strip $(libm-support) $(libm-calls) \
$(patsubst %_rf,%f_r,$(libm-calls:=f)) \
$(long-m-$(long-double-fcts))) \
Modified: trunk/libc/nptl/ChangeLog
==============================================================================
--- trunk/libc/nptl/ChangeLog (original)
+++ trunk/libc/nptl/ChangeLog Tue Oct 25 16:50:31 2011
@@ -1,3 +1,10 @@
+2011-10-24 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * tst-cancel7.c: Avoid warning.
+ * tst-mutex6.c: Likewise.
+ * tst-mutex9.c: Likewise.
+ * tst-mutexpi6.c: Likewise.
+
2011-10-23 Ulrich Drepper <drepper@xxxxxxxxx>
* sysdeps/i386/tls.h: Remove #include <list.h>.
Modified: trunk/libc/nptl/tst-cancel7.c
==============================================================================
--- trunk/libc/nptl/tst-cancel7.c (original)
+++ trunk/libc/nptl/tst-cancel7.c Tue Oct 25 16:50:31 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@xxxxxxxxxx>, 2002.
@@ -204,7 +204,7 @@
case OPT_PIDFILE: \
pidfile = optarg; \
break;
-// #define CLEANUP_HANDLER do_cleanup ()
+#define CLEANUP_HANDLER do_cleanup ()
#define PREPARE(argc, argv) do_prepare (argc, argv)
#define TEST_FUNCTION do_test ()
#define TIMEOUT 5
Modified: trunk/libc/nptl/tst-mutex6.c
==============================================================================
--- trunk/libc/nptl/tst-mutex6.c (original)
+++ trunk/libc/nptl/tst-mutex6.c Tue Oct 25 16:50:31 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -25,7 +25,8 @@
#ifndef ATTR
-# define ATTR NULL
+pthread_mutexattr_t *attr;
+# define ATTR attr
#endif
Modified: trunk/libc/nptl/tst-mutex9.c
==============================================================================
--- trunk/libc/nptl/tst-mutex9.c (original)
+++ trunk/libc/nptl/tst-mutex9.c Tue Oct 25 16:50:31 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2003.
@@ -37,7 +37,6 @@
pthread_mutex_t *m;
pthread_mutexattr_t a;
pid_t pid;
- char *p;
fd = mkstemp (tmpfname);
if (fd == -1)
@@ -68,7 +67,6 @@
m = (pthread_mutex_t *) (((uintptr_t) mem + __alignof (pthread_mutex_t))
& ~(__alignof (pthread_mutex_t) - 1));
- p = (char *) (m + 1);
if (pthread_mutexattr_init (&a) != 0)
{
Modified: trunk/libc/nptl/tst-mutexpi6.c
==============================================================================
--- trunk/libc/nptl/tst-mutexpi6.c (original)
+++ trunk/libc/nptl/tst-mutexpi6.c Tue Oct 25 16:50:31 2011
@@ -3,11 +3,13 @@
#include <stdlib.h>
-static pthread_mutexattr_t a;
+pthread_mutexattr_t a;
+pthread_mutexattr_t *attr;
static void
prepare (void)
{
+ attr = &a;
if (pthread_mutexattr_init (&a) != 0)
{
puts ("mutexattr_init failed");
@@ -23,5 +25,5 @@
#define PREPARE(argc, argv) prepare ()
-#define ATTR &a
+#define ATTR attr
#include "tst-mutex6.c"
Modified: trunk/libc/string/test-strchr.c
==============================================================================
--- trunk/libc/string/test-strchr.c (original)
+++ trunk/libc/string/test-strchr.c Tue Oct 25 16:50:31 2011
@@ -63,8 +63,8 @@
return NULL;
}
-IMPL (stupid_STRCHR, 1)
-IMPL (simple_STRCHR, 1)
+IMPL (stupid_STRCHR, 0)
+IMPL (simple_STRCHR, 0)
IMPL (STRCHR, 1)
static void
@@ -100,15 +100,15 @@
static void
do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
-/* for wcschr: align here means align not in bytes,
- * but in wchar_ts, in bytes it will equal to align * (sizeof (wchar_t))
- * len for wcschr here isn't in bytes but it's number of wchar_t symbols */
+/* For wcschr: align here means align not in bytes,
+ but in wchar_ts, in bytes it will equal to align * (sizeof (wchar_t))
+ len for wcschr here isn't in bytes but it's number of wchar_t symbols. */
{
size_t i;
CHAR *result;
- CHAR *buf = (CHAR *) (buf1);
+ CHAR *buf = (CHAR *) buf1;
align &= 15;
- if ((align + len) * sizeof(CHAR) >= page_size)
+ if ((align + len) * sizeof (CHAR) >= page_size)
return;
for (i = 0; i < len; ++i)
@@ -116,6 +116,8 @@
buf[align + i] = 32 + 23 * i % max_char;
if (buf[align + i] == seek_char)
buf[align + i] = seek_char + 1;
+ else if (buf[align + i] == 0)
+ buf[align + i] = 1;
}
buf[align + len] = 0;
@@ -130,7 +132,8 @@
result = NULL;
if (HP_TIMING_AVAIL)
- printf ("Length %4zd, alignment in bytes %2zd:", pos, align * sizeof (CHAR));
+ printf ("Length %4zd, alignment in bytes %2zd:",
+ pos, align * sizeof (CHAR));
FOR_EACH_IMPL (impl, 0)
do_one_test (impl, buf + align, seek_char, result);
@@ -149,14 +152,15 @@
for (n = 0; n < ITERATIONS; n++)
{
-/* for wcschr: align here means align not in bytes, but in wchar_ts,
- * in bytes it will equal to align * (sizeof (wchar_t)) */
+ /* For wcschr: align here means align not in bytes, but in wchar_ts,
+ in bytes it will equal to align * (sizeof (wchar_t)). */
align = random () & 15;
pos = random () & 511;
seek_char = random () & 255;
if (pos + align >= 511)
pos = 510 - align - (random () & 7);
-/* len for wcschr here isn't in bytes but it's number of wchar_t symbols */
+ /* len for wcschr here isn't in bytes but it's number of wchar_t
+ symbols. */
len = random () & 511;
if ((pos == len && seek_char)
|| (pos > len && (random () & 1)))
Modified: trunk/libc/sysdeps/ieee754/dbl-64/branred.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/branred.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/branred.c Tue Oct 25 16:50:31 2011
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2011 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -38,6 +38,10 @@
#include "branred.h"
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
/*******************************************************************/
/* Routine branred() performs range reduction of a double number */
@@ -45,7 +49,9 @@
/* x=n*pi/2+(a+aa), abs(a+aa)<pi/4, n=0,+-1,+-2,.... */
/* Routine return integer (n mod 4) */
/*******************************************************************/
-int __branred(double x, double *a, double *aa)
+int
+SECTION
+__branred(double x, double *a, double *aa)
{
int i,k;
#if 0
Modified: trunk/libc/sysdeps/ieee754/dbl-64/doasin.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/doasin.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/doasin.c Tue Oct 25 16:50:31 2011
@@ -34,11 +34,17 @@
#include <dla.h>
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
/********************************************************************/
/* Compute arcsin(x,dx,v) of double-length number (x+dx) the result */
/* stored in v where v= v[0]+v[1] =arcsin(x+dx) */
/********************************************************************/
-void __doasin(double x, double dx, double v[]) {
+void
+SECTION
+__doasin(double x, double dx, double v[]) {
#include "doasin.h"
@@ -53,7 +59,7 @@
double xx,p,pp,u,uu,r,s;
double tc,tcc;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double hx,tx,hy,ty,tp,tq;
#endif
Modified: trunk/libc/sysdeps/ieee754/dbl-64/dosincos.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/dosincos.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/dosincos.c Tue Oct 25 16:50:31 2011
@@ -35,10 +35,19 @@
#include "endian.h"
#include "mydefs.h"
-#include "sincos.tbl"
#include <dla.h>
#include "dosincos.h"
#include "math_private.h"
+
+#ifndef SECTION
+# define SECTION
+#endif
+
+extern const union
+{
+ int4 i[880];
+ double x[440];
+} __sincostab attribute_hidden;
/***********************************************************************/
/* Routine receive Double-Length number (x+dx) and computing sin(x+dx) */
@@ -47,10 +56,12 @@
/*(x+dx) between 0 and PI/4 */
/***********************************************************************/
-void __dubsin(double x, double dx, double v[]) {
+void
+SECTION
+__dubsin(double x, double dx, double v[]) {
double r,s,c,cc,d,dd,d2,dd2,e,ee,
sn,ssn,cs,ccs,ds,dss,dc,dcc;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double p,hx,tx,hy,ty,q;
#endif
#if 0
@@ -66,10 +77,10 @@
dd=(x-d)+dx;
/* sin(x+dx)=sin(Xi+t)=sin(Xi)*cos(t) + cos(Xi)sin(t) where t ->0 */
MUL2(d,dd,d,dd,d2,dd2,p,hx,tx,hy,ty,q,c,cc);
- sn=sincos.x[k]; /* */
- ssn=sincos.x[k+1]; /* sin(Xi) and cos(Xi) */
- cs=sincos.x[k+2]; /* */
- ccs=sincos.x[k+3]; /* */
+ sn=__sincostab.x[k]; /* */
+ ssn=__sincostab.x[k+1]; /* sin(Xi) and cos(Xi) */
+ cs=__sincostab.x[k+2]; /* */
+ ccs=__sincostab.x[k+3]; /* */
MUL2(d2,dd2,s7.x,ss7.x,ds,dss,p,hx,tx,hy,ty,q,c,cc); /* Taylor */
ADD2(ds,dss,s5.x,ss5.x,ds,dss,r,s);
MUL2(d2,dd2,ds,dss,ds,dss,p,hx,tx,hy,ty,q,c,cc); /* series */
@@ -101,10 +112,12 @@
/*(x+dx) between 0 and PI/4 */
/**********************************************************************/
-void __dubcos(double x, double dx, double v[]) {
+void
+SECTION
+__dubcos(double x, double dx, double v[]) {
double r,s,c,cc,d,dd,d2,dd2,e,ee,
sn,ssn,cs,ccs,ds,dss,dc,dcc;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double p,hx,tx,hy,ty,q;
#endif
#if 0
@@ -118,10 +131,10 @@
d=x+dx;
dd=(x-d)+dx; /* cos(x+dx)=cos(Xi+t)=cos(Xi)cos(t) - sin(Xi)sin(t) */
MUL2(d,dd,d,dd,d2,dd2,p,hx,tx,hy,ty,q,c,cc);
- sn=sincos.x[k]; /* */
- ssn=sincos.x[k+1]; /* sin(Xi) and cos(Xi) */
- cs=sincos.x[k+2]; /* */
- ccs=sincos.x[k+3]; /* */
+ sn=__sincostab.x[k]; /* */
+ ssn=__sincostab.x[k+1]; /* sin(Xi) and cos(Xi) */
+ cs=__sincostab.x[k+2]; /* */
+ ccs=__sincostab.x[k+3]; /* */
MUL2(d2,dd2,s7.x,ss7.x,ds,dss,p,hx,tx,hy,ty,q,c,cc);
ADD2(ds,dss,s5.x,ss5.x,ds,dss,r,s);
MUL2(d2,dd2,ds,dss,ds,dss,p,hx,tx,hy,ty,q,c,cc);
@@ -167,7 +180,9 @@
/* Routine receive Double-Length number (x+dx) and computes cos(x+dx) */
/* as Double-Length number and store it in array v */
/**********************************************************************/
-void __docos(double x, double dx, double v[]) {
+void
+SECTION
+__docos(double x, double dx, double v[]) {
double y,yy,p,w[2];
if (x>0) {y=x; yy=dx;}
else {y=-x; yy=-dx;}
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_asin.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_asin.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_asin.c Tue Oct 25 16:50:31 2011
@@ -42,6 +42,10 @@
#include "uasncs.h"
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
void __doasin(double x, double dx, double w[]);
void __dubsin(double x, double dx, double v[]);
void __dubcos(double x, double dx, double v[]);
@@ -53,7 +57,9 @@
/* An ultimate asin routine. Given an IEEE double machine number x */
/* it computes the correctly rounded (to nearest) value of arcsin(x) */
/***************************************************************************/
-double __ieee754_asin(double x){
+double
+SECTION
+__ieee754_asin(double x){
double x1,x2,xx,s1,s2,res1,p,t,res,r,cor,cc,y,c,z,w[2];
mynumber u,v;
int4 k,m,n;
@@ -324,7 +330,9 @@
return u.x/v.x; /* NaN */
}
}
+#ifndef __ieee754_asin
strong_alias (__ieee754_asin, __asin_finite)
+#endif
/*******************************************************************/
/* */
@@ -332,7 +340,9 @@
/* */
/*******************************************************************/
-double __ieee754_acos(double x)
+double
+SECTION
+__ieee754_acos(double x)
{
double x1,x2,xx,s1,s2,res1,p,t,res,r,cor,cc,y,c,z,w[2],eps;
#if 0
@@ -636,4 +646,6 @@
return u.x/v.x;
}
}
+#ifndef __ieee754_acos
strong_alias (__ieee754_acos, __acos_finite)
+#endif
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_atan2.c Tue Oct 25 16:50:31 2011
@@ -44,6 +44,10 @@
#include "atnat2.h"
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
/************************************************************************/
/* An ultimate atan2 routine. Given two IEEE double machine numbers y,x */
/* it computes the correctly rounded (to nearest) value of atan2(y,x). */
@@ -51,11 +55,17 @@
/* round to nearest mode of IEEE 754 standard. */
/************************************************************************/
static double atan2Mp(double ,double ,const int[]);
-static double signArctan2(double ,double);
+ /* Fix the sign and return after stage 1 or stage 2 */
+static double signArctan2(double y,double z)
+{
+ return __copysign(z, y);
+}
static double normalized(double ,double,double ,double);
void __mpatan2(mp_no *,mp_no *,mp_no *,int);
-double __ieee754_atan2(double y,double x) {
+double
+SECTION
+__ieee754_atan2(double y,double x) {
int i,de,ux,dx,uy,dy;
#if 0
@@ -64,7 +74,7 @@
static const int pr[MM]={6,8,10,20,32};
double ax,ay,u,du,u9,ua,v,vv,dv,t1,t2,t3,t7,t8,
z,zz,cor,s1,ss1,s2,ss2;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double t4,t5,t6;
#endif
#if 0
@@ -375,10 +385,14 @@
}
}
}
+#ifndef __ieee754_atan2
strong_alias (__ieee754_atan2, __atan2_finite)
+#endif
/* Treat the Denormalized case */
-static double normalized(double ax,double ay,double y, double z)
+static double
+SECTION
+normalized(double ax,double ay,double y, double z)
{ int p;
mp_no mpx,mpy,mpz,mperr,mpz2,mpt1;
p=6;
@@ -387,13 +401,10 @@
__sub(&mpz,&mperr,&mpz2,p); __mp_dbl(&mpz2,&z,p);
return signArctan2(y,z);
}
- /* Fix the sign and return after stage 1 or stage 2 */
-static double signArctan2(double y,double z)
-{
- return ((y<ZERO) ? -z : z);
-}
/* Stage 3: Perform a multi-Precision computation */
-static double atan2Mp(double x,double y,const int pr[])
+static double
+SECTION
+atan2Mp(double x,double y,const int pr[])
{
double z1,z2;
int i,p;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_atanh.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_atanh.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_atanh.c Tue Oct 25 16:50:31 2011
@@ -49,8 +49,11 @@
double t;
if (xa < 0.5)
{
- if (__builtin_expect (xa < 0x1.0p-28, 0) && (huge + x) > 0.0)
- return x;
+ if (__builtin_expect (xa < 0x1.0p-28, 0))
+ {
+ math_force_eval (huge + x);
+ return x;
+ }
t = xa + xa;
t = 0.5 * __log1p (t + t * xa / (1.0 - xa));
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_exp.c Tue Oct 25 16:50:31 2011
@@ -40,13 +40,19 @@
#include "uexp.tbl"
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
double __slowexp(double);
/***************************************************************************/
/* An ultimate exp routine. Given an IEEE double machine number x */
/* it computes the correctly rounded (to nearest) value of e^x */
/***************************************************************************/
-double __ieee754_exp(double x) {
+double
+SECTION
+__ieee754_exp(double x) {
double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
mynumber junk1, junk2, binexp = {{0,0}};
#if 0
@@ -145,7 +151,9 @@
else return __slowexp(x);
}
}
+#ifndef __ieee754_exp
strong_alias (__ieee754_exp, __exp_finite)
+#endif
/************************************************************************/
/* Compute e^(x+xx)(Double-Length number) .The routine also receive */
@@ -154,7 +162,9 @@
/*else return e^(x + xx) (always positive ) */
/************************************************************************/
-double __exp1(double x, double xx, double error) {
+double
+SECTION
+__exp1(double x, double xx, double error) {
double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
mynumber junk1, junk2, binexp = {{0,0}};
#if 0
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_fmod.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_fmod.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_fmod.c Tue Oct 25 16:50:31 2011
@@ -1,4 +1,3 @@
-/* @(#)e_fmod.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -44,7 +43,7 @@
}
/* determine ix = ilogb(x) */
- if(hx<0x00100000) { /* subnormal x */
+ if(__builtin_expect(hx<0x00100000, 0)) { /* subnormal x */
if(hx==0) {
for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
} else {
@@ -53,7 +52,7 @@
} else ix = (hx>>20)-1023;
/* determine iy = ilogb(y) */
- if(hy<0x00100000) { /* subnormal y */
+ if(__builtin_expect(hy<0x00100000, 0)) { /* subnormal y */
if(hy==0) {
for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
} else {
@@ -62,7 +61,7 @@
} else iy = (hy>>20)-1023;
/* set up {hx,lx}, {hy,ly} and align y to x */
- if(ix >= -1022)
+ if(__builtin_expect(ix >= -1022, 1))
hx = 0x00100000|(0x000fffff&hx);
else { /* subnormal x, shift x to normal */
n = -1022-ix;
@@ -74,7 +73,7 @@
lx = 0;
}
}
- if(iy >= -1022)
+ if(__builtin_expect(iy >= -1022, 1))
hy = 0x00100000|(0x000fffff&hy);
else { /* subnormal y, shift y to normal */
n = -1022-iy;
@@ -108,7 +107,7 @@
hx = hx+hx+(lx>>31); lx = lx+lx;
iy -= 1;
}
- if(iy>= -1022) { /* normalize output */
+ if(__builtin_expect(iy>= -1022, 1)) { /* normalize output */
hx = ((hx-0x00100000)|((iy+1023)<<20));
INSERT_WORDS(x,hx|sx,lx);
} else { /* subnormal output */
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_j0.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_j0.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_j0.c Tue Oct 25 16:50:31 2011
@@ -111,10 +111,9 @@
return z;
}
if(ix<0x3f200000) { /* |x| < 2**-13 */
- if(huge+x>one) { /* raise inexact if x != 0 */
- if(ix<0x3e400000) return one; /* |x|<2**-27 */
- else return one - 0.25*x*x;
- }
+ math_force_eval(huge+x); /* raise inexact if x != 0 */
+ if(ix<0x3e400000) return one; /* |x|<2**-27 */
+ else return one - 0.25*x*x;
}
z = x*x;
#ifdef DO_NOT_USE_THIS
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_log.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_log.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_log.c Tue Oct 25 16:50:31 2011
@@ -41,13 +41,19 @@
#include "MathLib.h"
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
void __mplog(mp_no *, mp_no *, int);
/*********************************************************************/
/* An ultimate log routine. Given an IEEE double machine number x */
/* it computes the correctly rounded (to nearest) value of log(x). */
/*********************************************************************/
-double __ieee754_log(double x) {
+double
+SECTION
+__ieee754_log(double x) {
#define M 4
static const int pr[M]={8,10,18,32};
int i,j,n,ux,dx,p;
@@ -58,7 +64,7 @@
sij,ssij,ttij,A,B,B0,y,y1,y2,polI,polII,sa,sb,
t1,t2,t7,t8,t,ra,rb,ww,
a0,aa0,s1,s2,ss2,s3,ss3,a1,aa1,a,aa,b,bb,c;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double t3,t4,t5,t6;
#endif
number num;
@@ -207,4 +213,6 @@
}
return y1;
}
+#ifndef __ieee754_log
strong_alias (__ieee754_log, __log_finite)
+#endif
Modified: trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/e_pow.c Tue Oct 25 16:50:31 2011
@@ -43,6 +43,10 @@
#include "upow.tbl"
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
double __exp1(double x, double xx, double error);
static double log1(double x, double *delta, double *error);
@@ -55,7 +59,9 @@
/* An ultimate power routine. Given two IEEE double machine numbers y,x */
/* it computes the correctly rounded (to nearest) value of X^y. */
/***************************************************************************/
-double __ieee754_pow(double x, double y) {
+double
+SECTION
+__ieee754_pow(double x, double y) {
double z,a,aa,error, t,a1,a2,y1,y2;
#if 0
double gor=1.0;
@@ -153,12 +159,16 @@
if (y<0) return (x<1.0)?INF.x:0;
return 0; /* unreachable, to make the compiler happy */
}
+#ifndef __ieee754_pow
strong_alias (__ieee754_pow, __pow_finite)
+#endif
/**************************************************************************/
/* Computing x^y using more accurate but more slow log routine */
/**************************************************************************/
-static double power1(double x, double y) {
+static double
+SECTION
+power1(double x, double y) {
double z,a,aa,error, t,a1,a2,y1,y2;
z = my_log2(x,&aa,&error);
t = y*134217729.0;
@@ -181,7 +191,9 @@
/* + the parameter delta. */
/* The result is bounded by error (rightmost argument) */
/****************************************************************************/
-static double log1(double x, double *delta, double *error) {
+static double
+SECTION
+log1(double x, double *delta, double *error) {
int i,j,m;
#if 0
int n;
@@ -273,7 +285,9 @@
/* Computing log(x)(x is left argument).The result is return double + delta.*/
/* The result is bounded by error (right argument) */
/****************************************************************************/
-static double my_log2(double x, double *delta, double *error) {
+static double
+SECTION
+my_log2(double x, double *delta, double *error) {
int i,j,m;
#if 0
int n;
@@ -284,7 +298,7 @@
#endif
double ou1,ou2,lu1,lu2,ov,lv1,lv2,a,a1,a2;
double y,yy,z,zz,j1,j2,j7,j8;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double j3,j4,j5,j6;
#endif
mynumber u,v;
@@ -367,7 +381,9 @@
/* Routine receives a double x and checks if it is an integer. If not */
/* it returns 0, else it returns 1 if even or -1 if odd. */
/**********************************************************************/
-static int checkint(double x) {
+static int
+SECTION
+checkint(double x) {
union {int4 i[2]; double x;} u;
int k,m,n;
#if 0
Modified: trunk/libc/sysdeps/ieee754/dbl-64/halfulp.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/halfulp.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/halfulp.c Tue Oct 25 16:50:31 2011
@@ -40,6 +40,10 @@
#include <dla.h>
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
static const int4 tab54[32] = {
262143, 11585, 1782, 511, 210, 107, 63, 42,
30, 22, 17, 14, 12, 10, 9, 7,
@@ -47,11 +51,13 @@
3, 3, 3, 3, 3, 3, 3, 3 };
-double __halfulp(double x, double y)
+double
+SECTION
+__halfulp(double x, double y)
{
mynumber v;
double z,u,uu;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double j1,j2,j3,j4,j5;
#endif
int4 k,l,m,n;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpa.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpa.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpa.c Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -48,11 +47,18 @@
#include "mpa.h"
#include "mpa2.h"
#include <sys/param.h> /* For MIN() */
+
+#ifndef SECTION
+# define SECTION
+#endif
+
+#ifndef NO___ACR
/* mcr() compares the sizes of the mantissas of two multiple precision */
/* numbers. Mantissas are compared regardless of the signs of the */
/* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also */
/* disregarded. */
-static int mcr(const mp_no *x, const mp_no *y, int p) {
+static int
+mcr(const mp_no *x, const mp_no *y, int p) {
int i;
for (i=1; i<=p; i++) {
if (X[i] == Y[i]) continue;
@@ -62,9 +68,9 @@
}
-
/* acr() compares the absolute values of two multiple precision numbers */
-int __acr(const mp_no *x, const mp_no *y, int p) {
+int
+__acr(const mp_no *x, const mp_no *y, int p) {
int i;
if (X[0] == ZERO) {
@@ -80,10 +86,12 @@
return i;
}
-
-
-/* cr90 compares the values of two multiple precision numbers */
-int __cr(const mp_no *x, const mp_no *y, int p) {
+#endif
+
+
+#if 0
+/* cr() compares the values of two multiple precision numbers */
+static int __cr(const mp_no *x, const mp_no *y, int p) {
int i;
if (X[0] > Y[0]) i= 1;
@@ -93,36 +101,37 @@
return i;
}
-
-
+#endif
+
+
+#ifndef NO___CPY
/* Copy a multiple precision number. Set *y=*x. x=y is permissible. */
void __cpy(const mp_no *x, mp_no *y, int p) {
- int i;
-
EY = EX;
- for (i=0; i <= p; i++) Y[i] = X[i];
-
- return;
-}
-
-
+ for (int i=0; i <= p; i++) Y[i] = X[i];
+}
+#endif
+
+
+#if 0
/* Copy a multiple precision number x of precision m into a */
/* multiple precision number y of precision n. In case n>m, */
/* the digits of y beyond the m'th are set to zero. In case */
/* n<m, the digits of x beyond the n'th are ignored. */
/* x=y is permissible. */
-void __cpymn(const mp_no *x, int m, mp_no *y, int n) {
+static void __cpymn(const mp_no *x, int m, mp_no *y, int n) {
int i,k;
EY = EX; k=MIN(m,n);
for (i=0; i <= k; i++) Y[i] = X[i];
for ( ; i <= n; i++) Y[i] = ZERO;
-
- return;
-}
-
+}
+#endif
+
+
+#ifndef NO___MP_DBL
/* Convert a multiple precision number *x into a double precision */
/* number *y, normalized case (|x| >= 2**(-1022))) */
static void norm(const mp_no *x, double *y, int p)
@@ -141,7 +150,7 @@
}
else {
for (a=ONE, z[1]=X[1]; z[1] < TWO23; )
- {a *= TWO; z[1] *= TWO; }
+ {a *= TWO; z[1] *= TWO; }
for (i=2; i<5; i++) {
z[i] = X[i]*a;
@@ -157,10 +166,10 @@
if (v == TWO18) {
if (z[4] == ZERO) {
- for (i=5; i <= p; i++) {
- if (X[i] == ZERO) continue;
- else {z[3] += ONE; break; }
- }
+ for (i=5; i <= p; i++) {
+ if (X[i] == ZERO) continue;
+ else {z[3] += ONE; break; }
+ }
}
else z[3] += ONE;
}
@@ -174,7 +183,6 @@
for (i=1; i>EX; i--) c *= RADIXI;
*y = c;
- return;
#undef R
}
@@ -222,8 +230,6 @@
c = X[0]*((z[1] + R*(z[2] + R*z[3])) - TWO10);
*y = c*TWOM1032;
- return;
-
#undef R
}
@@ -242,13 +248,16 @@
else if (EX==-42 && X[1]>=TWO10) norm(x,y,p);
else denorm(x,y,p);
}
+#endif
/* dbl_mp() converts a double precision number x into a multiple precision */
/* number *y. If the precision p is too small the result is truncated. x is */
/* left unchanged. */
-void __dbl_mp(double x, mp_no *y, int p) {
+void
+SECTION
+__dbl_mp(double x, mp_no *y, int p) {
int i,n;
double u;
@@ -269,7 +278,6 @@
if (u>x) u -= ONE;
Y[i] = u; x -= u; x *= RADIX; }
for ( ; i<=p; i++) Y[i] = ZERO;
- return;
}
@@ -279,7 +287,9 @@
/* No guard digit is used. The result equals the exact sum, truncated. */
/* *x & *y are left unchanged. */
-static void add_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) {
+static void
+SECTION
+add_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) {
int i,j,k;
@@ -321,7 +331,9 @@
/* or y&z. One guard digit is used. The error is less than one ulp. */
/* *x & *y are left unchanged. */
-static void sub_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) {
+static void
+SECTION
+sub_magnitudes(const mp_no *x, const mp_no *y, mp_no *z, int p) {
int i,j,k;
@@ -336,11 +348,11 @@
else {
i=p; j=p+1-j; k=p;
if (Y[j] > ZERO) {
- Z[k+1] = RADIX - Y[j--];
- Z[k] = MONE; }
+ Z[k+1] = RADIX - Y[j--];
+ Z[k] = MONE; }
else {
- Z[k+1] = ZERO;
- Z[k] = ZERO; j--;}
+ Z[k+1] = ZERO;
+ Z[k] = ZERO; j--;}
}
}
@@ -368,8 +380,6 @@
Z[k++] = Z[i++];
for (; k <= p; )
Z[k++] = ZERO;
-
- return;
}
@@ -377,7 +387,9 @@
/* but not x&z or y&z. One guard digit is used. The error is less than */
/* one ulp. *x & *y are left unchanged. */
-void __add(const mp_no *x, const mp_no *y, mp_no *z, int p) {
+void
+SECTION
+__add(const mp_no *x, const mp_no *y, mp_no *z, int p) {
int n;
@@ -393,7 +405,6 @@
else if (n == -1) {sub_magnitudes(y,x,z,p); Z[0] = Y[0]; }
else Z[0] = ZERO;
}
- return;
}
@@ -401,7 +412,9 @@
/* overlap but not x&z or y&z. One guard digit is used. The error is */
/* less than one ulp. *x & *y are left unchanged. */
-void __sub(const mp_no *x, const mp_no *y, mp_no *z, int p) {
+void
+SECTION
+__sub(const mp_no *x, const mp_no *y, mp_no *z, int p) {
int n;
@@ -417,7 +430,6 @@
else if (n == -1) {sub_magnitudes(y,x,z,p); Z[0] = -Y[0]; }
else Z[0] = ZERO;
}
- return;
}
@@ -426,16 +438,18 @@
/* truncated to p digits. In case p>3 the error is bounded by 1.001 ulp. */
/* *x & *y are left unchanged. */
-void __mul(const mp_no *x, const mp_no *y, mp_no *z, int p) {
+void
+SECTION
+__mul(const mp_no *x, const mp_no *y, mp_no *z, int p) {
int i, i1, i2, j, k, k2;
double u;
- /* Is z=0? */
+ /* Is z=0? */
if (X[0]*Y[0]==ZERO)
{ Z[0]=ZERO; return; }
- /* Multiply, add and carry */
+ /* Multiply, add and carry */
k2 = (p<3) ? p+p : p+3;
Z[k2]=ZERO;
for (k=k2; k>1; ) {
@@ -449,7 +463,7 @@
Z[--k] = u*RADIXI;
}
- /* Is there a carry beyond the most significant digit? */
+ /* Is there a carry beyond the most significant digit? */
if (Z[1] == ZERO) {
for (i=1; i<=p; i++) Z[i]=Z[i+1];
EZ = EX + EY - 1; }
@@ -457,7 +471,6 @@
EZ = EX + EY;
Z[0] = X[0] * Y[0];
- return;
}
@@ -466,6 +479,8 @@
/* 2.001*r**(1-p) for p>3. */
/* *x=0 is not permissible. *x is left unchanged. */
+static
+SECTION
void __inv(const mp_no *x, mp_no *y, int p) {
int i;
#if 0
@@ -474,11 +489,11 @@
double t;
mp_no z,w;
static const int np1[] = {0,0,0,0,1,2,2,2,2,3,3,3,3,3,3,3,3,3,
- 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4};
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4};
const mp_no mptwo = {1,{1.0,2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
__cpy(x,&z,p); z.e=0; __mp_dbl(&z,&t,p);
t=ONE/t; __dbl_mp(t,y,p); EY -= EX;
@@ -489,7 +504,6 @@
__sub(&mptwo,y,&z,p);
__mul(&w,&z,y,p);
}
- return;
}
@@ -498,11 +512,12 @@
/* Relative error bound = 2.001*r**(1-p) for p=2, 2.063*r**(1-p) for p=3 */
/* and 3.001*r**(1-p) for p>3. *y=0 is not permissible. */
-void __dvd(const mp_no *x, const mp_no *y, mp_no *z, int p) {
+void
+SECTION
+__dvd(const mp_no *x, const mp_no *y, mp_no *z, int p) {
mp_no w;
if (X[0] == ZERO) Z[0] = ZERO;
else {__inv(y,&w,p); __mul(x,&w,z,p);}
- return;
-}
+}
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpa.h
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpa.h (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpa.h Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2011 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -45,14 +44,14 @@
int e; /* floating point number, x: d[0] holds its sign (-1,0 or 1) */
double d[40]; /* e holds its exponent (...,-2,-1,0,1,2,...) and */
} mp_no; /* d[1]...d[p] hold its mantissa digits. The value of x is, */
- /* x = d[1]*r**(e-1) + d[2]*r**(e-2) + ... + d[p]*r**(e-p). */
- /* Here r = 2**24, 0 <= d[i] < r and 1 <= p <= 32. */
- /* p is a global variable. A multi-precision number is */
- /* always normalized. Namely, d[1] > 0. An exception is */
- /* a zero which is characterized by d[0] = 0. The terms */
- /* d[p+1], d[p+2], ... of a none zero number have no */
- /* significance and so are the terms e, d[1],d[2],... */
- /* of a zero. */
+ /* x = d[1]*r**(e-1) + d[2]*r**(e-2) + ... + d[p]*r**(e-p). */
+ /* Here r = 2**24, 0 <= d[i] < r and 1 <= p <= 32. */
+ /* p is a global variable. A multi-precision number is */
+ /* always normalized. Namely, d[1] > 0. An exception is */
+ /* a zero which is characterized by d[0] = 0. The terms */
+ /* d[p+1], d[p+2], ... of a none zero number have no */
+ /* significance and so are the terms e, d[1],d[2],... */
+ /* of a zero. */
typedef union { int i[2]; double d; } number;
@@ -66,15 +65,15 @@
#define ABS(x) ((x) < 0 ? -(x) : (x))
int __acr(const mp_no *, const mp_no *, int);
-int __cr(const mp_no *, const mp_no *, int);
+// int __cr(const mp_no *, const mp_no *, int);
void __cpy(const mp_no *, mp_no *, int);
-void __cpymn(const mp_no *, int, mp_no *, int);
+// void __cpymn(const mp_no *, int, mp_no *, int);
void __mp_dbl(const mp_no *, double *, int);
void __dbl_mp(double, mp_no *, int);
void __add(const mp_no *, const mp_no *, mp_no *, int);
void __sub(const mp_no *, const mp_no *, mp_no *, int);
void __mul(const mp_no *, const mp_no *, mp_no *, int);
-void __inv(const mp_no *, mp_no *, int);
+// void __inv(const mp_no *, mp_no *, int);
void __dvd(const mp_no *, const mp_no *, mp_no *, int);
extern void __mpatan (mp_no *, mp_no *, int);
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -34,10 +33,18 @@
#include "endian.h"
#include "mpa.h"
+
+#ifndef SECTION
+# define SECTION
+#endif
+
+#include "mpatan.h"
+
void __mpsqrt(mp_no *, mp_no *, int);
-void __mpatan(mp_no *x, mp_no *y, int p) {
-#include "mpatan.h"
+void
+SECTION
+__mpatan(mp_no *x, mp_no *y, int p) {
int i,m,n;
double dx;
@@ -54,19 +61,19 @@
mp_no mps,mpsm,mpt,mpt1,mpt2,mpt3;
- /* Choose m and initiate mpone, mptwo & mptwoim1 */
+ /* Choose m and initiate mpone, mptwo & mptwoim1 */
if (EX>0) m=7;
else if (EX<0) m=0;
else {
__mp_dbl(x,&dx,p); dx=ABS(dx);
for (m=6; m>0; m--)
- {if (dx>xm[m].d) break;}
+ {if (dx>__atan_xm[m].d) break;}
}
mpone.e = mptwo.e = mptwoim1.e = 1;
mpone.d[0] = mpone.d[1] = mptwo.d[0] = mptwoim1.d[0] = ONE;
mptwo.d[1] = TWO;
- /* Reduce x m times */
+ /* Reduce x m times */
__mul(x,x,&mpsm,p);
if (m==0) __cpy(x,&mps,p);
else {
@@ -82,8 +89,8 @@
__mpsqrt(&mpsm,&mps,p); mps.d[0] = X[0];
}
- /* Evaluate a truncated power series for Atan(s) */
- n=np[p]; mptwoim1.d[1] = twonm1[p].d;
+ /* Evaluate a truncated power series for Atan(s) */
+ n=__atan_np[p]; mptwoim1.d[1] = __atan_twonm1[p].d;
__dvd(&mpsm,&mptwoim1,&mpt,p);
for (i=n-1; i>1; i--) {
mptwoim1.d[1] -= TWO;
@@ -94,8 +101,8 @@
__mul(&mps,&mpt,&mpt1,p);
__sub(&mps,&mpt1,&mpt,p);
- /* Compute Atan(x) */
- mptwoim1.d[1] = twom[m].d;
+ /* Compute Atan(x) */
+ mptwoim1.d[1] = __atan_twom[m].d;
__mul(&mptwoim1,&mpt,y,p);
return;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpatan.h Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2011 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -29,9 +28,18 @@
#ifndef MPATAN_H
#define MPATAN_H
+extern const number __atan_xm[8] attribute_hidden;
+extern const number __atan_twonm1[33] attribute_hidden;
+extern const number __atan_twom[8] attribute_hidden;
+extern const number __atan_one attribute_hidden;
+extern const number __atan_two attribute_hidden;
+extern const int __atan_np[33] attribute_hidden;
+
+
+#ifndef AVOID_MPATAN_H
#ifdef BIG_ENDI
- static const number
- xm[8] = { /* x[m] */
+ const number
+ __atan_xm[8] = { /* x[m] */
/**/ {{0x00000000, 0x00000000} }, /* 0.0 */
/**/ {{0x3f8930be, 0x00000000} }, /* 0.0123 */
/**/ {{0x3f991687, 0x00000000} }, /* 0.0245 */
@@ -40,9 +48,9 @@
/**/ {{0x3fc95810, 0x00000000} }, /* 0.198 */
/**/ {{0x3fda7ef9, 0x00000000} }, /* 0.414 */
/**/ {{0x3ff00000, 0x00000000} }, /* 1.0 */
- };
- static const number
- twonm1[33] = { /* 2n-1 */
+ };
+ const number
+ __atan_twonm1[33] = { /* 2n-1 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
@@ -76,10 +84,10 @@
/**/ {{0x405b4000, 0x00000000} }, /* 109 */
/**/ {{0x405c4000, 0x00000000} }, /* 113 */
/**/ {{0x405d4000, 0x00000000} }, /* 117 */
- };
+ };
- static const number
- twom[8] = { /* 2**m */
+ const number
+ __atan_twom[8] = { /* 2**m */
/**/ {{0x3ff00000, 0x00000000} }, /* 1.0 */
/**/ {{0x40000000, 0x00000000} }, /* 2.0 */
/**/ {{0x40100000, 0x00000000} }, /* 4.0 */
@@ -88,17 +96,17 @@
/**/ {{0x40400000, 0x00000000} }, /* 32.0 */
/**/ {{0x40500000, 0x00000000} }, /* 64.0 */
/**/ {{0x40600000, 0x00000000} }, /* 128.0 */
- };
+ };
- static const number
-/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */
-/**/ two = {{0x40000000, 0x00000000} }; /* 2 */
+ const number
+/**/ __atan_one = {{0x3ff00000, 0x00000000} }, /* 1 */
+/**/ __atan_two = {{0x40000000, 0x00000000} }; /* 2 */
#else
#ifdef LITTLE_ENDI
- static const number
- xm[8] = { /* x[m] */
+ const number
+ __atan_xm[8] = { /* x[m] */
/**/ {{0x00000000, 0x00000000} }, /* 0.0 */
/**/ {{0x00000000, 0x3f8930be} }, /* 0.0123 */
/**/ {{0x00000000, 0x3f991687} }, /* 0.0245 */
@@ -107,9 +115,9 @@
/**/ {{0x00000000, 0x3fc95810} }, /* 0.198 */
/**/ {{0x00000000, 0x3fda7ef9} }, /* 0.414 */
/**/ {{0x00000000, 0x3ff00000} }, /* 1.0 */
- };
- static const number
- twonm1[33] = { /* 2n-1 */
+ };
+ const number
+__atan_twonm1[33] = { /* 2n-1 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
@@ -143,10 +151,10 @@
/**/ {{0x00000000, 0x405b4000} }, /* 109 */
/**/ {{0x00000000, 0x405c4000} }, /* 113 */
/**/ {{0x00000000, 0x405d4000} }, /* 117 */
- };
+ };
- static const number
- twom[8] = { /* 2**m */
+ const number
+ __atan_twom[8] = { /* 2**m */
/**/ {{0x00000000, 0x3ff00000} }, /* 1.0 */
/**/ {{0x00000000, 0x40000000} }, /* 2.0 */
/**/ {{0x00000000, 0x40100000} }, /* 4.0 */
@@ -155,20 +163,21 @@
/**/ {{0x00000000, 0x40400000} }, /* 32.0 */
/**/ {{0x00000000, 0x40500000} }, /* 64.0 */
/**/ {{0x00000000, 0x40600000} }, /* 128.0 */
- };
+ };
- static const number
-/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */
-/**/ two = {{0x00000000, 0x40000000} }; /* 2 */
+ const number
+/**/ __atan_one = {{0x00000000, 0x3ff00000} }, /* 1 */
+/**/ __atan_two = {{0x00000000, 0x40000000} }; /* 2 */
#endif
#endif
-#define ONE one.d
-#define TWO two.d
-
- static const int
- np[33] = { 0, 0, 0, 0, 6, 8,10,11,13,15,17,19,21,23,25,27,28,
- 30,32,34,36,38,40,42,43,45,47,49,51,53,55,57,59};
+ const int
+ __atan_np[33] = { 0, 0, 0, 0, 6, 8,10,11,13,15,17,19,21,23,25,27,28,
+ 30,32,34,36,38,40,42,43,45,47,49,51,53,55,57,59};
#endif
+#endif
+
+#define ONE __atan_one.d
+#define TWO __atan_two.d
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpatan2.c Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -38,18 +37,24 @@
#include "mpa.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
void __mpsqrt(mp_no *, mp_no *, int);
void __mpatan(mp_no *, mp_no *, int);
/* Multi-Precision Atan2(y,x) function subroutine, for p >= 4. */
/* y=0 is not permitted if x<=0. No error messages are given. */
-void __mpatan2(mp_no *y, mp_no *x, mp_no *z, int p) {
+void
+SECTION
+__mpatan2(mp_no *y, mp_no *x, mp_no *z, int p) {
static const double ZERO = 0.0, ONE = 1.0;
mp_no mpone = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
mp_no mpt1,mpt2,mpt3;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpexp.c Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -34,34 +33,40 @@
#include "mpa.h"
#include "mpexp.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
/* Multi-Precision exponential function subroutine (for p >= 4, */
/* 2**(-55) <= abs(x) <= 1024). */
-void __mpexp(mp_no *x, mp_no *y, int p) {
+void
+SECTION
+__mpexp(mp_no *x, mp_no *y, int p) {
int i,j,k,m,m1,m2,n;
double a,b;
static const int np[33] = {0,0,0,0,3,3,4,4,5,4,4,5,5,5,6,6,6,6,6,6,
- 6,6,6,6,7,7,7,7,8,8,8,8,8};
+ 6,6,6,6,7,7,7,7,8,8,8,8,8};
static const int m1p[33]= {0,0,0,0,17,23,23,28,27,38,42,39,43,47,43,47,50,54,
- 57,60,64,67,71,74,68,71,74,77,70,73,76,78,81};
+ 57,60,64,67,71,74,68,71,74,77,70,73,76,78,81};
static const int m1np[7][18] = {
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0,36,48,60,72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0,24,32,40,48,56,64,72, 0, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0,17,23,29,35,41,47,53,59,65, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0, 0,23,28,33,38,42,47,52,57,62,66, 0, 0},
- { 0, 0, 0, 0, 0, 0, 0, 0,27, 0, 0,39,43,47,51,55,59,63},
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,43,47,50,54}};
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0,36,48,60,72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0,24,32,40,48,56,64,72, 0, 0, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0,17,23,29,35,41,47,53,59,65, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0, 0, 0,23,28,33,38,42,47,52,57,62,66, 0, 0},
+ { 0, 0, 0, 0, 0, 0, 0, 0,27, 0, 0,39,43,47,51,55,59,63},
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,43,47,50,54}};
mp_no mpone = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
mp_no mpk = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
mp_no mps,mpak,mpt1,mpt2;
/* Choose m,n and compute a=2**(-m) */
- n = np[p]; m1 = m1p[p]; a = twomm1[p].d;
+ n = np[p]; m1 = m1p[p]; a = __mpexp_twomm1[p].d;
for (i=0; i<EX; i++) a *= RADIXI;
for ( ; i>EX; i--) a *= RADIX;
b = X[1]*RADIXI; m2 = 24*EX;
@@ -81,12 +86,12 @@
/* Evaluate the polynomial. Put result in mpt2 */
mpone.e=1; mpone.d[0]=ONE; mpone.d[1]=ONE;
- mpk.e = 1; mpk.d[0] = ONE; mpk.d[1]=nn[n].d;
+ mpk.e = 1; mpk.d[0] = ONE; mpk.d[1]=__mpexp_nn[n].d;
__dvd(&mps,&mpk,&mpt1,p);
__add(&mpone,&mpt1,&mpak,p);
for (k=n-1; k>1; k--) {
__mul(&mps,&mpak,&mpt1,p);
- mpk.d[1]=nn[k].d;
+ mpk.d[1]=__mpexp_nn[k].d;
__dvd(&mpt1,&mpk,&mpt2,p);
__add(&mpone,&mpt2,&mpak,p);
}
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpexp.h Tue Oct 25 16:50:31 2011
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2011 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -28,9 +28,20 @@
#ifndef MPEXP_H
#define MPEXP_H
+extern const number __mpexp_twomm1[33] attribute_hidden;
+extern const number __mpexp_nn[9] attribute_hidden;
+extern const number __mpexp_radix attribute_hidden;
+extern const number __mpexp_radixi attribute_hidden;
+extern const number __mpexp_zero attribute_hidden;
+extern const number __mpexp_one attribute_hidden;
+extern const number __mpexp_two attribute_hidden;
+extern const number __mpexp_half attribute_hidden;
+
+
+#ifndef AVOID_MPEXP_H
#ifdef BIG_ENDI
- static const number
- twomm1[33] = { /* 2**-m1 */
+ const number
+ __mpexp_twomm1[33] = { /* 2**-m1 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
@@ -65,8 +76,8 @@
/**/ {{0x3b100000, 0x00000000} }, /* 2**-78 */
/**/ {{0x3ae00000, 0x00000000} }, /* 2**-81 */
};
- static const number
- nn[9]={ /* n */
+ const number
+ __mpexp_nn[9]={ /* n */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x3ff00000, 0x00000000} }, /* 1 */
/**/ {{0x40000000, 0x00000000} }, /* 2 */
@@ -78,18 +89,18 @@
/**/ {{0x40200000, 0x00000000} }, /* 8 */
};
- static const number
-/**/ radix = {{0x41700000, 0x00000000} }, /* 2**24 */
-/**/ radixi = {{0x3e700000, 0x00000000} }, /* 2**-24 */
-/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */
-/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */
-/**/ two = {{0x40000000, 0x00000000} }, /* 2 */
-/**/ half = {{0x3fe00000, 0x00000000} }; /* 1/2 */
+ const number
+/**/ __mpexp_radix = {{0x41700000, 0x00000000} }, /* 2**24 */
+/**/ __mpexp_radixi = {{0x3e700000, 0x00000000} }, /* 2**-24 */
+/**/ __mpexp_zero = {{0x00000000, 0x00000000} }, /* 0 */
+/**/ __mpexp_one = {{0x3ff00000, 0x00000000} }, /* 1 */
+/**/ __mpexp_two = {{0x40000000, 0x00000000} }, /* 2 */
+/**/ __mpexp_half = {{0x3fe00000, 0x00000000} }; /* 1/2 */
#else
#ifdef LITTLE_ENDI
- static const number
- twomm1[33] = { /* 2**-m1 */
+ const number
+ __mpexp_twomm1[33] = { /* 2**-m1 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
@@ -124,8 +135,8 @@
/**/ {{0x00000000, 0x3b100000} }, /* 2**-78 */
/**/ {{0x00000000, 0x3ae00000} }, /* 2**-81 */
};
- static const number
- nn[9]={ /* n */
+ const number
+ __mpexp_nn[9]={ /* n */
/**/ {{0x00000000, 0x00000000} }, /* 0 */
/**/ {{0x00000000, 0x3ff00000} }, /* 1 */
/**/ {{0x00000000, 0x40000000} }, /* 2 */
@@ -137,22 +148,23 @@
/**/ {{0x00000000, 0x40200000} }, /* 8 */
};
- static const number
-/**/ radix = {{0x00000000, 0x41700000} }, /* 2**24 */
-/**/ radixi = {{0x00000000, 0x3e700000} }, /* 2**-24 */
-/**/ zero = {{0x00000000, 0x00000000} }, /* 0 */
-/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */
-/**/ two = {{0x00000000, 0x40000000} }, /* 2 */
-/**/ half = {{0x00000000, 0x3fe00000} }; /* 1/2 */
+ const number
+/**/ __mpexp_radix = {{0x00000000, 0x41700000} }, /* 2**24 */
+/**/ __mpexp_radixi = {{0x00000000, 0x3e700000} }, /* 2**-24 */
+/**/ __mpexp_zero = {{0x00000000, 0x00000000} }, /* 0 */
+/**/ __mpexp_one = {{0x00000000, 0x3ff00000} }, /* 1 */
+/**/ __mpexp_two = {{0x00000000, 0x40000000} }, /* 2 */
+/**/ __mpexp_half = {{0x00000000, 0x3fe00000} }; /* 1/2 */
#endif
#endif
+#endif
-#define RADIX radix.d
-#define RADIXI radixi.d
-#define ZERO zero.d
-#define ONE one.d
-#define TWO two.d
-#define HALF half.d
+#define RADIX __mpexp_radix.d
+#define RADIXI __mpexp_radixi.d
+#define ZERO __mpexp_zero.d
+#define ONE __mpexp_one.d
+#define TWO __mpexp_two.d
+#define HALF __mpexp_half.d
#endif
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.c Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -33,6 +32,12 @@
#include "endian.h"
#include "mpa.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
+#include "mpsqrt.h"
+
/****************************************************************************/
/* Multi-Precision square root function subroutine for precision p >= 4. */
/* The relative error is bounded by 3.501*r**(1-p), where r=2**24. */
@@ -41,20 +46,20 @@
/* p as integer. Routine computes sqrt(*x) and stores result in *y */
/****************************************************************************/
-double fastiroot(double);
+static double fastiroot(double);
-void __mpsqrt(mp_no *x, mp_no *y, int p) {
-#include "mpsqrt.h"
-
+void
+SECTION
+__mpsqrt(mp_no *x, mp_no *y, int p) {
int i,m,ex,ey;
double dx,dy;
mp_no
mphalf = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}},
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}},
mp3halfs = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
+ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
mp_no mpxn,mpz,mpu,mpt1,mpt2;
/* Prepare multi-precision 1/2 and 3/2 */
@@ -65,7 +70,7 @@
__mp_dbl(&mpxn,&dx,p); dy=fastiroot(dx); __dbl_mp(dy,&mpu,p);
__mul(&mpxn,&mphalf,&mpz,p);
- m=mp[p];
+ m=__mpsqrt_mp[p];
for (i=0; i<m; i++) {
__mul(&mpu,&mpu,&mpt1,p);
__mul(&mpt1,&mpz,&mpt2,p);
@@ -82,7 +87,9 @@
/* Compute a double precision approximation for 1/sqrt(x) */
/* with the relative error bounded by 2**-51. */
/***********************************************************/
-double fastiroot(double x) {
+static double
+SECTION
+fastiroot(double x) {
union {int i[2]; double d;} p,q;
double y,z, t;
int n;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mpsqrt.h Tue Oct 25 16:50:31 2011
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* Written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2011 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -28,24 +28,31 @@
#ifndef MPSQRT_H
#define MPSQRT_H
+extern const number __mpsqrt_one attribute_hidden;
+extern const number __mpsqrt_halfrad attribute_hidden;
+extern const int __mpsqrt_mp[33] attribute_hidden;
+
+
+#ifndef AVOID_MPSQRT_H
#ifdef BIG_ENDI
- static const number
-/**/ one = {{0x3ff00000, 0x00000000} }, /* 1 */
-/**/ halfrad = {{0x41600000, 0x00000000} }; /* 2**23 */
+ const number
+/**/ __mpsqrt_one = {{0x3ff00000, 0x00000000} }, /* 1 */
+/**/ __mpsqrt_halfrad = {{0x41600000, 0x00000000} }; /* 2**23 */
#else
#ifdef LITTLE_ENDI
- static const number
-/**/ one = {{0x00000000, 0x3ff00000} }, /* 1 */
-/**/ halfrad = {{0x00000000, 0x41600000} }; /* 2**23 */
+ const number
+/**/ __mpsqrt_one = {{0x00000000, 0x3ff00000} }, /* 1 */
+/**/ __mpsqrt_halfrad = {{0x00000000, 0x41600000} }; /* 2**23 */
#endif
#endif
-#define ONE one.d
-#define HALFRAD halfrad.d
+ const int __mpsqrt_mp[33] = {0,0,0,0,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4};
+#endif
- static const int mp[33] = {0,0,0,0,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,
- 4,4,4,4,4,4,4,4,4};
+#define ONE __mpsqrt_one.d
+#define HALFRAD __mpsqrt_halfrad.d
#endif
Modified: trunk/libc/sysdeps/ieee754/dbl-64/mptan.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/mptan.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/mptan.c Tue Oct 25 16:50:31 2011
@@ -1,8 +1,7 @@
-
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -38,10 +37,16 @@
#include "endian.h"
#include "mpa.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
int __mpranred(double, mp_no *, int);
void __c32(mp_no *, mp_no *, mp_no *, int);
-void __mptan(double x, mp_no *mpy, int p) {
+void
+SECTION
+__mptan(double x, mp_no *mpy, int p) {
static const double MONE = -1.0;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/s_atan.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/s_atan.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/s_atan.c Tue Oct 25 16:50:31 2011
@@ -46,7 +46,13 @@
void __mpatan(mp_no *,mp_no *,int); /* see definition in mpatan.c */
static double atanMp(double,const int[]);
-double __signArctan(double,double);
+
+ /* Fix the sign of y and return */
+static double __signArctan(double x,double y){
+ return __copysign(y, x);
+}
+
+
/* An ultimate atan() routine. Given an IEEE double machine number x, */
/* routine computes the correctly rounded (to nearest) value of atan(x). */
double atan(double x) {
@@ -54,7 +60,7 @@
double cor,s1,ss1,s2,ss2,t1,t2,t3,t7,t8,t9,t10,u,u2,u3,
v,vv,w,ww,y,yy,z,zz;
-#ifndef DLA_FMA
+#ifndef DLA_FMS
double t4,t5,t6;
#endif
#if 0
@@ -203,14 +209,6 @@
}
-
- /* Fix the sign of y and return */
-double __signArctan(double x,double y){
-
- if (x<ZERO) return -y;
- else return y;
-}
-
/* Final stages. Compute atan(x) by multiple precision arithmetic */
static double atanMp(double x,const int pr[]){
mp_no mpx,mpy,mpy2,mperr,mpt1,mpy1;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/s_ceil.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/s_ceil.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/s_ceil.c Tue Oct 25 16:50:31 2011
@@ -32,18 +32,17 @@
EXTRACT_WORDS(i0,i1,x);
j0 = ((i0>>20)&0x7ff)-0x3ff;
if(j0<20) {
- if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0<0) {i0=0x80000000;i1=0;}
- else if((i0|i1)!=0) { i0=0x3ff00000;i1=0;}
- }
+ if(j0<0) { /* raise inexact if x != 0 */
+ math_force_eval(huge+x);
+ /* return 0*sign(x) if |x|<1 */
+ if(i0<0) {i0=0x80000000;i1=0;}
+ else if((i0|i1)!=0) { i0=0x3ff00000;i1=0;}
} else {
i = (0x000fffff)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) i0 += (0x00100000)>>j0;
- i0 &= (~i); i1=0;
- }
+ math_force_eval(huge+x); /* raise inexact flag */
+ if(i0>0) i0 += (0x00100000)>>j0;
+ i0 &= (~i); i1=0;
}
} else if (j0>51) {
if(j0==0x400) return x+x; /* inf or NaN */
@@ -51,17 +50,16 @@
} else {
i = ((u_int32_t)(0xffffffff))>>(j0-20);
if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0>0) {
- if(j0==20) i0+=1;
- else {
- j = i1 + (1<<(52-j0));
- if(j<i1) i0+=1; /* got a carry */
- i1 = j;
- }
+ math_force_eval(huge+x); /* raise inexact flag */
+ if(i0>0) {
+ if(j0==20) i0+=1;
+ else {
+ j = i1 + (1<<(52-j0));
+ if(j<i1) i0+=1; /* got a carry */
+ i1 = j;
}
- i1 &= (~i);
}
+ i1 &= (~i);
}
INSERT_WORDS(x,i0,i1);
return x;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/s_expm1.c Tue Oct 25 16:50:31 2011
@@ -12,10 +12,6 @@
/* Modified by Naohiko Shimizu/Tokai University, Japan 1997/08/25,
for performance improvement on pipelined processors.
*/
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_expm1.c,v 1.8 1995/05/10 20:47:09 jtc Exp $";
-#endif
/* expm1(x)
* Returns exp(x)-1, the exponential of x minus 1.
@@ -40,38 +36,38 @@
* = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r))
* = 1 - r^2/60 + r^4/2520 - r^6/100800 + ...
* We use a special Reme algorithm on [0,0.347] to generate
- * a polynomial of degree 5 in r*r to approximate R1. The
+ * a polynomial of degree 5 in r*r to approximate R1. The
* maximum error of this polynomial approximation is bounded
* by 2**-61. In other words,
* R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5
- * where Q1 = -1.6666666666666567384E-2,
- * Q2 = 3.9682539681370365873E-4,
- * Q3 = -9.9206344733435987357E-6,
- * Q4 = 2.5051361420808517002E-7,
- * Q5 = -6.2843505682382617102E-9;
- * (where z=r*r, and the values of Q1 to Q5 are listed below)
+ * where Q1 = -1.6666666666666567384E-2,
+ * Q2 = 3.9682539681370365873E-4,
+ * Q3 = -9.9206344733435987357E-6,
+ * Q4 = 2.5051361420808517002E-7,
+ * Q5 = -6.2843505682382617102E-9;
+ * (where z=r*r, and the values of Q1 to Q5 are listed below)
* with error bounded by
* | 5 | -61
* | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2
* | |
*
* expm1(r) = exp(r)-1 is then computed by the following
- * specific way which minimize the accumulation rounding error:
+ * specific way which minimize the accumulation rounding error:
* 2 3
* r r [ 3 - (R1 + R1*r/2) ]
* expm1(r) = r + --- + --- * [--------------------]
- * 2 2 [ 6 - r*(3 - R1*r/2) ]
+ * 2 2 [ 6 - r*(3 - R1*r/2) ]
*
* To compensate the error in the argument reduction, we use
* expm1(r+c) = expm1(r) + c + expm1(r)*c
* ~ expm1(r) + c + r*c
* Thus c+r*c will be added in as the correction terms for
* expm1(r+c). Now rearrange the term to avoid optimization
- * screw up:
- * ( 2 2 )
- * ({ ( r [ R1 - (3 - R1*r/2) ] ) } r )
+ * screw up:
+ * ( 2 2 )
+ * ({ ( r [ R1 - (3 - R1*r/2) ] ) } r )
* expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- )
- * ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 )
+ * ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 )
* ( )
*
* = r - E
@@ -87,7 +83,7 @@
* (ii) if k=0, return r-E
* (iii) if k=-1, return 0.5*(r-E)-0.5
* (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E)
- * else return 1.0+2.0*(r-E);
+ * else return 1.0+2.0*(r-E);
* (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1)
* (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else
* (vii) return 2^k(1-((E+2^-k)-r))
@@ -116,11 +112,7 @@
#include "math.h"
#include "math_private.h"
#define one Q[0]
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
huge = 1.0e+300,
tiny = 1.0e-300,
o_threshold = 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */
@@ -134,12 +126,8 @@
4.00821782732936239552e-06, /* 3ED0CFCA 86E65239 */
-2.01099218183624371326e-07}; /* BE8AFDB7 6E09C32D */
-#ifdef __STDC__
- double __expm1(double x)
-#else
- double __expm1(x)
- double x;
-#endif
+double
+__expm1(double x)
{
double y,hi,lo,c,t,e,hxs,hfx,r1,h2,h4,R1,R2,R3;
int32_t k,xsb;
@@ -153,20 +141,20 @@
/* filter out huge and non-finite argument */
if(hx >= 0x4043687A) { /* if |x|>=56*ln2 */
if(hx >= 0x40862E42) { /* if |x|>=709.78... */
- if(hx>=0x7ff00000) {
+ if(hx>=0x7ff00000) {
u_int32_t low;
GET_LOW_WORD(low,x);
if(((hx&0xfffff)|low)!=0)
- return x+x; /* NaN */
+ return x+x; /* NaN */
else return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */
- }
- if(x > o_threshold) {
+ }
+ if(x > o_threshold) {
__set_errno (ERANGE);
return huge*huge; /* overflow */
}
}
if(xsb!=0) { /* x < -56*ln2, return -1.0 with inexact */
- if(x+tiny<0.0) /* raise inexact */
+ math_force_eval(x+tiny); /* raise inexact */
return tiny-one; /* return -1 */
}
}
@@ -187,7 +175,7 @@
x = hi - lo;
c = (hi-x)-lo;
}
- else if(hx < 0x3c900000) { /* when |x|<2**-54, return x */
+ else if(hx < 0x3c900000) { /* when |x|<2**-54, return x */
t = huge+x; /* return x with inexact flags when x!=0 */
return x - (t-(huge+x));
}
@@ -212,28 +200,28 @@
e -= hxs;
if(k== -1) return 0.5*(x-e)-0.5;
if(k==1) {
- if(x < -0.25) return -2.0*(e-(x+0.5));
- else return one+2.0*(x-e);
+ if(x < -0.25) return -2.0*(e-(x+0.5));
+ else return one+2.0*(x-e);
}
if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */
- u_int32_t high;
- y = one-(e-x);
+ u_int32_t high;
+ y = one-(e-x);
GET_HIGH_WORD(high,y);
SET_HIGH_WORD(y,high+(k<<20)); /* add k to y's exponent */
- return y-one;
+ return y-one;
}
t = one;
if(k<20) {
- u_int32_t high;
- SET_HIGH_WORD(t,0x3ff00000 - (0x200000>>k)); /* t=1-2^-k */
- y = t-(e-x);
+ u_int32_t high;
+ SET_HIGH_WORD(t,0x3ff00000 - (0x200000>>k)); /* t=1-2^-k */
+ y = t-(e-x);
GET_HIGH_WORD(high,y);
SET_HIGH_WORD(y,high+(k<<20)); /* add k to y's exponent */
} else {
- u_int32_t high;
+ u_int32_t high;
SET_HIGH_WORD(t,((0x3ff-k)<<20)); /* 2^-k */
- y = x-(e+t);
- y += one;
+ y = x-(e+t);
+ y += one;
GET_HIGH_WORD(high,y);
SET_HIGH_WORD(y,high+(k<<20)); /* add k to y's exponent */
}
Modified: trunk/libc/sysdeps/ieee754/dbl-64/s_floor.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/s_floor.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/s_floor.c Tue Oct 25 16:50:31 2011
@@ -41,18 +41,16 @@
j0 = ((i0>>20)&0x7ff)-0x3ff;
if(j0<20) {
if(j0<0) { /* raise inexact if x != 0 */
- if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
- if(i0>=0) {i0=i1=0;}
- else if(((i0&0x7fffffff)|i1)!=0)
- { i0=0xbff00000;i1=0;}
- }
+ math_force_eval(huge+x);/* return 0*sign(x) if |x|<1 */
+ if(i0>=0) {i0=i1=0;}
+ else if(((i0&0x7fffffff)|i1)!=0)
+ { i0=0xbff00000;i1=0;}
} else {
i = (0x000fffff)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) i0 += (0x00100000)>>j0;
- i0 &= (~i); i1=0;
- }
+ math_force_eval(huge+x); /* raise inexact flag */
+ if(i0<0) i0 += (0x00100000)>>j0;
+ i0 &= (~i); i1=0;
}
} else if (j0>51) {
if(j0==0x400) return x+x; /* inf or NaN */
@@ -60,17 +58,16 @@
} else {
i = ((u_int32_t)(0xffffffff))>>(j0-20);
if((i1&i)==0) return x; /* x is integral */
- if(huge+x>0.0) { /* raise inexact flag */
- if(i0<0) {
- if(j0==20) i0+=1;
- else {
- j = i1+(1<<(52-j0));
- if(j<i1) i0 +=1 ; /* got a carry */
- i1=j;
- }
+ math_force_eval(huge+x); /* raise inexact flag */
+ if(i0<0) {
+ if(j0==20) i0+=1;
+ else {
+ j = i1+(1<<(52-j0));
+ if(j<i1) i0 +=1 ; /* got a carry */
+ i1=j;
}
- i1 &= (~i);
}
+ i1 &= (~i);
}
INSERT_WORDS(x,i0,i1);
return x;
Modified: trunk/libc/sysdeps/ieee754/dbl-64/s_log1p.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/s_log1p.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/s_log1p.c Tue Oct 25 16:50:31 2011
@@ -12,10 +12,6 @@
/* Modified by Naohiko Shimizu/Tokai University, Japan 1997/08/25,
for performance improvement on pipelined processors.
*/
-
-#if defined(LIBM_SCCS) && !defined(lint)
-static char rcsid[] = "$NetBSD: s_log1p.c,v 1.8 1995/05/10 20:47:46 jtc Exp $";
-#endif
/* double log1p(double x)
*
@@ -34,14 +30,14 @@
* 2. Approximation of log1p(f).
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
- * = 2s + s*R
+ * = 2s + s*R
* We use a special Reme algorithm on [0,0.1716] to generate
- * a polynomial of degree 14 to approximate R The maximum error
+ * a polynomial of degree 14 to approximate R The maximum error
* of this polynomial approximation is bounded by 2**-58.45. In
* other words,
- * 2 4 6 8 10 12 14
+ * 2 4 6 8 10 12 14
* R(z) ~ Lp1*s +Lp2*s +Lp3*s +Lp4*s +Lp5*s +Lp6*s +Lp7*s
- * (the values of Lp1 to Lp7 are listed in the program)
+ * (the values of Lp1 to Lp7 are listed in the program)
* and
* | 2 14 | -58.45
* | Lp1*s +...+Lp7*s - R(z) | <= 2
@@ -52,7 +48,7 @@
* log1p(f) = f - (hfsq - s*(hfsq+R)).
*
* 3. Finally, log1p(x) = k*ln2 + log1p(f).
- * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
+ * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
* Here ln2 is split into two floating point number:
* ln2_hi + ln2_lo,
* where n*ln2_hi is always exact for |n| < 2000.
@@ -73,7 +69,7 @@
* to produce the hexadecimal values shown.
*
* Note: Assuming log() return accurate answer, the following
- * algorithm can be used to compute log1p(x) to within a few ULP:
+ * algorithm can be used to compute log1p(x) to within a few ULP:
*
* u = 1+x;
* if(u==1.0) return x ; else
@@ -85,11 +81,7 @@
#include "math.h"
#include "math_private.h"
-#ifdef __STDC__
static const double
-#else
-static double
-#endif
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
@@ -101,18 +93,10 @@
1.531383769920937332e-01, /* 3FC39A09 D078C69F */
1.479819860511658591e-01}; /* 3FC2F112 DF3E5244 */
-#ifdef __STDC__
static const double zero = 0.0;
-#else
-static double zero = 0.0;
-#endif
-#ifdef __STDC__
- double __log1p(double x)
-#else
- double __log1p(x)
- double x;
-#endif
+double
+__log1p(double x)
{
double hfsq,f,c,s,z,R,u,z2,z4,z6,R1,R2,R3,R4;
int32_t k,hx,hu,ax;
@@ -127,8 +111,8 @@
else return (x-x)/(x-x); /* log1p(x<-1)=NaN */
}
if(ax<0x3e200000) { /* |x| < 2**-29 */
- if(two54+x>zero /* raise inexact */
- &&ax<0x3c900000) /* |x| < 2**-54 */
+ math_force_eval(two54+x); /* raise inexact */
+ if (ax<0x3c900000) /* |x| < 2**-54 */
return x;
else
return x - x*x*0.5;
@@ -141,22 +125,22 @@
if(hx<0x43400000) {
u = 1.0+x;
GET_HIGH_WORD(hu,u);
- k = (hu>>20)-1023;
- c = (k>0)? 1.0-(u-x):x-(u-1.0);/* correction term */
+ k = (hu>>20)-1023;
+ c = (k>0)? 1.0-(u-x):x-(u-1.0);/* correction term */
c /= u;
} else {
u = x;
GET_HIGH_WORD(hu,u);
- k = (hu>>20)-1023;
+ k = (hu>>20)-1023;
c = 0;
}
hu &= 0x000fffff;
if(hu<0x6a09e) {
- SET_HIGH_WORD(u,hu|0x3ff00000); /* normalize u */
+ SET_HIGH_WORD(u,hu|0x3ff00000); /* normalize u */
} else {
- k += 1;
+ k += 1;
SET_HIGH_WORD(u,hu|0x3fe00000); /* normalize u/2 */
- hu = (0x00100000-hu)>>2;
+ hu = (0x00100000-hu)>>2;
}
f = u-1.0;
}
@@ -168,9 +152,9 @@
}
R = hfsq*(1.0-0.66666666666666666*f);
if(k==0) return f-R; else
- return k*ln2_hi-((R-(k*ln2_lo+c))-f);
+ return k*ln2_hi-((R-(k*ln2_lo+c))-f);
}
- s = f/(2.0+f);
+ s = f/(2.0+f);
z = s*s;
#ifdef DO_NOT_USE_THIS
R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
Modified: trunk/libc/sysdeps/ieee754/dbl-64/s_round.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/s_round.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/s_round.c Tue Oct 25 16:50:31 2011
@@ -1,5 +1,5 @@
/* Round double to integer away from zero.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -38,13 +38,12 @@
{
if (j0 < 0)
{
- if (huge + x > 0.0)
- {
- i0 &= 0x80000000;
- if (j0 == -1)
- i0 |= 0x3ff00000;
- i1 = 0;
- }
+ math_force_eval (huge + x > 0.0);
+
+ i0 &= 0x80000000;
+ if (j0 == -1)
+ i0 |= 0x3ff00000;
+ i1 = 0;
}
else
{
@@ -52,13 +51,12 @@
if (((i0 & i) | i1) == 0)
/* X is integral. */
return x;
- if (huge + x > 0.0)
- {
- /* Raise inexact if x != 0. */
- i0 += 0x00080000 >> j0;
- i0 &= ~i;
- i1 = 0;
- }
+ math_force_eval (huge + x > 0.0);
+
+ /* Raise inexact if x != 0. */
+ i0 += 0x00080000 >> j0;
+ i0 &= ~i;
+ i1 = 0;
}
}
else if (j0 > 51)
@@ -76,14 +74,13 @@
/* X is integral. */
return x;
- if (huge + x > 0.0)
- {
- /* Raise inexact if x != 0. */
- u_int32_t j = i1 + (1 << (51 - j0));
- if (j < i1)
- i0 += 1;
- i1 = j;
- }
+ math_force_eval (huge + x > 0.0);
+
+ /* Raise inexact if x != 0. */
+ u_int32_t j = i1 + (1 << (51 - j0));
+ if (j < i1)
+ i0 += 1;
+ i1 = j;
i1 &= ~i;
}
Modified: trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c (original)
+++ trunk/libc/sysdeps/ieee754/dbl-64/s_sin.c Tue Oct 25 16:50:31 2011
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001, 2009 Free Software Foundation
+ * Copyright (C) 2001, 2009, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -53,15 +53,24 @@
#include "mydefs.h"
#include "usncs.h"
#include "MathLib.h"
-#include "sincos.tbl"
#include "math_private.h"
+#ifndef SECTION
+# define SECTION
+#endif
+
+extern const union
+{
+ int4 i[880];
+ double x[440];
+} __sincostab attribute_hidden;
+
static const double
- sn3 = -1.66666666666664880952546298448555E-01,
- sn5 = 8.33333214285722277379541354343671E-03,
- cs2 = 4.99999999999999999999950396842453E-01,
- cs4 = -4.16666666666664434524222570944589E-02,
- cs6 = 1.38888874007937613028114285595617E-03;
+ sn3 = -1.66666666666664880952546298448555E-01,
+ sn5 = 8.33333214285722277379541354343671E-03,
+ cs2 = 4.99999999999999999999950396842453E-01,
+ cs4 = -4.16666666666664434524222570944589E-02,
+ cs6 = 1.38888874007937613028114285595617E-03;
void __dubsin(double x, double dx, double w[]);
void __docos(double x, double dx, double w[]);
@@ -87,7 +96,9 @@
/* An ultimate sin routine. Given an IEEE double machine number x */
/* it computes the correctly rounded (to nearest) value of sin(x) */
/*******************************************************************/
[... 2813 lines stripped ...]
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits