aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-02-16Fix remquo spurious overflows (bug 17978).Joseph Myers9-13/+78
Various remquo implementations, when computing the last three bits of the quotient, have spurious overflows when 4 times the second argument to remquo overflows. These overflows can in turn cause bad results in rounding modes where that overflow results in a finite value. This patch adds tests to avoid the problem multiplications in cases where they would overflow, similar to those that control an earlier multiplication by 8. Tested for x86_64, x86, mips64 and powerpc. [BZ #17978] * sysdeps/ieee754/dbl-64/s_remquo.c (__remquo): Do not form products 4 * y and 2 * y where those would overflow. * sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c (__remquo): Likewise. * sysdeps/ieee754/flt-32/s_remquof.c (__remquof): Likewise. * sysdeps/ieee754/ldbl-128/s_remquol.c (__remquol): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_remquol.c (__remquol): Likewise. * sysdeps/ieee754/ldbl-96/s_remquol.c (__remquol): Likewise. * math/libm-test.inc (remquo_test_data): Add more tests.
2015-02-16Fix MIPS _ABIO64 -Werror=undef build.Joseph Myers2-0/+6
I see an error ../sysdeps/mips/memcpy.S:209:68: error: "_ABIO64" is not defined [-Werror=undef] #if defined(_MIPS_SIM) && ((_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABIO64)) ^ cc1: some warnings being treated as errors in MIPS builds. This patch arranges for _ABIO64 to be defined with the same value as GCC uses when building for O64 (the ABI itself isn't supported by glibc, but defining the macro seems the simplest way of avoiding the error in code that may be shared with other C libraries). * sysdeps/mips/sgidefs.h [!_ABIO64] (_ABIO64): New macro.
2015-02-16Fix MIPS _COMPILING_NEWLIB -Werror=undef build.Joseph Myers4-3/+8
I see an error ../sysdeps/mips/strcmp.S:25:7: error: "_COMPILING_NEWLIB" is not defined [-Werror=undef] #elif _COMPILING_NEWLIB ^ cc1: some warnings being treated as errors in MIPS builds. (This is with GCC 4.9; it's possible that the DR#412 change in GCC 5 - see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60570> - means that -Wundef diagnostics no longer occur for #elif conditions where a previous group's condition was true, just as with other errors there.) This patch duly adjusts the conditionals to test whether _COMPILING_NEWLIB is defined. * sysdeps/mips/memcpy.S [_COMPILING_NEWLIB]: Change condition to [defined _COMPILING_NEWLIB]. * sysdeps/mips/memset.S [_COMPILING_NEWLIB]: Likewise. * sysdeps/mips/strcmp.S [_COMPILING_NEWLIB]: Likewise.
2015-02-16Fix MIPS __mips_isa_rev -Werror=undef build.Joseph Myers2-1/+6
I see an error In file included from ../sysdeps/mips/include/sys/asm.h:20:0, from ../sysdeps/mips/start.S:39: ../sysdeps/mips/sys/asm.h:421:5: error: "__mips_isa_rev" is not defined [-Werror=undef] #if __mips_isa_rev < 6 ^ cc1: some warnings being treated as errors in MIPS builds. As sys/asm.h is an installed header, it seems better to test for !defined __mips_isa_rev here, instead of defining it to 0 as done in sysdeps/unix/mips/sysdep.h, to avoid perturbing any code outside glibc that tests whether __mips_isa_rev is defined; this patch does so. * sysdeps/mips/sys/asm.h [__mips_isa_rev < 6]: Change condition to [!defined __mips_isa_rev || __mips_isa_rev < 6].
2015-02-16Make error checking effective in nptl/tst-cond25.c.Torvald Riegel2-1/+14
2015-02-15ia64: remove fixed page size macros and others [BZ #17792]Matthew Fortune3-8/+9
Remove IA64 PAGE_SIZE related macros as PAGE_SIZE is not defined. Also remove macros that are only used for BFD's trad-core support which is not relavant for IA64 according to the thread starting here: https://sourceware.org/ml/libc-ports/2013-11/msg00028.html This patch is neither built nor tested but is equivalent to a MIPS patch for the same fix.
2015-02-132015-02-13 Steve Ellcey <sellcey@imgtec.com>Steve Ellcey4-6/+12
* sysdeps/mips/bits/endian.h (__MIPSEB): Use #ifdef instead of #if. * sysdeps/mips/memcpy.S (__MIPSEB): Ditto. * sysdeps/mips/memset.S (__MIPSEB): Ditto.
2015-02-13Add placeholder c++-types.data and *.abilist files.Roland McGrath12-0/+36
2015-02-13Fix dbl-64/wordsize-64 remquo (bug 17569).Joseph Myers4-17/+34
The dbl-64/wordsize-64 remquo implementation follows similar logic to various other implementations, but where that logic computes some absolute values, it wrongly uses a previously computed bit-pattern for the absolute value of the first argument, where actually it needs the absolute value of the first argument mod 8 times the second. This patch fixes it to compute the correct absolute value. The integer quotient result of remquo is only specified mod 8 (including its sign); architecture-specific versions may well vary in what results they give for higher bits of that result (and indeed bug 17569 gives an example correct result from __builtin_remquo giving 9 for that result, where the particular glibc implementation used in that bug report would give 1 after this fix). Thus, this patch adapts the tests of remquo to test that result only mod 8, to allow for such variation when tests with higher quotient are included. Tested for x86_64 and x86. [BZ #17569] * sysdeps/ieee754/dbl-64/wordsize-64/s_remquo.c (__remquo): Compute absolute value of x as modified by fmod, not original value of x. * math/libm-test.inc (RUN_TEST_ffI_f1): Rename to RUN_TEST_ffI_f1_mod8. Check extra return value mod 8. (RUN_TEST_LOOP_ffI_f1): Rename to RUN_TEST_LOOP_ffI_f1_mod8. Call RUN_TEST_ffI_f1_mod8. (remquo_test_data): Add more tests.
2015-02-13NPTL: Initializer for .init_array-only configurations.Roland McGrath2-0/+27
2015-02-13Fix powerpc software sqrtf (bug 17967).Joseph Myers3-12/+20
Similarly to sqrt in <https://sourceware.org/ml/libc-alpha/2015-02/msg00353.html>, the powerpc sqrtf implementation for when _ARCH_PPCSQ is not defined also relies on a * b + c being contracted into a fused multiply-add. Although this contraction is not explicitly disabled for e_sqrtf.c, it still seems appropriate to make the file explicit about its requirements by using __builtin_fmaf; this patch does so. Furthermore, it turns out that doing so fixes the observed inaccuracy and missing exceptions (that is, that without explicit __builtin_fmaf usage, it was not being compiled as intended). Tested for powerpc32 (hard float). [BZ #17967] * sysdeps/powerpc/fpu/e_sqrtf.c (__slow_ieee754_sqrtf): Use __builtin_fmaf instead of relying on contraction of a * b + c.
2015-02-12[BZ #17969]J William Piggott3-3/+10
* manual/time.texi (TZ Variable): The zoneinfo path is /usr/share/zoneinfo.
2015-02-12Fix powerpc software sqrt (bug 17964).Joseph Myers3-16/+25
As Adhemerval noted in <https://sourceware.org/ml/libc-alpha/2015-01/msg00451.html>, the powerpc sqrt implementation for when _ARCH_PPCSQ is not defined is inaccurate in some cases. The problem is that this code relies on fused multiply-add, and relies on the compiler contracting a * b + c to get a fused operation. But sysdeps/ieee754/dbl-64/Makefile disables contraction for e_sqrt.c, because the implementation in that directory relies on *not* having contracted operations. While it would be possible to arrange makefiles so that an earlier sysdeps directory can disable the setting in sysdeps/ieee754/dbl-64/Makefile, it seems a lot cleaner to make the dependence on fused operations explicit in the .c file. GCC 4.6 introduced support for __builtin_fma on powerpc and other architectures with such instructions, so we can rely on that; this patch duly makes the code use __builtin_fma for all such fused operations. Tested for powerpc32 (hard float). 2015-02-12 Joseph Myers <joseph@codesourcery.com> [BZ #17964] * sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Use __builtin_fma instead of relying on contraction of a * b + c.
2015-02-12Use -Werror=undef for assembly code.Roland McGrath4-9/+14
2015-02-12Support after-link variable to run a final step on binaries.Roland McGrath4-12/+51
2015-02-12Document tv_sec is of type time_t:Rüdiger Sonderfeld3-3/+9
The tv_sec is of type time_t in both struct timeval and struct timespec. This matches the implementation and also the relevant standard (checked C11 for timespec and opengroup for timeval).
2015-02-12Fix exp2 spurious underflows (bug 16560).Joseph Myers9-3/+733
This patch fixes the remaining part of bug 16560, spurious underflows from exp2 of arguments close to 0 (when the result is close to 1, so should not underflow), by just using 1+x instead of a more complicated calculation when the argument is sufficiently small. Tested for x86_64, x86 and mips64. [BZ #16560] * math/e_exp2l.c [LDBL_MANT_DIG == 106] (LDBL_EPSILON): Undefine and redefine. (__ieee754_exp2l): Do not multiply small fractional parts by M_LN2l. * sysdeps/i386/fpu/e_exp2l.S (__ieee754_exp2l): Just add 1 to small argument. * sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Likewise. * sysdeps/ieee754/flt-32/e_exp2f.c (__ieee754_exp2f): Likewise. * sysdeps/x86_64/fpu/e_exp2l.S (__ieee754_exp2l): Likewise. * math/auto-libm-test-in: Add more tests of exp2. * math/auto-libm-test-out: Regenerated.
2015-02-12powerpc: POWER7 strncpy optimization for unaligned stringRajalakshmi Srinivasaraghavan2-2/+383
This patch optimizes strncpy for power7 for unaligned source or destination address. The source or destination address is aligned to doubleword and data is shifted based on the alignment and added with the previous loaded data to be written as a doubleword. For each load, cmpb instruction is used for faster null check. The new optimization shows 10 to 70% of performance improvement for longer string though it does not show big difference on string size less than 16 due to additional checks.Hence this new algorithm is restricted to string greater than 16.
2015-02-12powerpc: Fix TABORT encoding for little endianAdhemerval Zanella2-1/+6
This patch fix the TABORT encoding for toolchains with no support for HTM builtins.
2015-02-12Filter out PTHREAD_MUTEX_NO_ELISION_NP bit in pthread_mutexattr_gettype (BZ ↵Andreas Schwab5-3/+72
#15790) pthread_mutexattr_settype adds PTHREAD_MUTEX_NO_ELISION_NP to kind, which is an internal flag that pthread_mutexattr_gettype shouldn't expose, since pthread_mutexattr_settype wouldn't accept it.
2015-02-11Revert "hurd: Fix abi-tag, following ba90e05"Samuel Thibault4-1/+31
and revert the corresponding part of ba90e05 which was making the fix necessary. * abi-tags: Revert ae20c9a: rename back gnu into gnu-gnu. * configure.ac, configure: Revert ba90e05: modify gnu-* host_os back into gnu-gnu, and update comment to refer to abi-tags.
2015-02-11Fix sincos errno setting (bug 15467).Joseph Myers8-4/+34
This patch makes sincos set errno to EDOM when passed an infinity, similarly to sin and cos. Tested for x86_64, x86, powerpc and mips64. I don't know if the architecture-specific implementations for ia64 and m68k might need corresponding fixes. 2015-02-11 Joseph Myers <joseph@codesourcery.com> [BZ #15467] * sysdeps/ieee754/dbl-64/s_sincos.c: Include <errno.h>. (__sincos): Set errno to EDOM for infinite argument. * sysdeps/ieee754/flt-32/s_sincosf.c: Include <errno.h>. (SINCOSF_FUNC): Set errno to EDOM for infinite argument. * sysdeps/ieee754/ldbl-128/s_sincosl.c: Include <errno.h>. (__sincosl): Set errno to EDOM for infinite argument. * sysdeps/ieee754/ldbl-128ibm/s_sincosl.c: Include <errno.h>. (__sincosl): Set errno to EDOM for infinite argument. * sysdeps/ieee754/ldbl-96/s_sincosl.c: Include <errno.h>. (__sincosl): Set errno to EDOM for infinite argument. * math/libm-test.inc (sincos_test_data): Test errno setting.
2015-02-11Another pointless update in README.Roland McGrath1-1/+1
2015-02-11Pointless update in README.Roland McGrath1-1/+1
2015-02-11Remove unused definitionsLeonhard Holz5-4/+7
2015-02-10Remove sysdeps/mips soft-fp subdirectories.Joseph Myers8-3/+14
As noted in <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>, soft-fp sysdeps subdirectories (and more generally, subdirectories where sysdeps/foo/Implies contains foo/bar) are unnecessary and should be eliminated. This patch does so for MIPS. Tested for MIPS64 (all three ABIs, soft-float) that installed stripped shared libraries are unchanged by this patch. * sysdeps/mips/soft-fp/sfp-machine.h: Move to .... * sysdeps/mips/mips32/sfp-machine.h: ... here. * sysdeps/mips/mips64/soft-fp/Makefile: Move to .... * sysdeps/mips/mips64/Makefile: ... here. * sysdeps/mips/mips64/soft-fp/e_sqrtl.c: Move to .... * sysdeps/mips/mips64/e_sqrtl.c: ... here. * sysdeps/mips/mips64/soft-fp/sfp-machine.h: Move to .... * sysdeps/mips/mips64/sfp-machine.h: ... here. * sysdeps/mips/mips32/Implies: Remove mips/soft-fp. * sysdeps/mips/mips64/n32/Implies: Remove mips/mips64/soft-fp. * sysdeps/mips/mips64/n64/Implies: Likewise.
2015-02-10Clean up math/test-snan.Roland McGrath2-313/+85
2015-02-10Fix __memcpy_chk on non-SSE2 CPUsEvangelos Foutras3-3/+9
In commit 8b4416d, the 1: jump label in __mempcpy_chk was accidentally moved. This resulted in failures of mempcpy on CPU without SSE2.
2015-02-10powerpc: drop R_PPC_REL16 checkAdhemerval Zanella3-44/+3
Current minimum support binutils (2.22) supports R_PPC_REL16 as default, so no need to extra configure checks.
2015-02-10powerpc: sysdeps/powerpc configure cleanupAdhemerval Zanella3-54/+3
Current minimum binutils supported (2.22) has ".machine altivec" support as default, so there is no need to add a configure check for such functionality. This patches removes the configure checks for it.
2015-02-09Add fixed bug numbers to NEWSSamuel Thibault1-1/+1
2015-02-09powerpc: wordcopy/memmove cleanup for ppc32Adhemerval Zanella8-119/+44
This patch cleanup some multiarch code related to memmmove optimization. Initial IFUNC support added specialized wordcopy symbols which turned in local IFUNC calls used by memmove default implementation. The patch removes the internal IFUNC for wordcopy symbols and uses local branches in the memmmove optimization instead.
2015-02-09powerpc: multiarch Makefile cleanup for powerpc32Adhemerval Zanella2-4/+14
This patch cleanups the multiarch Makefile by putting the wide chars implementation to correct wcsmbs rule.
2015-02-09powerpc: wordcopy/memmove cleanup for ppc64Adhemerval Zanella6-95/+32
This patch cleanup some multiarch code related to memmmove optimization. Initial IFUNC support added specialized wordcopy symbols which turned in local IFUNC calls used by memmove default implementation. This change by removing then and used the optimized memmove instead for supported chips.
2015-02-09powerpc: Remove POWER7 wordcopy ifuncAdhemerval Zanella4-45/+18
This patch remove the POWER7 ifunc wordcopy function (_wordcopy_*_power7), since now GLIBC provides a optimized memmove/bcopy for POWER7.
2015-02-09powerpc: Simplify bcopy default implementationAdhemerval Zanella2-4/+10
This patch simplify the default bcopy symbol for powerpc64 by just using memmove instead of implementing using the default bcopy. Since the symbol is deprecated, it trades speed by code size.
2015-02-09powerpc: multiarch Makefile cleanup for powerpc64Adhemerval Zanella2-5/+16
This patch cleanups the multiarch Makefile by putting the wide chars implementation to correct wcsmbs rule.
2015-02-09Fix value of O_TMPFILE for architectures with non-default O_DIRECTORY (bug ↵Andreas Schwab3-2/+8
17912)
2015-02-08hurd: fix unwind-resume.c buildSamuel Thibault2-2/+8
2015-02-08hurd: fix unwind-resume.c buildSamuel Thibault2-0/+6
2015-02-08add hurd/hurdsocket.h file missing from a5eb23dSamuel Thibault1-0/+30
2015-02-08Fix time/getdate.c build.Samuel Thibault2-0/+5
2015-02-08hurd: Fix abi-tag, following ba90e05Samuel Thibault2-1/+2
2015-02-08hurd: fix tls.h buildSamuel Thibault2-0/+3
2015-02-08hurd: Ignore bytes beyond sockaddr length for AF_UNIXSamuel Thibault5-8/+22
2015-02-07Add ersatz _Static_assert on older C hostsPaul Eggert3-1/+14
* misc/sys/cdefs.h (_Static_assert): Define a substitute, if on a pre-C11 C platform that is not known to support _Static_assert.
2015-02-07hurd: fix compilation of signal.h in C++Samuel Thibault2-4/+5
2015-02-07hurd: fix compilation of signal.h in C++Samuel Thibault2-1/+3
2015-02-07hurd: add basic types for ioctlsSamuel Thibault2-1/+30
2015-02-07hurd: support mmap with PROT_NONESamuel Thibault2-2/+10