about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
...
* Add another test of asin.Joseph Myers2015-03-252-4/+4
| | | | | | | | | | | | This patch adds a randomly-generated test of asin that is observed to increase ulps on x86_64. Tested for x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add another test of asin. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Remove unused macros from i386 lowlevellock.h.Joseph Myers2015-03-251-18/+0
| | | | | | | | | | | | | | In the course of the work on six-argument syscalls I noticed that the i386 lowlevellock.h contained some unused macro definitions (already unused before my patch). This patch removes them. Tested for x86 that installed stripped shared libraries are unchanged by this patch. * sysdeps/unix/sysv/linux/i386/lowlevellock.h (LLL_EBX_LOAD): Remove macro. (LLL_EBX_REG): Likewise. (LLL_ENTER_KERNEL): Likewise.
* Add more tests of asin.Joseph Myers2015-03-252-0/+18
| | | | | | | | | | | | This patch adds some randomly-generated tests of asin that are observed to increase ulps on x86_64. Tested for x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add more tests of asin. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Support six-argument syscalls from C for 32-bit x86, use generic ↵Joseph Myers2015-03-255-153/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lowlevellock-futex.h (bug 18138). This patch follows the approach outlined in <https://sourceware.org/ml/libc-alpha/2015-03/msg00656.html> to support six-argument syscalls from INTERNAL_SYSCALL for 32-bit x86, making them call a function __libc_do_syscall that takes the syscall number and three syscall arguments in the registers in which the kernel expects them, along with a pointer to a structure containing the other three arguments. In turn, this allows the generic lowlevellock-futex.h to be used on 32-bit x86, so supporting lll_futex_timed_wait_bitset (and so allowing FUTEX_CLOCK_REALTIME to be used in various cases, so fixing bug 18138 for 32-bit x86 and leaving hppa as the only architecture missing lll_futex_timed_wait_bitset). The change to lowlevellock.h's definition of SYS_futex is because the generic lowlevelloc-futex.h ends up bringing in bits/syscall.h which defines SYS_futex to __NR_futex, so resulting in redefinition errors. The revised definition in lowlevellock.h is in line with what the x86_64 version does. __libc_do_syscall is only needed in libpthread at present (meaning nothing special needs to be done to make it shared-only in most libraries containing it, static in libc only, as on ARM). Tested for 32-bit x86, with the glibc testsuite and with the test in bug 18138. The failures seen FAIL: nptl/tst-cleanupx4 FAIL: rt/tst-cpuclock2 are pre-existing. [BZ #18138] * sysdeps/unix/sysv/linux/i386/sysdep.h (struct libc_do_syscall_args): New structure. (INTERNAL_SYSCALL_MAIN_0): New macro. (INTERNAL_SYSCALL_MAIN_1): Likewise. (INTERNAL_SYSCALL_MAIN_2): Likewise. (INTERNAL_SYSCALL_MAIN_3): Likewise. (INTERNAL_SYSCALL_MAIN_4): Likewise. (INTERNAL_SYSCALL_MAIN_5): Likewise. (INTERNAL_SYSCALL_MAIN_6): Likewise. Call __libc_do_syscall. (INTERNAL_SYSCALL): Define to use INTERNAL_SYSCALL_MAIN_##nr. Replace conditional definitions by conditional definitions of .... (INTERNAL_SYSCALL_MAIN_INLINE): ... this. New macro. * sysdeps/unix/sysv/linux/i386/libc-do-syscall.S: New file. * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = nptl] (libpthread-sysdep_routines): Add libc-do-syscall. * sysdeps/unix/sysv/linux/i386/lowlevellock-futex.h: Remove file. * sysdeps/unix/sysv/linux/i386/lowlevellock.h (SYS_futex): Define to __NR_futex not 240.
* powerpc __tls_get_addr call optimizationAlan Modra2015-03-2510-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is glibc support for a PowerPC TLS optimization, inspired by Alexandre Oliva's TLS optimization for other processors, http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt In essence, this optimization uses a zero module id in the tls_index GOT entry to indicate that a TLS variable is allocated space in the static TLS area. A special plt call linker stub for __tls_get_addr checks for such a tls_index and if found, returns the offset immediately. The linker communicates the fact that the special __tls_get_addr stub is used by setting a bit in the dynamic tag DT_PPC64_OPT/DT_PPC_OPT. glibc communicates to the linker that this optimization is available by the presence of __tls_get_addr_opt. tst-tlsmod2.so is built with -Wl,--no-tls-get-addr-optimize for tst-tls-dlinfo, which otherwise would fail since it tests that no static tls is allocated. The ld option --no-tls-get-addr-optimize has been available since binutils-2.20 so doesn't need a configure test. * NEWS: Advertise TLS optimization. * elf/elf.h (R_PPC_TLSGD, R_PPC_TLSLD, DT_PPC_OPT, PPC_OPT_TLS): Define. (DT_PPC_NUM): Increment. * elf/dynamic-link.h (HAVE_STATIC_TLS): Define. (CHECK_STATIC_TLS): Use here. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Optimize TLS descriptors. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/powerpc/dl-tls.c: New file. * sysdeps/powerpc/Versions: Add __tls_get_addr_opt. * sysdeps/powerpc/tst-tlsopt-powerpc.c: New tls test. * sysdeps/unix/sysv/linux/powerpc/Makefile: Add new test. Build tst-tlsmod2.so with --no-tls-get-addr-optimize. * sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist: Likewise.
* powerpc64 configure messageAlan Modra2015-03-252-3/+3
| | | | | | | | | This feature doesn't depend on the linker, as can be seen from the actual test. It's a compiler feature. * sysdeps/powerpc/powerpc64/configure.ac: Correct "linker support for overlapping .opd entries" to "support...". * sysdeps/powerpc/powerpc64/configure: Regenerate
* Add more tests of acos.Joseph Myers2015-03-252-12/+20
| | | | | | | | | | | | This patch adds some randomly-generated tests of acos that are observed to increase ulps on x86_64. Tested for x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add more tests of acos. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Add more tests of expm1.Joseph Myers2015-03-252-16/+16
| | | | | | | | | | | | This patch adds some randomly-generated tests of expm1 that are observed to increase ulps on x86_64. Tested for x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add more tests of expm1. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Add more tests of cosh, sinh.Joseph Myers2015-03-242-18/+31
| | | | | | | | | | | | This patch adds some randomly-generated tests of cosh and sinh that are observed to increase ulps on x86_64. Tested for x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add more tests of cosh and sinh. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Regenerate x86_64, x86 ulps from scratch.Joseph Myers2015-03-242-242/+39
| | | | | | | | | | | | | | | | | | | | | | | The x86_64 and x86 libm-test-ulps files hadn't been regenerated from scratch for some time, as evidenced by the presence of entries for *_tonearest functions (those tests duplicated the default-rounding-mode tests, and such duplicates are no longer run). The aarch64, alpha, hppa, ia64, m68k, microblaze, powerpc, s390, sh, sparc, tile files similarly could do with from-scratch regeneration as evidenced by the presence of such entries. (Truncate the existing file then run "make regen-ulps" and move the resulting file into place.) This patch regenerates the x86_64 and x86 files from scratch. It's likely some of the reduced / removed ulps will need restoring because they appear on processors or compiler versions other than the one I tested on, but in such cases I'd like to first see if I can generate new tests that show such ulps on the Intel processor I'm testing on, to reduce the effects from different people using different processors and compilers to regenerate the ulps. * sysdeps/i386/fpu/libm-test-ulps: Regenerated. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Add more tests of log2.Joseph Myers2015-03-242-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In testing for x86_64 on an AMD processor, I observed libm test failures of the form: testing long double (without inline functions) Failure: Test: log2_downward (0x2.b7e151628aed4p+0) Result: is: 1.44269504088896356633e+00 0xb.8aa3b295c17f67600000p-3 should be: 1.44269504088896356622e+00 0xb.8aa3b295c17f67500000p-3 difference: 1.08420217248550443400e-19 0x8.00000000000000000000p-66 ulp : 1.0000 max.ulp : 0.0000 Maximal error of `log2_downward' is : 1 ulp accepted: 0 ulp These issues arise because the maximum ulps when regenerating on one processor are not the same as on another processor, so regeneration on several processors may be needed when updating libm-test-ulps to avoid failures for some users testing glibc - but such regeneration on multiple processors is inconvenient. Causes can be: on x86 and, for x86_64, for long double, variation in results of x87 instructions for transcendental operations between processors; on x86, variation in compiler excess precision between compiler versions and configurations; on any processor where the compiler may contract expressions using fused multiply-add, variation in what contraction occurs. Although it's hard to be sure libm-test-ulps covers all ulps that may be seen in any configuration for the given architecture, in practice it helps simply to add wider test coverage to make it more likely that, when testing on one processor, the ulps seen are the biggest that can be seen for that function on that processor, and hopefully they are also the biggest that can be seen for that function in other configurations for that architecture. Thus, this patch adds some tests of log2 that increase the ulps I see on x86_64 on an Intel processor, so that hopefully future from-scratch regenerations on that processor will produce ulps big enough not to have errors from testing on AMD processors. These tests were found by randomly generating inputs and seeing what produced ulps larger than those currently in libm-test-ulps. Of course such increases also improve the accuracy of the empirical table of known ulps generated from libm-test-ulps files that goes in the manual. Tested for x86_64 and x86 and ulps updated accordingly. * math/auto-libm-test-in: Add more tests of log2. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* pthread_setaffinity (Linux variant): Rewrite to use VLA instead of allocaFlorian Weimer2015-03-231-15/+18
| | | | | | | extend_alloca was used to emulate VLA deallocation. The new version also handles the res == 0 corner case more explicitly, by returning 0 instead of the (potentially undefined, but usually zero) system call error.
* Remove HAVE_ASM_PPC_REL16 referencesAlan Modra2015-03-232-46/+3
| | | | | | | | | | | | | In bc0cdc498 the configure check for HAVE_ASM_PPC_REL16 was removed on the grounds that the minimum binutils supports rel16 relocs. This is true, but not all references to HAVE_ASM_PPC_REL16 in the sources were removed. * config.h.in: Remove HAVE_ASM_PPC_REL16. * sysdeps/powerpc/powerpc32/tls-macros.h: Remove HAVE_ASM_PPC_REL16 and false branch of conditional. * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Likewise.
* Fix warningsSamuel Thibault2015-03-218-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | * sysdeps/mach/hurd/Makefile ($(common-objpfx)errnos.d): Depend on libc-modules.h * sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Remove unused declaration of _hurd_intr_rpc_msg_in_trap. * mach/mach_init.c (__mach_init): Test whether HAVE_HOST_PAGE_SIZE is defined instead of whether it is non-zero. * sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Use "+m" input constraint instead of both input and output constraint. Use ecx clobber instead of %ecx. * sysdeps/mach/hurd/malloc-machine.h (mutex_init, mutex_lock, mutex_unlock): Use a statement expression instead of an expression list. * sysdeps/mach/hurd/setitimer.c (_hurd_itimer_thread_stack_size): Set type to vm_size_t instead of vm_address_t. * sysdeps/mach/hurd/fork.c (__fork): Test whether STACK_GROWTH_UP is defined instead of whether it is non-zero. * hurd/hurd/ioctl.h (_hurd_locked_install_cttyid): New declaration. * sysdeps/mach/hurd/setsid.c: Include <hurd/ioctl.h>. * sysdeps/mach/hurd/mmap.c (__mmap): Use 0 instead of NULL for comparisons with mapaddr. * nscd/nscd-client.h: Include <time.h>. * sysdeps/mach/hurd/dl-sysdep.c (fmh): Pass vm_offset_t dummy 9th parameter to __vm_region instead of int.
* Add missing dependencySamuel Thibault2015-03-211-1/+1
| | | | | * sysdeps/mach/hurd/Makefile ($(common-objpfx)errnos.d): Depend on libc-modules.h
* ARM: Fix memcpy & memmove for [ARM_ALWAYS_BX]Roland McGrath2015-03-192-6/+26
|
* linux-generic: add a READMEChris Metcalf2015-03-191-0/+11
|
* Preserve bound registers in _dl_runtime_resolveH.J. Lu2015-03-161-0/+8
| | | | | | | | | We need to add a BND prefix before indirect branch at the end of _dl_runtime_resolve to preserve bound registers. [BZ #18134] * sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New. (_dl_runtime_resolve): Add a BND prefix before indirect branch.
* m68k: fix 64-bit arithmetic in atomic operations (bug 18128)Andreas Schwab2015-03-141-8/+8
|
* ARM: Rewrite sysdeps/arm/tls-macros.hRoland McGrath2015-03-131-70/+64
|
* soft-fp: Define and use _FP_STATIC_ASSERT.Joseph Myers2015-03-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes soft-fp use static assertions in place of conditional calls to abort, in places where there are checks for conditions (on the types for which a macro is used) that the code is not prepared to handle. The fallback definition of _FP_STATIC_ASSERT (for kernel use only, as only relevant to compilers not supported for building glibc) is as in misc/sys/cdefs.h. This means that soft-fp only ever calls abort for _FP_UNREACHABLE calls in builds with GCC versions before 4.5. Thus, there is no need for an abort declaration or <stdlib.h> include, since the kernel code handles defining abort as a macro itself - and so this avoids any need for an __KERNEL__ condition on the abort declaration to avoid it breaking with the kernel's macro definition. That is, this patch is intended to make glibc's soft-fp code suitable for kernel use with no kernel-local changes to the soft-fp code needed at all. Tested for powerpc-nofpu that installed stripped shared libraries are unchanged by the patch. One explicit <stdlib.h> include had to be added to a file that was relying on the include from soft-fp.h. * soft-fp/soft-fp.h (_FP_STATIC_ASSERT): New macro. [_LIBC]: Do not include <stdlib.h>. [!_LIBC] (abort): Remove declaration. * soft-fp/op-2.h (_FP_MUL_MEAT_2_120_240_double): Use _FP_STATIC_ASSERT instead of conditionally calling abort. * soft-fp/op-common.h (_FP_FROM_INT): Likewise. (_FP_EXTEND_CNAN): Likewise. (FP_TRUNC): Likewise. (__FP_CLZ): Likewise. * sysdeps/powerpc/nofpu/flt-rounds.c: Include <stdlib.h>.
* S/390: Fix setcontext/swapcontext which are not restoring sigmask.Stefan Liebler2015-03-124-24/+12
|
* S/390: Regenerate ULPsStefan Liebler2015-03-121-10/+29
|
* powerpc: Remove HAVE_ASM_GLOBAL_DOT_NAME defineAdhemerval Zanella2015-03-115-90/+12
| | | | | | | | | With AIX port deprecated there is no need to check/define HAVE_ASM_GLOBAL_DOT_NAME anymore since the current minimum binutils supported (2.22) does not emit global symbol with dot. This patch removes all the HAVE_ASM_GLOBAL_DOT_NAME definition and checks for powerpc64 port.
* hppa: Fix feupdateenv and fesetexceptflag (Bug 18111).Carlos O'Donell2015-03-113-10/+34
| | | | | | | | | | The function feupdateenv has been fixed to correctly handle FE_DFL_ENV and FE_NOMASK_ENV. The fesetexceptflag function has been fixed to correctly handle setting the new flags instead of just OR-ing the existing flags. This fixes the test-fenv-return and test-fenvinline failures on hppa.
* hppa: Fix feholdexcpt and fesetenv (Bug 18110).John David Anglin2015-03-112-8/+6
| | | | | | | | | | | The constraints in the inline assembly in feholdexcept and fesetenv are incorrect. The assembly modifies the buffer pointer, but doesn't express that in the constraints. The simple fix is to remove the modification of the buffer pointer which is no longer required by the existing code, and adjust the one constraint that did express the modification of bufptr. The change fixes test-fenv when glibc is compiled with recent gcc.
* hppa: Update libm-test-ulps.Carlos O'Donell2015-03-101-0/+925
|
* powerpc: Fix incorrect results for pow when using FMAAdhemerval Zanella2015-03-101-0/+1
| | | | | This patch adds no FMA generation for e_pow to avoid precision issues for powerpc. This fixes BZ#18104.
* Update powerpc-fpu ULPs.Adhemerval Zanella2015-03-091-50/+66
|
* hurd: Make libc able to call pthread stubsSamuel Thibault2015-03-081-0/+6
| | | | | * sysdeps/mach/hurd/bits/libc-lock.h [_LIBC]: Include <bits/libc-lockP.h>
* Fix aio_error thread-safety.Samuel Thibault2015-03-062-8/+49
| | | | | | * sysdeps/pthread/aio_error.c: New file * sysdeps/pthread/aio_misc.c: Remove optimistic comment about synchronization.
* Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPYH.J. Lu2015-03-0517-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ELF_RTYPE_CLASS_NOCOPY in comments is a typo. It should be ELF_RTYPE_CLASS_COPY. [BZ #18082] * sysdeps/alpha/dl-machine.h (elf_machine_type_class): Replace ELF_RTYPE_CLASS_NOCOPY with ELF_RTYPE_CLASS_COPY in comments. * sysdeps/arm/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/hppa/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/ia64/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/microblaze/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/nios2/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/sh/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/tile/dl-machine.h (elf_machine_type_class): Likewise. * sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Likewise.
* Define ETH_ALEN in generic <netinet/if_ether.h>.Roland McGrath2015-03-041-3/+3
|
* powerpc: Fix inline feraiseexcept, feclearexcept macrosAdhemerval Zanella2015-03-031-20/+32
| | | | | | | This patch fixes the inline feraiseexcept and feclearexcept macros for powerpc by casting the input argument to integer before operation on it. It fixes BZ#17776.
* Deglobalize internal variables in timer_routines.c.Roland McGrath2015-03-021-3/+3
|
* Correct __ASSUME_PRLIMIT64 for hppa/microblaze/sh (bug 17779).Joseph Myers2015-03-023-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | __ASSUME_PRLIMIT64 is defined in kernel-features.h for kernels 2.6.36 and later, but hppa, microblaze and sh did not add the prlimit64 syscall until 2.6.37. This patch adds corresponding undefines of __ASSUME_PRLIMIT64 to those architectures' kernel-features.h files. (This concludes the kernel-features.h fixes arising out of the review - limited to macros defined in the architecture-independent kernel-features.h file - I did in connection with the move to 2.6.32 minimum kernel version. For that subset of macros - I didn't check any purely architecture-specific macros - I think they are now defined for the correct kernel versions on each architecture after this patch.) [BZ #17779] * sysdeps/unix/sysv/linux/hppa/kernel-features.h [__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64): Undefine. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h [__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h [__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64): Likewise.
* Fix ldbl-96, ldbl-128ibm atanhl inaccuracy (bug 18046, bug 18047).Joseph Myers2015-02-274-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | The threshold in ldbl-96 atanhl for when to return the argument, 0x1p-28, is a bit too big, and that in ldbl-128ibm atanhl is much too big (the relevant condition being x^3/3 being < 0.5ulp of x), resulting in errors a bit above the limits of those considered acceptable in glibc in the ldbl-96 case, and in large errors in the ldbl-128ibm case. This patch changes those implementations to use more appropriate thresholds and adds tests around the thresholds for various formats. Tested for x86_64, x86 and powerpc. x86_64 and x86 ulps updated accordingly. [BZ #18046] [BZ #18047] * sysdeps/ieee754/ldbl-128ibm/e_atanhl.c (__ieee754_atanhl): Use 0x1p-56L as threshold for just returning the argument. * sysdeps/ieee754/ldbl-96/e_atanhl.c (__ieee754_atanhl): Use 0x1p-32L as threshold for just returning the argument. * math/auto-libm-test-in: Add more tests of atanh. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulp: Likewise.
* hppa: fix __O_SYNC to match the kernelJohn David Anglin2015-02-271-1/+1
|
* Add comment to CSTR macro in k_standard.c.Joseph Myers2015-02-271-0/+1
| | | | * sysdeps/ieee754/k_standard.c (CSTR): Add comment.
* Avoid -Wno-write-strings for k_standard.c.Joseph Myers2015-02-262-81/+54
| | | | | | | | | | | | | | | | | | | We want to avoid -Wno- options in makefiles as far as possible, by cleaning up the underlying issues if possible or failing that by using diagnostic pragmas. This patch eliminates the use of -Wno-write-strings for sysdeps/ieee754/k_standard.c by using casts in the source file to cast away const; those casts are encapsulated in a macro that also deals with the choice of strings for float / double / long double functions (for which the logic was previously replicated many times). Tested for x86_64; the only change to disassembly of installed stripped shared libraries was a line number in an assertion. * sysdeps/ieee754/k_standard.c (CSTR): New macro. (__kernel_standard): Use CSTR macro when setting exc.name. * sysdeps/ieee754/Makefile [$(subdir) = math] (CFLAGS-k_standard.c): Remove variable.
* Avoid uninitialized warnings in Bessel functions.Joseph Myers2015-02-266-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | math/Makefile currently has: # The fdlibm code generates a lot of these warnings but is otherwise clean. override CFLAGS += -Wno-uninitialized This is of course undesirable; warnings should be disabled as narrowly as possible. To remove this override, we need to fix files that generate such warnings, or put warning-disabling pragmas in them. This patch does so for Bessel function implementations, one of the cases that have the warnings if the override is removed. The warnings arise because functions set pointer variables p and q only for certain values of the function argument, then use them unconditionally. As the static functions in question only get called for arguments that satisfy the last condition in the if/else chain, the natural fix is to change the last "else if" to just "else", which this patch does. (The ldbl-128 / ldbl-128ibm implementation of these functions is substantially different and looks like it already does use "else" in the last case in the nearest corresponding code.) Tested for x86_64 and x86. * sysdeps/ieee754/dbl-64/e_j0.c (pzero): Change last case for setting p and q from "else if" to "else". (qzero): Likewise. * sysdeps/ieee754/dbl-64/e_j1.c (pone): Likewise. (qone): Likewise. * sysdeps/ieee754/flt-32/e_j0f.c (pzerof): Likewise. (qzerof): Likewise. * sysdeps/ieee754/flt-32/e_j1f.c (ponef): Likewise. (qonef): Likewise. * sysdeps/ieee754/ldbl-96/e_j0l.c (pzero): Likewise. (qzero): Likewise. * sysdeps/ieee754/ldbl-96/e_j1l.c (pone): Likewise. (qone): Likewise.
* Fix ldbl-128/ldbl-128ibm acosl inaccuracy (bug 18038, bug 18039).Joseph Myers2015-02-262-2/+2
| | | | | | | | | | | | | | | | | | | | | The ldbl-128 and ldbl-128ibm implementations of acosl have similar bugs, using a threshold of 0x1p-57L to determine when they just return pi/2. Since the result pi/2 - asinl (x) is roughly pi/2 - x for small x, the relevant cut-off is actually x being < 0.5ulp of 1. This patch fixes the implementations to use that cut-off and adds tests of small acos arguments. Tested for powerpc and mips64. Also tested for x86_64 and x86; no ulps updates needed. [BZ #18038] [BZ #18039] * sysdeps/ieee754/ldbl-128/e_acosl.c (__ieee754_acosl): Only return pi/2 for arguments below 0x1p-113L. * sysdeps/ieee754/ldbl-128ibm/e_acosl.c (__ieee754_acosl): Only return pi/2 for arguments below 0x1p-106L. * math/auto-libm-test-in: Add more tests of acos. * math/auto-libm-test-out: Regenerated.
* Fix asin missing underflows (bug 16351).Joseph Myers2015-02-268-3/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to various other bugs in this area, some asin implementations do not raise the underflow exception for subnormal arguments, when the result is tiny and inexact. This patch forces the exception in a similar way to previous fixes. Tested for x86_64, x86, powerpc and mips64. [BZ #16351] * sysdeps/i386/fpu/e_asin.S (dbl_min): New object. (MO): New macro. (__ieee754_asin): Force underflow exception for results with small absolute value. * sysdeps/i386/fpu/e_asinf.S (flt_min): New object. (MO): New macro. (__ieee754_asinf): Force underflow exception for results with small absolute value. * sysdeps/ieee754/dbl-64/e_asin.c: Include <float.h> and <math.h>. (__ieee754_asin): Force underflow exception for results with small absolute value. * sysdeps/ieee754/flt-32/e_asinf.c: Include <float.h>. (__ieee754_asinf): Force underflow exception for results with small absolute value. * sysdeps/ieee754/ldbl-128/e_asinl.c: Include <float.h>. (__ieee754_asinl): Force underflow exception for results with small absolute value. * sysdeps/ieee754/ldbl-128ibm/e_asinl.c: Include <float.h>. (__ieee754_asinl): Force underflow exception for results with small absolute value. * sysdeps/ieee754/ldbl-96/e_asinl.c: Include <float.h>. (__ieee754_asinl): Force underflow exception for results with small absolute value. * sysdeps/x86_64/fpu/multiarch/e_asin.c [HAVE_FMA4_SUPPORT]: Include <math.h>. * math/auto-libm-test-in: Do not mark underflow exceptions as possibly missing for bug 16351. * math/auto-libm-test-out: Regenerated.
* Fix ldbl-128ibm logbl near powers of 2 (bug 18030).Joseph Myers2015-02-261-3/+14
| | | | | | | | | | | | | | | | | The ldbl-128ibm implementation of logbl produces incorrect results when the high part of the argument is a power of 2 and the low part a nonzero number with the opposite sign (and so the returned exponent should be 1 less than that of the high part). For example, logbl (0x1.ffffffffffffffp1L) returns 2 but should return 1. (This is similar to (fixed) bug 16740 for frexpl, and (fixed) bug 18029 for ilogbl.) This patch adds checks for that case. Tested for powerpc. [BZ #18030] * sysdeps/ieee754/ldbl-128ibm/s_logbl.c (__logbl): Adjust exponent of power of 2 down when low part has opposite sign. * math/libm-test.inc (logb_test_data): Add more tests.
* Fix ldbl-128ibm ilogbl near powers of 2 (bug 18029).Joseph Myers2015-02-261-4/+19
| | | | | | | | | | | | | | | | | | The ldbl-128ibm implementation of ilogbl produces incorrect results when the high part of the argument is a power of 2 and the low part a nonzero number with the opposite sign (and so the returned exponent should be 1 less than that of the high part). For example, ilogbl (0x1.ffffffffffffffp1L) returns 2 but should return 1. (This is similar to (fixed) bug 16740 for frexpl, and bug 18030 for logbl.) This patch adds checks for that case. Tested for powerpc. [BZ #18029] * sysdeps/ieee754/ldbl-128ibm/e_ilogbl.c (__ieee754_ilogbl): Adjust exponent of power of 2 down when low part has opposite sign. * math/libm-test.inc (ilogb_test_data): Add more tests.
* powerpc: Fix memmove static buildAdhemerval Zanella2015-02-251-1/+3
| | | | | | | This patch fixes the missing "__memcpy_ppc" symbol for memmove-ppc64 object in static builds. Since memcpy ifunc is not enabled in static mode, the specialized symbols are not provided. The patch changed the it to just "__memcpy" instead.
* Fix ldbl-128ibm asinhl inaccuracy (bug 18020).Joseph Myers2015-02-253-21/+22
| | | | | | | | | | | | | | | | | | | The ldbl-128ibm implementation of asinhl uses cut-offs of 0x1p28 and 0x1p-29 to determine when to use simpler formulas that avoid possible overflow / underflow. Both those cut-offs are inappropriate for this format, resulting in large errors. This patch changes the code to use more appropriate cut-offs of 0x1p56 and 0x1p-56, adding tests around the cut-offs for various floating-point formats. Tested for powerpc. Also tested for x86_64 and x86 and updated ulps. [BZ #18020] * sysdeps/ieee754/ldbl-128ibm/s_asinhl.c (__asinhl): Use 2**56 and 2**-56 not 2**28 and 2**-29 as thresholds for simpler formulas. * math/auto-libm-test-in: Add more tests of asinh. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* in.h: Coordinate in6_pktinfo and ip6_mtuinfo for kernel and glibc [BZ #15850]Cong Wang2015-02-251-4/+4
| | | | | | | | Similarly to what we did for in6_addr, we need a macro to guard in6_pktinfo and ip6_mtuinfo too. Cc: Carlos O'Donell <carlos@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
* Update timex.h for ADJ_SETOFFSET.Miroslav Lichvar2015-02-241-2/+3
| | | | | ADJ_SETOFFSET is a new adjtimex() mode that can be used to precisely step the clock. It was introduced in kernel 2.6.39.
* Fix ldbl-128ibm acoshl inaccuracy (bug 18019).Joseph Myers2015-02-253-4/+21
| | | | | | | | | | | | | | | | | | The ldbl-128ibm implementation of acoshl uses a cut-off of 0x1p28 to determine when to use log(x) + log(2) as a formula. That cut-off is too small for this format, resulting in large errors. This patch changes it to a more appropriate cut-off of 0x1p56, adding tests around the cut-offs for various floating-point formats. Tested for powerpc. Also tested for x86_64 and x86 and updated ulps. [BZ #18019] * sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (__ieee754_acoshl): Use 2**56 not 2**28 as threshold for log (2x) formula. * math/auto-libm-test-in: Add more tests of acosh. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.