about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
...
* Add more libm-test coverage of [a-c]* real functions.Joseph Myers2013-12-202-11/+1003
| | | | | | | | | | | | | | | | | | | | | | | | Various libm functions have inadequate test coverage in libm-test.inc / auto-libm-test-in - failing to cover all the usual special cases (infinities, NaNs, zero, large and small finite values, subnormals) as well as a reasonable range of ordinary inputs and, where appropriate, inputs close to the thresholds for underflow and overflow. This patch improves test coverage for real functions [a-c]* (with the expectation of adding more coverage for other functions later). Tested x86_64 and x86 and ulps updated accordingly (and eight glibc bugs and one C11 DR filed for issues found in the process). * math/auto-libm-test-in: Add more tests of acos, acosh, asin, asinh, atan, atan2, atanh, cbrt, cos and cosh. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (acosh_test_data): Add more tests. (atanh_test_data): Likewise. (ceil_test_data): Likewise. (copysign_test_data): Likewise. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Move tests of cpow from libm-test.inc to auto-libm-test-in.Joseph Myers2013-12-202-0/+89
| | | | | | | | | | | | | | | | | | | | This patch moves tests of cpow to auto-libm-test-in, adding the required support to gen-auto-libm-tests. Tested x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add tests of cpow. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (cpow_test_data): Use AUTO_TESTS_cc_c. * * math/gen-auto-libm-tests.c (func_calc_method): Add value mpc_cc_c. (func_calc_desc): Add mpc_cc_c union field. (test_functions): Add cpow. (special_fill_2pi): New function. (special_real_inputs): Add 2pi. (calc_generic_results): Handle mpc_cc_c. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Move various TEST_c_c tests from libm-test.inc to auto-libm-test-inc.Joseph Myers2013-12-202-86/+6849
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves tests of ccos, ccosh, cexp, clog, csqrt, ctan and ctanh to auto-libm-test-in, adding the required support to gen-auto-libm-tests. Other TEST_c_c functions aren't moved for now (although the relevant table entries are put in gen-auto-libm-tests for it to know how to handle them): clog10 because of a known MPC bug causing it to hang for at least some pure imaginary inputs (fixed in SVN, but I'd rather not rely on unreleased versions of MPFR or MPC even if relying on very recent releases); the inverse trig and hyperbolic functions because of known slowness in special cases; and csin / csinh because of observed slowness that I need to investigate and report to the MPC maintainers. Slowness can be bypassed by moving to incremental generation (only for new / changed tests) rather than regenerating the whole of auto-libm-test-out every time, but that needs implementing. (This patch takes the time for running gen-auto-libm-tests from about one second to seven, on my system, which I think is reasonable. The slow functions would make it take several minutes at least, which seems unreasonable.) Tested x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add tests of ccos, ccosh, cexp, clog, csqrt, ctan and ctanh. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (TEST_COND_x86_64): New macro. (TEST_COND_x86): Likewise. (ccos_test_data): Use AUTO_TESTS_c_c. (ccosh_test_data): Likewise. (cexp_test_data): Likewise. (clog_test_data): Likewise. (csqrt_test_data): Likewise. (ctan_test_data): Likewise. (ctan_tonearest_test_data): Likewise. (ctan_towardzero_test_data): Likewise. (ctan_downward_test_data): Likewise. (ctan_upward_test_data): Likewise. (ctanh_test_data): Likewise. (ctanh_tonearest_test_data): Likewise. (ctanh_towardzero_test_data): Likewise. (ctanh_downward_test_data): Likewise. (ctanh_upward_test_data): Likewise. * math/gen-auto-libm-tests.c (func_calc_method): Add value mpc_c_c. (func_calc_desc): Add mpc_c_c union field. (FUNC_mpc_c_c): New macro. (test_functions): Add cacos, cacosh, casin, casinh, catan, catanh, ccos, ccosh, cexp, clog, clog10, csin, csinh, csqrt, ctan and ctanh. (special_fill_min_subnorm_p120): New function. (special_real_inputs): Add min_subnorm_p120. (calc_generic_results): Handle mpc_c_c. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Consolidate code to compute sin and cos from lookup tablesSiddhesh Poyarekar2013-12-201-232/+129
| | | | | | | | | | | This patch consolidates the multiple copies of code that looks up sin and cos of a number from the lookup table and computes the final value, into static functions. This does not have a noticeable performance impact since the functions are inlined by gcc. There is further scope for consolidation in the functions but they cause a more noticable impact on performance (>5%) due to which I have held back on them.
* Remove more redundant computations in s_sin.cSiddhesh Poyarekar2013-12-201-42/+33
| | | | | | | | Removed more redundant computations in the slow paths of the sin and cos functions. The notable change is the passing of the most significant bits of X to the slow functions to check if X is positive so that just the absolute value of x can be passed and the repeated ABS() operation is avoided.
* Remove redundant arguments in reduce_and_computeSiddhesh Poyarekar2013-12-201-4/+4
| | | | | The A and DA arguments in reduce_and_compute are useless and hence have been removed.
* Remove some redundant computations in s_sin.cSiddhesh Poyarekar2013-12-201-24/+15
| | | | | | | | There are multiple points in the code where the absolute value of a number is computed multiple times or is computed even though the value can only be positive. This change removes those redundant computations. Tested on x86_64 to verify that there were no regressions in the testsuite.
* Don't make soft-fp symbols compat symbols for powerpc-nofpu.Joseph Myers2013-12-192-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sysdeps/powerpc/powerpc32/libgcc-compat.S makes certain symbols that glibc once accidentally reexported from libgcc into compat symbols. Where the exports were purely accidental, this is the right thing to do. However, for powerpc-nofpu the soft-fp symbols are deliberately exported from libc, given public versions in sysdeps/powerpc/nofpu/Versions and used by libm in preference to the libgcc versions that do not support the software exceptions and rounding modes. The libc versions should also be usable by user programs, though normally libgcc gets linked in first (meaning, effectively, that the <fenv.h> functions are broken as regards their expected effects on user arithmetic). A longstanding todo item is to remove the functions in question from libgcc (when built with recent enough glibc) - that is, remove them from static libgcc and make them compat symbols in shared libgcc - so that this works properly (this is one of the items mentioned at <http://gcc.gnu.org/wiki/Software_floating_point> - parts of that page are obviously out of date, but this item still applies). Doing this requires first that the functions are actually available from libc for new links, not just as compat symbols. This patch stops the symbols in question being compat symbols for powerpc-nofpu. The nofpu Versions entries for them are removed (the symbols never were exported at GLIBC_2.3.2, only GLIBC_2.0, because the compat symbols took precedence). Tested powerpc-nofpu. The symbols are no longer compat symbols and libm.so now properly gets undefined references to them (resolved to libc.so) instead of the libgcc copies getting linked into libm as before. * sysdeps/powerpc/powerpc32/libgcc-compat.S [_SOFT_FLOAT || __NO_FPRS__] (__fixdfdi_v_glibc20): Do not define as a macro and a compat symbol. [_SOFT_FLOAT || __NO_FPRS__] (__fixsfdi_v_glibc20): Likewise. [_SOFT_FLOAT || __NO_FPRS__] (__fixunsdfdi_v_glibc20): Likewise. [_SOFT_FLOAT || __NO_FPRS__] (__fixunssfdi_v_glibc20): Likewise. [_SOFT_FLOAT || __NO_FPRS__] (__floatdidf_v_glibc20): Likewise. [_SOFT_FLOAT || __NO_FPRS__] (__floaddisf_v_glibc20): Likewise. [HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixdfdi): Do not use .hidden. [HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixsfdi): Likewise. [HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixunsdfdi): Likewise. [HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixunssfdi): Likewise. [HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__floaddidf): Likewise. [HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__floaddisf): Likewise. * sysdeps/powerpc/nofpu/Versions (libc): Remove __fixdfdi, __fixsfdi, __fixunsdfdi, __fixunssfdi, __floatdidf and __floatdisf from GLIBC_2.3.2.
* Update powerpc-fpu ULPs.Adhemerval Zanella2013-12-191-0/+633
|
* Move tests of sincos from libm-test.inc to auto-libm-test-in.Joseph Myers2013-12-192-0/+12
| | | | | | | | | | | | | | | | | | | | This patch moves tests of sincos to auto-libm-test-in, adding the required support to gen-auto-libm-tests. Tested x86_64 and x86 and ulps updated accordingly. (auto-libm-test-out diffs omitted below.) * math/auto-libm-test-in: Add tests of sincos. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (sincos_test_data): Use AUTO_TESTS_fFF_11. * math/gen-auto-libm-tests.c (func_calc_method): Add value mpfr_f_11. (func_calc_desc): Add mpfr_f_11 union field. (test_functions): Add sincos. (calc_generic_results): Handle mpfr_f_11. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Fix uses of CALL_MCOUNT in ppc64 assembler sourcesAndreas Schwab2013-12-193-2/+6
|
* Disable libm-test test name beautification for M_* constants.Joseph Myers2013-12-192-0/+8
| | | | | | | | | | | | | | | | | | | | | math/gen-libm-test.pl has code to beautify names of various constants, transforming the source form in libm-test.inc into the version appearing in test names in libm-test-ulps files. This has become decreasingly relevant over time for the M_* constants, first as I changed the test names so only the arguments and not the expected results appeared in them, then as tests have moved to auto-libm-test-* so that automatically generated hex float constants get used instead of M_* in test inputs. This patch removes the beautification for all M_* constants. Tested x86_64 and x86 and ulps updated accordingly. Even the one case where this affected the name in the ulps files will disappear once complex function tests are moved to auto-libm-test-*. * math/gen-libm-test.pl (%beautify): Remove M_* constants. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293).Joseph Myers2013-12-196-0/+742
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug 16293 is inaccuracy of x86/x86_64 versions of expm1, near 0 in directed rounding modes, that arises from frndint rounding the exponent to 1 or -1 instead of 0, resulting in large cancellation error. This inaccuracy in turn affects other functions such as sinh that use expm1. This patch fixes the problem by setting round-to-nearest mode temporarily around the affected calls to frndint. I don't think this is needed for other uses of frndint, such as in exp itself, as only for expm1 is the cancellation error significant. Tested x86_64 and x86 and ulps updated accordingly. * sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Set round-to-nearest mode when using frndint. * sysdeps/i386/fpu/s_expm1.S (__expm1): Likewise. * sysdeps/i386/fpu/s_expm1f.S (__expm1f): Likewise. * sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Likewise. * math/auto-libm-test-in: Add more tests of expm1. Do not expect sinh test to fail. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (TEST_COND_x86_64): Remove macro. (TEST_COND_x86): Likewise. (expm1_tonearest_test_data): New array. (expm1_test_tonearest): New function. (expm1_towardzero_test_data): New array. (expm1_test_towardzero): New function. (expm1_downward_test_data): New array. (expm1_test_downward): New function. (expm1_upward_test_data): New array. (expm1_test_upward): New function. (main): Run the new test functions. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Patch 2/4 of the effort to make TLS access async-signal-safe.Paul Pluzhnikov2013-12-181-0/+6
| | | | | | | | | | | | | | | | | Add a signal-safe malloc replacement. 2013-12-18 Andrew Hunter <ahh@google.com> * sysdeps/generic/ldsodefs.h (__signal_safe_memalign): New prototype. (__signal_safe_malloc, __signal_safe_free): Likewise. (__signal_safe_realloc, __signal_safe_calloc): Likewise. * elf/dl-misc.c (__signal_safe_allocator_header): New struct. (__signal_safe_memalign, __signal_safe_malloc): New function. (__signal_safe_free, __signal_safe_realloc): Likewise. (__signal_safe_calloc): Likewise. * elf/dl-tls.c (allocate_dtv, _dl_clear_dtv): Call signal-safe functions. (_dl_deallocate_tls, _dl_update_slotinfo): Likewise.
* Patch 3/4 of the effort to make TLS access async-signal-safe.Paul Pluzhnikov2013-12-181-0/+5
| | | | | | | | | | | Factor out _dl_clear_dtv. 2013-12-18 Andrew Hunter <ahh@google.com> * elf/Versions (ld): Add _dl_clear_dtv. * sysdeps/generic/ldsodefs.h (_dl_clear_dtv): New prototype. * elf/dl-tls.c (_dl_clear_dtv): New function. * nptl/allocatestack.c (get_cached_stack): Call _dl_clear_dtv.
* Patch [1/4] async-signal safe TLS.Paul Pluzhnikov2013-12-184-0/+62
| | | | | | | | | | | | | 2013-12-18 Andrew Hunter <ahh@google.com> * sysdeps/generic/ldsodefs.h (_dl_mask_all_signals): New prototype. (_dl_unmask_signals): Likewise. * sysdeps/mach/hurd/dl-sysdep.h (_dl_mask_all_signals): New stub. (_dl_unmask_all_signals): Likewise. * sysdeps/unix/sysv/linux/dl-sysdep.h (_dl_mask_all_signals): New prototype. (_dl_unmask_all_signals): Likewise. * sysdeps/unix/sysv/linux/dl-sysdep.c (_dl_mask_all_signals): New function. (_dl_unmask_signals): Likewise.
* Move tests of jn and yn from libm-test.inc to auto-libm-test-in.Joseph Myers2013-12-182-4/+821
| | | | | | | | | | | | | | | | | | | | | | | | | This patch moves tests of jn and yn to auto-libm-test-in, adding the required support for gen-auto-libm-tests (and adding a missing assertion there and fixing logic that was broken for functions with integer arguments). Tested x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add tests of jn and yn. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (jn_test_data): Use AUTO_TESTS_if_f. (yn_test_data): Likewise. * math/gen-auto-libm-tests.c (func_calc_method): Add value mpfr_if_f. (func_calc_desc): Add mpfr_if_f union field. (FUNC_mpfr_if_f): New macro. (test_functions): Add jn and yn. (calc_generic_results): Assert type of second input for mpfr_ff_f. Handle mpfr_if_f. (output_for_one_input_case): Disable all checking for arguments fitting floating-point types in case of an integer argument. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Update powerpc-nofpu localplt.data for fegetround hidden_proto / hidden_def.Joseph Myers2013-12-181-1/+0
| | | | | | | | | | My recent changes that added libm_hidden_proto / libm_hidden_def for fegetround had the side effect of removing the need for a localplt.data entry for fegetround for powerpc-nofpu. This patch removes that entry. Tested powerpc-nofpu. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/localplt.data: Don't expect fegetround reference in libm.so.
* Compile e_sqrt.c with -ffp-contract=off.Marcus Shawcroft2013-12-181-0/+1
|
* Fix ldbl-128 logl for subnormals (bug 16338).Joseph Myers2013-12-183-3/+8
| | | | | | | | | | | | | | | | | | | | | | This patch fixes bug 16338, ldbl-128 logl not handling subnormals (with consequent inaccuracy for lgammal as well). The fix is simply to use __frexpl when determining the exponent, as done already in log2l and log10l. Given the lack of testing of small arguments to any of the log* functions, appropriate tests are added for all of them. Tested x86_64 and x86 and ulps updated accordingly, and spot tests also run for mips64 to confirm the ldbl-128 fix. Note that while this fixes lgammal inaccuracy for small positive arguments, I suspect that there will still be problems with spurious underflows in that case. * sysdeps/ieee754/ldbl-128/e_logl.c (__ieee754_logl): Use __frexpl to determine exponent and adjust argument to have exponent of -1. * math/auto-libm-test-in: Add more tests of log, log10, log1p and log2. * math/auto-libm-test-out: Regenerated. * sysdeps/x86_64/fpu/libm-test-ulps: Update.
* Remove use of SSE4.2 functions for strstr on i686Andreas Schwab2013-12-186-49/+2
| | | | | The SSE4.2 have been removed from x86_64 by commit 584b18eb. This patch fixes the build on i686, which attempts to use the removed files.
* Remove unused files from sysdeps/unix/bsd/bsd4.4/bits/.Joseph Myers2013-12-172-452/+0
|
* Remove various unused files from sysdeps/unix/bsd/.Joseph Myers2013-12-1727-1534/+0
|
* Remove __FAVOR_BSD.Joseph Myers2013-12-172-75/+78
|
* Update powerpc-fpu ULPs.Adhemerval Zanella2013-12-171-2/+380
|
* Fix dbl-64 hypot spurious underflows (bug 16314).Joseph Myers2013-12-171-1/+1
|
* Fix hypot handling of subnormals (bug 16316, bug 16330).Joseph Myers2013-12-173-0/+33
|
* Make soft-float sh use soft-fp fma/fmaf.Kaz Kojima2013-12-174-0/+66
|
* Move tests of atan2, hypot and pow from libm-test.inc to auto-libm-test-in.Joseph Myers2013-12-162-0/+273
|
* Minor code cleanup in s_sin.cSiddhesh Poyarekar2013-12-161-20/+13
| | | | | | | - Remove redundant mynumber union definitions - Clean up a clumsy ternary operator - Rename TAYLOR_SINCOS to TAYLOR_SIN since we're only expanding the sin Taylor series in it.
* Update file name in x86_64 ifunc listAllan McRae2013-12-161-1/+1
| | | | File name update missed in commit 584b18eb.
* Add strstr with unaligned loads. Fixes bug 12100.Ondřej Bílka2013-12-148-494/+415
| | | | | | | | | | A sse42 version of strstr used pcmpistr instruction which is quite ineffective. A faster way is look for pairs of characters which is uses sse2, is faster than pcmpistr and for real strings a pairs we look for are relatively rare. For linear time complexity we use buy or rent technique which switches to two-way algorithm when superlinear behaviour is detected.
* Move sysdeps/sh/sh4/fpu/bits/fenv.h to sysdeps/sh/bits/.Kaz Kojima2013-12-141-0/+0
|
* PowerPC: multiarch hypot/hypotf for PowerPC64Adhemerval Zanella2013-12-137-1/+158
|
* PowerPC: multiarch modf/modff for PowerPC64Adhemerval Zanella2013-12-137-2/+173
|
* PowerPC: multiarch logb/logbl/logbf for PowerPC64Adhemerval Zanella2013-12-1310-1/+244
|
* PowerPC: multiarch isinf/isinff for PowerPC64Adhemerval Zanella2013-12-136-2/+178
|
* PowerPC: multiarch finite/finitef for PowerPC64Adhemerval Zanella2013-12-136-2/+186
|
* PowerPC: multiarch llrint/lrint for PowerPC64Adhemerval Zanella2013-12-135-1/+122
|
* PowerPC: multiarch copysign/copysignf for PowerPC64Adhemerval Zanella2013-12-135-2/+155
|
* PowerPC: multiarch trunc/truncf for PowerPC64Adhemerval Zanella2013-12-137-1/+188
|
* PowerPC: multiarch round/roundf for PowerPC64Adhemerval Zanella2013-12-137-1/+188
|
* PowerPC: multiarch floor/floorf for PowerPC64Adhemerval Zanella2013-12-137-1/+190
|
* PowerPC: multiarch ceil/ceilf for PowerPC64Adhemerval Zanella2013-12-137-1/+188
|
* PowerPC: multiarch llround/lround for PowerPC64Adhemerval Zanella2013-12-136-1/+155
|
* PowerPC: multiarch isnan/isnanf for PowerPC64Adhemerval Zanella2013-12-138-0/+264
|
* PowerPC: Adjust multiarch Implies for PowerPC64Adhemerval Zanella2013-12-136-2/+5
| | | | | | This patch adds Implies files on multiarch folder for POWER chips so multirach is enabled when building with --with-cpu and powerN option.
* PowerPC: Cleaning up uneeded sqrt routinesAdhemerval Zanella2013-12-134-202/+0
| | | | | | | | For PPC64, all the wrappers at sysdeps are superfluous: they are basically the same implementation from math/w_sqrt.c with the '#ifdef _IEEE_LIBM'. And the power4 version just force the 'fsqrt' instruction utilization with an inline assembly, which is already handled by math_private.h __ieee754_sqrt implementation.
* PowerPC: multiarch stpcpy for PowerPC64Adhemerval Zanella2013-12-135-1/+130
|
* PowerPC: multiarch strcpy for PowerPC64Adhemerval Zanella2013-12-135-1/+123
|