]> sourceware.org Git - glibc.git/log
glibc.git
7 years agoFix warning caused by unused-result in bug-atexit3-lib.cc
Gabriel F T Gomes [Fri, 28 Oct 2016 17:57:15 +0000 (15:57 -0200)]
Fix warning caused by unused-result in bug-atexit3-lib.cc

The test case dlfcn/bug-atexit3-lib.cc calls write and doesn't check the
result.  When building with GCC 6.2, this generates a warning in 'make
check', which is treated as an error.  This patch replaces the call to
write with a call to write_message.

Tested for powerpc64le.

7 years agoAdd SNAN, SNANF, SNANL macros.
Joseph Myers [Fri, 28 Oct 2016 21:15:26 +0000 (21:15 +0000)]
Add SNAN, SNANF, SNANL macros.

TS 18661-1 defines SNAN macros for signaling NaN values, suitable for
use in static initializers.  This patch adds them to glibc's <math.h>
(provided you are building with GCC 3.3 or later; no attempt is made
to provide any kind of nonconforming fallback for older compilers
without the __builtin_nans functions).

Tested for x86_64 and x86.

* math/math.h
[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANF):
New macro.
[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNAN):
Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANL):
Likewise.
* manual/arith.texi (Infinity and NaN): Document SNANF, SNAN and
SNANL.
* math/test-double.h (snan_value_MACRO): New macro.
* math/test-float.h (snan_value_MACRO): Likewise.
* math/test-ldouble.h (snan_value_MACRO): Likewise.
* math/libm-test.inc (issignaling_test_data): Add tests of
snan_value_MACRO.

7 years agoDocument a behavior of an elided pthread_rwlock_unlock
Tulio Magno Quites Machado Filho [Fri, 28 Oct 2016 20:31:24 +0000 (18:31 -0200)]
Document a behavior of an elided pthread_rwlock_unlock

Explain that pthread_rwlock_unlock may crash if called on a lock not
held by the current thread.

7 years agopowerpc: Fix TOC stub on powerpc64 clone()
Tulio Magno Quites Machado Filho [Fri, 21 Oct 2016 17:19:10 +0000 (15:19 -0200)]
powerpc: Fix TOC stub on powerpc64 clone()

Use a function call to _exit() so that the linker can create a TOC stub
instead of just a branch.

Tested on powerpc64.

7 years agomalloc: Update comments about chunk layout
Florian Weimer [Fri, 28 Oct 2016 20:36:58 +0000 (22:36 +0200)]
malloc: Update comments about chunk layout

7 years agocrypt: Use internal names for the SHA-2 block functions
Florian Weimer [Fri, 28 Oct 2016 19:47:44 +0000 (21:47 +0200)]
crypt: Use internal names for the SHA-2 block functions

These functions are externally visible with a static libcrypt
library.

7 years agoFix building tst-linkall-static.
Carlos O'Donell [Fri, 28 Oct 2016 18:27:52 +0000 (14:27 -0400)]
Fix building tst-linkall-static.

The crypt/ directory is not added as part of the sysdep directories.
Add it when building tst-linkall-static to include crypt.h.

7 years agoAdd missing include for stdlib.h.
Carlos O'Donell [Fri, 28 Oct 2016 16:43:15 +0000 (12:43 -0400)]
Add missing include for stdlib.h.

The test math/test-nan-overflow uses malloc without including
stdlib.h. On -Os builds for i486 the header inclusion order
is altered enough that the test fails to build because of the
warning which is turned into an error.

The obvious fix is to include stdlib.h since malloc is being
used directly.

7 years agoCheck IFUNC definition in unrelocated shared library [BZ #20019]
H.J. Lu [Fri, 28 Oct 2016 16:11:55 +0000 (09:11 -0700)]
Check IFUNC definition in unrelocated shared library [BZ #20019]

Calling an IFUNC function defined in unrelocated shared library may
lead to segfault.  This patch issues an error message to request
relinking the shared library if it references IFUNC function defined
in the unrelocated shared library.

[BZ #20019]
* sysdeps/i386/dl-machine.h (elf_machine_rel): Check IFUNC
definition in unrelocated shared library.
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.

7 years agoi386: Support CFLAGS which imply -fno-omit-frame-pointer [BZ #20729]
Florian Weimer [Fri, 28 Oct 2016 15:04:57 +0000 (17:04 +0200)]
i386: Support CFLAGS which imply -fno-omit-frame-pointer [BZ #20729]

7 years agoAdd test for linking against most static libraries
Florian Weimer [Fri, 28 Oct 2016 12:03:57 +0000 (14:03 +0200)]
Add test for linking against most static libraries

7 years agosysmalloc: Initialize previous size field of mmaped chunks
Florian Weimer [Thu, 27 Oct 2016 17:45:19 +0000 (19:45 +0200)]
sysmalloc: Initialize previous size field of mmaped chunks

With different encodings of the header, the previous zero initialization
may be insufficient and produce an invalid encoding.

7 years agomalloc: Use accessors for chunk metadata access
Florian Weimer [Fri, 28 Oct 2016 14:26:57 +0000 (16:26 +0200)]
malloc: Use accessors for chunk metadata access

This change allows us to change the encoding of these struct members
in a centralized fashion.

7 years agoMake strtod raise "inexact" exceptions (bug 19380).
Joseph Myers [Fri, 28 Oct 2016 00:40:23 +0000 (00:40 +0000)]
Make strtod raise "inexact" exceptions (bug 19380).

The strtod function should raise the "inexact" exception when its
result is inexact, but fails to do so except in the case of underflow
or overflow.  This patch fixes it to do so for all inexact results.

tst-strtod-round is extended to test for this exception; the generator
is fixed to properly mark inexact results as such in the case where
the inexactness is from the mpfr_subnormalize step.

Tested for x86_64, x86 and powerpc.

[BZ #19380]
* stdlib/strtod_l.c (round_and_return): Force "inexact" exception
for inexact results.
* stdlib/gen-tst-strtod-round.c (string_to_fp): Return indication
of inexact result where mpfr_subnormalize is the only inexact
step.
* stdlib/tst-strtod-round-data.h: Regenerated.
* stdlib/tst-strtod-round-skeleton.c [!FE_INEXACT] (FE_INEXACT):
Define to 0.
(GEN_ONE_TEST): Test inexact exceptions raised are as expected.

7 years agoFix a sparc header conformtest failure.
David S. Miller [Thu, 27 Oct 2016 14:57:49 +0000 (07:57 -0700)]
Fix a sparc header conformtest failure.

* sysdeps/unix/sysv/linux/sparc/sys/user.h: Include stddef.h

7 years agoStatic inline functions for mallopt helpers
Siddhesh Poyarekar [Thu, 27 Oct 2016 03:04:55 +0000 (08:34 +0530)]
Static inline functions for mallopt helpers

Make mallopt helper functions for each mallopt parameter so that it
can be called consistently in other areas, like setting tunables.

* malloc/malloc.c (do_set_mallopt_check): New function.
(do_set_mmap_threshold): Likewise.
(do_set_mmaps_max): Likewise.
(do_set_top_pad): Likewise.
(do_set_perturb_byte): Likewise.
(do_set_trim_threshold): Likewise.
(do_set_arena_max): Likewise.
(do_set_arena_test): Likewise.
(__libc_mallopt): Use them.

7 years agoAdd canonicalize, canonicalizef, canonicalizel.
Joseph Myers [Wed, 26 Oct 2016 23:14:31 +0000 (23:14 +0000)]
Add canonicalize, canonicalizef, canonicalizel.

TS 18661-1 defines canonicalize functions to produce a canonical
version of a floating-point representation.  This patch implements
these functions for glibc.

As with the iscanonical macro, these functions are oriented to the
decimal floating-point case, where some values have both canonical and
noncanonical representations.  However, the functions have a return
value that says whether they succeeded in storing a canonical result;
thus, they can fail for the case of an invalid representation (while
still not making any particular choice from among multiple equally
canonical valid representations of the same value).  Since no
floating-point formats in glibc actually have noncanonical valid
representations, a type-generic implementation of these functions can
be used that expects iscanonical to return 0 only for invalid
representations.  Now that iscanonical is used within libm.so,
libm_hidden_proto / libm_hidden_def are added for __iscanonicall.

The definition of these functions is intended to correspond to a
convertFormat operation to the same floating-point format.  Thus, they
convert signaling NaNs to quiet NaNs, raising the "invalid" exception.
Such a conversion "should" produce "the canonical version of that
signaling NaN made quiet".

libm-test.inc is made to check NaN payloads for the output of these
functions, a new feature (at some point manipulation functions such as
fabs and copysign should have tests added that verify payload
preservation for them).  As however some architectures may not follow
the recommended practice of preserving NaN payloads when converting a
signaling NaN to quiet, a new math-tests.h macro
SNAN_TESTS_PRESERVE_PAYLOAD is added, and defined to 0 for non-NAN2008
MIPS; any other architectures seeing test failures for lack of payload
preservation in this case should also define this macro to 0.  (If any
cases arise where the sign isn't preserved either, those should have a
similar macro added.)

The ldbl-96 and ldbl-128ibm tests of iscanonical are renamed and
adapted to test canonicalizel as well on the same representations.

Tested for x86_64, x86, mips64 and powerpc.

* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(canonicalize): New declaration.
* math/Versions (canonicalize): New libm symbol at version
GLIBC_2.25.
(canonicalizef): Likewise.
(canonicalizel): Likewise.
* math/Makefile (gen-libm-calls): Add s_canonicalizeF.
* math/s_canonicalize_template.c: New file.
* math/libm-test.inc: Update comment on functions tested and
testing of NaN payloads.
(TEST_NAN_PAYLOAD): New macro.
(NO_TEST_INLINE): Update value.
(XFAIL_TEST): Likewise.
(ERRNO_UNCHANGED): Likewise.
(ERRNO_EDOM): Likewise.
(ERRNO_ERANGE): Likewise.
(IGNORE_RESULT): Likewise.
(NON_FINITE): Likewise.
(TEST_SNAN): Likewise.
(NO_TEST_MATHVEC): Likewise.
(TEST_NAN_PAYLOAD_CANONICALIZE): New macro.
(check_float_internal): Check NaN payloads if TEST_NAN_PAYLOAD.
(struct test_Ffp_b1_data): New type.
(RUN_TEST_Ffp_b1): New macro.
(RUN_TEST_LOOP_Ffp_b1): Likewise.
(canonicalize_test_data): New array.
(canonicalize_test): New function.
(main): Call canonicalize_test.
* manual/arith.texi (FP Bit Twiddling): Document canonicalize,
canonicalizef and canonicalizel.
* manual/libm-err-tab.pl: Update comment on interfaces without
ulps tabulated.
* sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c: New file.
* sysdeps/ieee754/ldbl-opt/s_canonicalizel.c: Likewise.
* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
canonicalize.
(CFLAGS-nldbl-canonicalize.c): New variable.
* sysdeps/ieee754/ldbl-128ibm/test-iscanonical-ldbl-128ibm.c: Move
to ...
* sysdeps/ieee754/ldbl-128ibm/test-canonical-ldbl-128ibm.c:
... here.
(do_test): Also test canonicalizel.
* sysdeps/ieee754/ldbl-128ibm/Makefile (tests): Change
test-iscanonical-ldbl-128ibm to test-canonical-ldbl-128ibm.
* sysdeps/ieee754/ldbl-128ibm/include/bits/iscanonical.h: New
file.
* sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c (__iscanonicall):
Use libm_hidden_def.
* sysdeps/ieee754/ldbl-96/test-iscanonical-ldbl-96.c: Move to ...
* sysdeps/ieee754/ldbl-96/test-canonical-ldbl-96.c: ... here.
(do_test): Also test canonicalizel.
* sysdeps/ieee754/ldbl-96/Makefile (tests): Change
test-iscanonical-ldbl-96 to test-canonical-ldbl-96.
* sysdeps/ieee754/ldbl-96/include/bits/iscanonical.h: New file.
* sysdeps/ieee754/ldbl-96/s_iscanonicall.c (__iscanonicall): Use
libm_hidden_def.
* sysdeps/generic/math-tests.h (SNAN_TESTS_PRESERVE_PAYLOAD): New
macro.
* sysdeps/mips/math-tests.h [__mips_hard_float && !__mips_nan2008]
(SNAN_TESTS_PRESERVE_PAYLOAD): Likewise.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.

7 years agoAdd getpayloadl to libnldbl.
Joseph Myers [Wed, 26 Oct 2016 17:10:00 +0000 (17:10 +0000)]
Add getpayloadl to libnldbl.

This patch adds getpayloadl to libnldbl, missed in my patch that
originally implemented getpayload functions.

Tested for powerpc.

* sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c: New file.
* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
getpayload.
(CFLAGS-nldbl-getpayload.c): New variable.

7 years agoUse read_int in vfscanf
Gabriel F. T. Gomes [Tue, 20 Sep 2016 17:19:27 +0000 (14:19 -0300)]
Use read_int in vfscanf

The function read_int, from printf-parse.h, parses an integer from a string
while avoiding overflows.  It is used by other functions, such as vfprintf,
to avoid undefined behavior.

The function vfscanf (_IO_vfwscanf) parses an integer from the format
string, and can use read_int.

7 years agomalloc: Remove malloc_get_state, malloc_set_state [BZ #19473]
Florian Weimer [Wed, 26 Oct 2016 11:28:28 +0000 (13:28 +0200)]
malloc: Remove malloc_get_state, malloc_set_state [BZ #19473]

After the removal of __malloc_initialize_hook, newly compiled
Emacs binaries are no longer able to use these interfaces.
malloc_get_state is only used during the Emacs build process,
so we provide a stub implementation only.  Existing Emacs binaries
will not call this stub function, but still reference the symbol.

The rewritten tst-mallocstate test constructs a dumped heap
which should approximates what existing Emacs binaries pass
to glibc malloc.

7 years agoiconv: Avoid writable data and relocations in ISO646
Florian Weimer [Wed, 26 Oct 2016 09:43:21 +0000 (11:43 +0200)]
iconv: Avoid writable data and relocations in ISO646

7 years agoiconv: Avoid writable data and relocations in IBM charsets
Florian Weimer [Wed, 26 Oct 2016 08:44:50 +0000 (10:44 +0200)]
iconv: Avoid writable data and relocations in IBM charsets

The IBM930, IBM933, IBM935 and IBM939 converters defined lookup
tables which were not constant.  They also contained an
unnecessary pointer indirection.

7 years agoRemove redundant definitions of M_ARENA_* macros
Siddhesh Poyarekar [Wed, 26 Oct 2016 09:37:33 +0000 (15:07 +0530)]
Remove redundant definitions of M_ARENA_* macros

The M_ARENA_MAX and M_ARENA_TEST macros are defined in malloc.c as
well as malloc.h, and the former is unnecessary.  This patch removes
the duplicate.  Tested on x86_64 to verify that the generated code
remains unchanged barring changed line numbers to __malloc_assert.

* malloc/malloc.c (M_ARENA_TEST, M_ARENA_MAX): Remove.

7 years agoRemove references to sbrk to grow/shrink arenas
Siddhesh Poyarekar [Wed, 26 Oct 2016 09:37:07 +0000 (15:07 +0530)]
Remove references to sbrk to grow/shrink arenas

The manual incorrectly references sbrk as the method used to grow and
shrink heaps and the fact that M_TRIM_THRESHOLD and M_TOP_PAD control
that behavior.  In reality, a heap may be grown or shrunk through
multiple methods depending on whether it is the main arena (in which
case sbrk is correct) or not (in which case, there are a number of
strategies including allocating an additional heap to grow an arena
and/or 'mprotect' a region to make it available for allocation).

Remove references to sbrk so that it covers the behavior more
accurately.

* manual/memory.texi (M_TOP_PAD): Remove reference to sbrk.
(M_TRIM_THRESHOLD): Likewise.

7 years agoDocument the M_ARENA_* mallopt parameters
Siddhesh Poyarekar [Wed, 26 Oct 2016 09:36:21 +0000 (15:06 +0530)]
Document the M_ARENA_* mallopt parameters

The M_ARENA_* mallopt parameters are in wide use in production to
control the number of arenas that a long lived process creates and
hence there is no point in stating that this interface is non-public.
Document this interface and remove the obsolete comment.

* manual/memory.texi (M_ARENA_TEST): Add documentation.
(M_ARENA_MAX): Likewise.
* malloc/malloc.c: Remove obsolete comment.

7 years agoAdd note on MALLOC_MMAP_* environment variables
Siddhesh Poyarekar [Wed, 26 Oct 2016 09:35:37 +0000 (15:05 +0530)]
Add note on MALLOC_MMAP_* environment variables

The mallopt parameters manual does not mention the environment
variables that can be used to set these parameters at program startup.
Mention those environment variables for completeness.

* manual/memory.texi: Add environment variable alternatives to
setting mallopt parameters.

7 years agoFix atomic_fetch_xor_release.
Carlos O'Donell [Wed, 26 Oct 2016 04:00:13 +0000 (00:00 -0400)]
Fix atomic_fetch_xor_release.

No code uses atomic_fetch_xor_release except for the upcoming
conditional variable rewrite. Therefore there is no user
visible bug here. The use of atomic_compare_and_exchange_bool_rel
is removed (since it doesn't exist anymore), and is replaced
by atomic_compare_exchange_weak_release.

We use weak_release because it provides better performance in
the loop (the weak semantic) and because the xor is release MO
(the release semantic). We don't reload expected in the loop
because atomic_compare_and_exchange_weak_release does this for
us as part of the CAS failure.

It is otherwise a fairly plain conversion that fixes building
the new condvar for 32-bit x86. Passes all regression tests
for x86.

7 years agoAdd tests for strfrom functions
Rajalakshmi Srinivasaraghavan [Sat, 22 Oct 2016 13:39:46 +0000 (19:09 +0530)]
Add tests for strfrom functions

7 years agoRefactor strtod tests
Rajalakshmi Srinivasaraghavan [Tue, 30 Aug 2016 06:13:21 +0000 (11:43 +0530)]
Refactor strtod tests

This patch changes strtod* tests to use strfrom* functions.

7 years agoAdd strfromd, strfromf, and strfroml functions
Gabriel F. T. Gomes [Tue, 28 Jun 2016 20:30:42 +0000 (17:30 -0300)]
Add strfromd, strfromf, and strfroml functions

ISO/IEC TS 18661-1 adds several functions in the strfrom family to stdlib.
This patch adds strfromd, strfromf, and strfroml.  This is being done in
preparation for the new floating-point type, float128.  The added functions
convert a floating-point value into a string, with configurable format.

7 years agoFix cmpli usage in power6 memset.
Joseph Myers [Tue, 25 Oct 2016 15:54:16 +0000 (15:54 +0000)]
Fix cmpli usage in power6 memset.

Building glibc for powerpc64 with recent (2.27.51.20161012) binutils,
with multi-arch enabled, I get the error:

../sysdeps/powerpc/powerpc64/power6/memset.S: Assembler messages:
../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (5 is not between 0 and 1)
../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (128 is not between 0 and 31)
../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: missing operand

Indeed, cmpli is documented as a four-operand instruction, and looking
at nearby code it seems likely cmpldi was intended.  This patch fixes
this powerpc64 code accordingly, and makes a corresponding change to
the powerpc32 code.

Tested for powerpc, powerpc64 and powerpc64le by Tulio Magno Quites
Machado Filho

* sysdeps/powerpc/powerpc32/power6/memset.S (memset): Use cmplwi
instead of cmpli.
* sysdeps/powerpc/powerpc64/power6/memset.S (memset): Use cmpldi
instead of cmpli.

7 years ago * sysdeps/unix/sysv/linux/fxstat.c: Remove useless cast.
Yury Norov [Mon, 24 Oct 2016 21:36:53 +0000 (14:36 -0700)]
* sysdeps/unix/sysv/linux/fxstat.c: Remove useless cast.
* sysdeps/unix/sysv/linux/lxstat.c: Likewise.
* sysdeps/unix/sysv/linux/xstat.c: Likewise.
* sysdeps/unix/sysv/linux/i386/fxstat.c: Likewise.
* sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise.
* sysdeps/unix/sysv/linux/i386/xstat.c: Likewise.

7 years agoFix Linux sh4 pread/pwrite argument passing
Adhemerval Zanella [Fri, 21 Oct 2016 21:29:18 +0000 (19:29 -0200)]
Fix Linux sh4 pread/pwrite argument passing

Although conceptually correct for p{read,write}{64} offset argument passing,
sh4 implementation does not generate the correct expected code.  The
__ALIGNMENT_ARG redefinition is incorrect for two reasons: 1. the
kernel-features.h header is included multiple times (since it contains no
guards) and 2. the value it redefines is also incorrect (should be '0, '
instead of empty definition).

This patch fixes it by adding another macro, SYSCALL_LL_PRW{64}, meant to be
used to pass the offset argument on p{read,write}64.  It is basically the
already define SYSCALL_LL{64} plus __ALIGNMENT_ARG unless __ASSUME_PRW_DUMMY_ARG
is define.  In this case an empty dummy argument is used regardless how
__ALIGNMENT_ARG is defined (sh4 case).

Checked on x86_64, i686, aarch64, armhf, and powerpc64le (basically a sanity
check).  Also, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> and
James Clarke <jrtc27@jrtc27.com> help me check on a debian sh4 bootstrap using
2.24 plus this patch to verify it also corrected fixed the regression issue.

I also verified the generated object for a 2.24 build and master with this
patch for sh4 and both look identical.

* sysdeps/unix/sysv/linux/pread.c (__libc_pread): Use SYSCALL_LL_PRW.
* sysdeps/unix/sysv/linux/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Use
SYSCALL_LL64_PRW.
* sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/sh/kernel-features.h: Define
__ASSUME_PRW_DUMMY_ARG.
* sysdeps/unix/sysv/linux/sh/pread.c: Remove file.
* sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
* sysdeps/unix/sysv/linux/sh/pwrite.c: Likewise.
* sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.
* sysdeps/unix/sysv/linux/sysdep.h: Define SYSCALL_LL_PRW and
SYSCALL_LL_PRW64 based on __ASSUME_PRW_DUMMY_ARG.

7 years agoFix -Wformat-length warning in tst-setgetname.c
Steve Ellcey [Mon, 24 Oct 2016 16:43:54 +0000 (09:43 -0700)]
Fix -Wformat-length warning in tst-setgetname.c

* sysdeps/unix/sysv/linux/tst-setgetname.c: Increase buffer size.

7 years agomath.h: Wrap C++ bits in extern "C++"
Florian Weimer [Sat, 22 Oct 2016 15:33:26 +0000 (17:33 +0200)]
math.h: Wrap C++ bits in extern "C++"

It is still common to include system header files in an extern "C"
block.  This means that exiting <math.h>'s own extern "C" block
is not sufficient to get back to C++ mode.  Use an extern "C++"
wrapper instead.

7 years agoUse -fno-builtin for sqrt benchmark.
Joseph Myers [Fri, 21 Oct 2016 21:18:03 +0000 (21:18 +0000)]
Use -fno-builtin for sqrt benchmark.

This patch makes the sqrt benchmark use -fno-builtin, as already done
for benchmarks of ffs and ffsll, so that it actually benchmarks the
glibc function as (presumably) intended even in the presence of the
compiler inlining sqrt.

Tested for x86_64 and also used for benchmarking my ARM sqrt patch.

* benchtests/Makefile (CFLAGS-bench-sqrt.c): New variable.

7 years agopowerpc: Cleanup fenv_private.h
Paul Murphy [Fri, 10 Jun 2016 19:50:32 +0000 (14:50 -0500)]
powerpc: Cleanup fenv_private.h

Some of the masks are wrong, and the naming is confusing.

There are two basic cases we really care about:

1. Stacking a new rounding mode when running certain
   sections of code, and pausing exception handling.

2. Likewise, but discarding any exceptions which occur
   while running under the new rounding mode.

libc_feholdexcept_setround_ppc_ctx has been removed as it basically
does the same thing as libc_feholdsetround_ppc_ctx but also clearing
any sticky bits.  The restore behavior is what differentiates these
two cases as the SET_RESTORE_ROUND{,_NOEX} macros will either merge
or discard all exceptions occurring during scope of their usage.

Likewise, there are a number of routines to swap, replace,
or merge FP environments.  This change reduces much of
the common and sometimes wrong code.

Tested on ppc64le, with results before and after.

7 years agomath: Define iszero as a function template for C++ [BZ #20715]
Florian Weimer [Fri, 21 Oct 2016 16:26:53 +0000 (18:26 +0200)]
math: Define iszero as a function template for C++ [BZ #20715]

This increases compatibility with C++ code which is forced to
compile with _GNU_SOURCE.

7 years agoUse VSQRT instruction for ARM sqrt (bug 20660).
Joseph Myers [Thu, 20 Oct 2016 23:24:44 +0000 (23:24 +0000)]
Use VSQRT instruction for ARM sqrt (bug 20660).

This patch makes ARM sqrt and sqrtf use the VSQRT VFP square root
instruction when available, instead of much larger generic code for
computing square roots.

Now, GCC will normally inline sqrt calls except for negative arguments
where errno needs to be set, and because the benchtests fail to use
-fno-builtin that means no significant difference in benchmark results
for sqrt (note, however, there are lots of __ieee754_sqrt calls
internally in libm, which are *not* inlined - although some
architectures define __ieee754_sqrt in their math_private.h for that
purpose, ARM doesn't - so improving out-of-line sqrt performance is
still relevant to those other functions, if not for most ordinary
direct users of sqrt).  With the benchtests changed to use
-fno-builtin for sqrt tests, typical performance results before the
change are ("max" is wildly varying in any case):

    "duration": 9.88358e+09,
    "iterations": 4.8783e+07,
    "max": 457.764,
    "min": 183.105,
    "mean": 202.603

and after it are:

    "duration": 9.45663e+09,
    "iterations": 2.24385e+08,
    "max": 274.659,
    "min": 30.517,
    "mean": 42.1447

Tested for ARM (hard-float and soft-float).

[BZ #20660]
* sysdeps/arm/e_sqrt.c: New file.
* sysdeps/arm/e_sqrtf.c: Likewise.

7 years agoStop powerpc copysignl raising "invalid" for sNaN argument (bug 20718).
Joseph Myers [Wed, 19 Oct 2016 22:58:34 +0000 (22:58 +0000)]
Stop powerpc copysignl raising "invalid" for sNaN argument (bug 20718).

The powerpc (hard-float) implementations of copysignl, both 32-bit and
64-bit, raise spurious "invalid" exceptions when the first argument is
a signaling NaN.  copysign functions should never raise exceptions
even for signaling NaNs.

The problem is the use of an fcmpu instruction to test the sign of the
high part of the long double argument.  This patch fixes the functions
to use fsel instead (as used for fabsl following my fixes for a
similar bug there), or to examine the integer representation for older
32-bit processors without fsel.

Tested for powerpc64 and powerpc32 (configurations with and without
fsel used).

[BZ #20718]
* sysdeps/powerpc/powerpc32/fpu/s_copysignl.S (__copysignl): Do
not use floating-point comparisons to test sign.
* sysdeps/powerpc/powerpc64/fpu/s_copysignl.S (__copysignl):
Likewise.

7 years agoAdd getpayload, getpayloadf, getpayloadl.
Joseph Myers [Wed, 19 Oct 2016 01:49:09 +0000 (01:49 +0000)]
Add getpayload, getpayloadf, getpayloadl.

TS 18661-1 defines functions for manipulating the payloads of NaNs.
This patch implements the getpayload functions for glibc; these
extract the NaN payload (from an argument passed as a pointer, for
which corresponding libm-test support is added) and return it in the
same floating-point type.  The return value of these functions is
unspecified for non-NaN arguments; the patch does the simplest thing
to implement, which is that the functions do not check whether the
argument is a NaN and just treat the relevant bits of the
representation as a payload regardless.  A conversion from integer to
floating-point is used to produce the required return value, except in
the ldbl-128 case; as 128-bit integers are not supported for all
configurations using ldbl-128, the code constructs the required
floating-point representation of the return value directly instead.

Tested for x86_64, x86, mips64 and powerpc.

* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(getpayload): New declaration.
* math/Versions (getpayload): New libm symbol at version
GLIBC_2.25.
(getpayloadf): Likewise.
(getpayloadl): Likewise.
* math/Makefile (libm-calls): Add s_getpayloadF.
* math/libm-test.inc: Include <nan-high-order-bit.h>.
(struct test_f_f_data): Add comment.
(RUN_TEST_fp_f): New macro.
(RUN_TEST_LOOP_fp_f): Likewise.
(getpayload_test_data): New array.
(getpayload_test): New function.
(main): Call getpayload_test.
* math/gen-libm-test.pl (parse_args): Handle 'p' in argument
descriptor.
* manual/arith.texi (FP Bit Twiddling): Document getpayload,
getpayloadf and getpayloadl.
* manual/libm-err-tab.pl: Update comment on interfaces without
ulps tabulated.
* sysdeps/ieee754/dbl-64/s_getpayload.c: New file.
* sysdeps/ieee754/dbl-64/wordsize-64/s_getpayload.c: Likewise.
* sysdeps/ieee754/flt-32/s_getpayloadf.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_getpayloadl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_getpayloadl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_getpayloadl.c: Likewise.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.

7 years agoFix Linux fallocate tests for EOPNOTSUPP
Adhemerval Zanella [Mon, 17 Oct 2016 18:59:17 +0000 (16:59 -0200)]
Fix Linux fallocate tests for EOPNOTSUPP

The fallocate syscall might fail on Linux due missing support from
underlying filesystem (for instance some NFS versions).  This patch
adds this check for fallocate tests.  It also moves tst-fallocate{64}
to 'io' folder (since it is on fallocate{64} is built).

Checked on x86_64.

* sysdeps/unix/sysv/linux/Makefile [$(subdir) = math] (tests): Move
tst-fallocate{64}.
* sysdeps/unix/sysv/linux/tst-fallocate-common.c: Check for EOPNOTSUPP
on syscall return.

7 years agoBug 20689: Fix FMA and AVX2 detection on Intel
Carlos O'Donell [Mon, 17 Oct 2016 23:35:34 +0000 (19:35 -0400)]
Bug 20689: Fix FMA and AVX2 detection on Intel

In the Intel Architecture Instruction Set Extensions Programming
reference the recommended way to test for FMA in section
'2.2.1 Detection of FMA' is:

"Application Software must identify that hardware supports AVX as
explained in ... after that it must also detect support for FMA..."

We don't do that in glibc. We use osxsave to detect the use of xgetbv,
and after that we check for AVX and FMA orthogonally. It is conceivable
that you could have the AVX bit clear and the FMA bit in an undefined
state.

This commit fixes FMA and AVX2 detection to depend on usable AVX
as required by the recommended Intel sequences.

v1: https://www.sourceware.org/ml/libc-alpha/2016-10/msg00241.html
v2: https://www.sourceware.org/ml/libc-alpha/2016-10/msg00265.html

7 years agoDefine HIGH_ORDER_BIT_IS_SET_FOR_SNAN to 0 or 1.
Joseph Myers [Mon, 17 Oct 2016 22:48:51 +0000 (22:48 +0000)]
Define HIGH_ORDER_BIT_IS_SET_FOR_SNAN to 0 or 1.

This patch moves the HIGH_ORDER_BIT_IS_SET_FOR_SNAN macro from being
defined or undefined to the preferred convention of always being
defined, to either 0 or 1, so allowing typo-proof tests with #if.

The macro is moved from math_private.h to a new header
nan-high-order-bit.h to make it easy for all architectures to define,
either through the sysdeps/generic version of the header or through
providing their own version of the header, without needing #ifndef in
the generic math_private.h to give a default definition.  The move
also allows the macro to be used without needing math_private.h to be
included; the immediate motivation of this patch is to allow tests to
access this information (to know what kinds of NaNs 0 is a valid
payload for) without needing to include math_private.h.  Existing
C level rather than preprocessor conditionals at all, but this patch
does not make such a change).

Tested for x86_64 and x86 (testsuite); also verified for x86_64, x86,
mips64 and powerpc that installed stripped shared libraries are
unchanged by the patch.

* sysdeps/generic/nan-high-order-bit.h: New file.
* sysdeps/hppa/nan-high-order-bit.h: Likewise.
* sysdeps/mips/nan-high-order-bit.h: Likewise.
* sysdeps/hppa/math_private.h: Remove file.
* sysdeps/mips/math_private.h (HIGH_ORDER_BIT_IS_SET_FOR_SNAN): Do
not define here.
* sysdeps/ieee754/dbl-64/s_issignaling.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/dbl-64/s_totalorder.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/dbl-64/s_totalordermag.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/dbl-64/wordsize-64/s_issignaling.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/flt-32/s_issignalingf.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/flt-32/s_totalorderf.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/flt-32/s_totalordermagf.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-128/s_issignalingl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-128/s_totalorderl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-128/s_totalordermagl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-96/s_issignalingl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-96/s_totalorderl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.
* sysdeps/ieee754/ldbl-96/s_totalordermagl.c: Include
<nan-high-order-bit.h>.
[HIGH_ORDER_BIT_IS_SET_FOR_SNAN]: Test with #if not #ifdef.

7 years agoS390: Fix fp comparison not raising FE_INVALID.
Stefan Liebler [Mon, 17 Oct 2016 08:37:11 +0000 (10:37 +0200)]
S390: Fix fp comparison not raising FE_INVALID.

As gcc is using unordered comparison instructions which do not
raise invalid exception if any operand is quiet NAN,
FIX_COMPARE_INVALID is defined to 1.
Thus iseqsig is calling feraiseexcept as workaround.

7 years agohppa: Optimize atomic_compare_and_exchange_val_acq
John David Anglin [Sat, 15 Oct 2016 17:22:00 +0000 (19:22 +0200)]
hppa: Optimize atomic_compare_and_exchange_val_acq

Changelog:
* sysdeps/unix/sysv/linux/hppa/atomic-machine.h: Don't include
abort-instr.h.
(EFAULT): Remove conditional define.
(ENOSYS): Likewise.
(atomic_compare_and_exchange_val_acq): Use instruction nullification
instead of conditional branch instructions.

7 years agoAdd totalordermag, totalordermagf, totalordermagl.
Joseph Myers [Sat, 15 Oct 2016 00:36:48 +0000 (00:36 +0000)]
Add totalordermag, totalordermagf, totalordermagl.

In addition to the totalorder functions, TS 18661-1 defines
totalordermag functions, which do the same comparison but on the
absolute values of the arguments.  This patch implements these
functions for glibc, including the type-generic macro in <tgmath.h>.
In general the implementations are similar to but simpler than those
for the totalorder functions.

Tested for x86_64, x86, mips64 and powerpc.

* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(totalordermag): New declaration.
* math/tgmath.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (totalordermag):
New macro.
* math/Versions (totalordermag): New libm symbol at version
GLIBC_2.25.
(totalordermagf): Likewise.
(totalordermagl): Likewise.
* math/Makefile (libm-calls): Add s_totalordermagF.
* math/libm-test.inc (totalordermag_test_data): New array.
(totalordermag_test): New function.
(main): Call totalordermag_test.
* math/test-tgmath.c (NCALLS): Increase to 125.
(F(compile_test)): Call totalordermag.
(F(totalordermag)): New function.
* manual/arith.texi (FP Comparison Functions): Document
totalordermag, totalordermagf and totalordermagl.
* manual/libm-err-tab.pl: Update comment on interfaces without
ulps tabulated.
* sysdeps/ieee754/dbl-64/s_totalordermag.c: New file.
* sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c: Likewise.
* sysdeps/ieee754/flt-32/s_totalordermagf.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_totalordermagl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_totalordermagl.c: Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c: Likewise.
* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
totalordermag.
(CFLAGS-nldbl-totalordermag.c): New variable.
* sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c
(do_test): Also test totalordermagl.
* sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c (do_test):
Likewise.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.

7 years agoFix warnings from latest GCC.
steve ellcey-CA Eng-Software [Fri, 14 Oct 2016 19:53:27 +0000 (12:53 -0700)]
Fix warnings from latest GCC.

* sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
boolean.

7 years agoClean up some complex functions raising FE_INVALID.
Joseph Myers [Fri, 14 Oct 2016 00:12:56 +0000 (00:12 +0000)]
Clean up some complex functions raising FE_INVALID.

Some of the complex arithmetic functions have the following pattern:
in some piece of code, one part of the input (real or imaginary,
depending on the function) is either infinite or NaN.  Part of the
result is to be set to NaN in either case, and FE_INVALID raised only
if the relevant part of the input was infinite.

In such a case, there is no actual need for the conditional on the
type of the input, since subtracting the relevant part of the input
from itself will produce a NaN, with FE_INVALID only if the relevant
part of the input was infinite.  This simplifies the code, and as a
quality-of-implementation matter also improves things by propagating
NaN payloads.  (Right now these functions always raise FE_INVALID for
signaling NaN arguments because of the call to fpclassify - at least
unless glibc is built with -Os - but if fpclassify moves to using
integer arithmetic in future, doing arithmetic on the NaN argument
also ensures an exception for sNaNs.)

Tested for x86_64 and x86.

* math/s_ccosh_template.c (M_DECL_FUNC (__ccosh)): Instead of
raising FE_INVALID with feraisexcept in case where part of
argument is infinite, subtract that part of argument from itself.
* math/s_cexp_template.c (M_DECL_FUNC (__cexp)): Likewise.
* math/s_csin_template.c (M_DECL_FUNC (__csin)): Likewise.
* math/s_csinh_template.c (M_DECL_FUNC (__csinh)): Likewise.

7 years agoAdd more totalorder tests.
Joseph Myers [Wed, 12 Oct 2016 21:33:49 +0000 (21:33 +0000)]
Add more totalorder tests.

This patch adds more tests of totalorder for finite inputs.

Tested for x86_64, x86, mips64 and powerpc.

* math/libm-test.inc (totalorder_test_data): Add more tests.

7 years agoFix posix_fadvise64 build on mips64n64
Adhemerval Zanella [Wed, 12 Oct 2016 16:06:22 +0000 (13:06 -0300)]
Fix posix_fadvise64 build on mips64n64

Recent binutils versions (at least 2.27) complains about libc.so
when linking sotruss-lib.so with:

  libc.so:(*IND*+0x0): multiple definition of `posix_fadvise64@GLIBC_2.2'
  libc.so::(.text+0xcf940): first defined here
  libc.so:(*IND*+0x0): multiple definition of `posix_fadvise64'
  collect2: error: ld returned 1 exit status

Dynamic symbols for libc.so shows (readelf --dyn-syms):

   262: 000000000010b950    28 FUNC    GLOBAL DEFAULT   12 posix_fadvise64@GLIBC_2.2
   417: 000000000010b950    28 FUNC    WEAK   DEFAULT   12 posix_fadvise64@@GLIBC_2.2
  1505: 000000000010b950    28 FUNC    GLOBAL DEFAULT   12 posix_fadvise64@@GLIBC_2.3.3

That is, two separate definitions at version GLIBC_2.2. The issue is
sysdeps/unix/sysv/linux/posix_fadvise64.c creates posix_fadvise64 weak_alias,
while sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c then adds
compat_symbol / versioned_symbol calls.

The patch remove the weak_alias definition on mips64 specific version so
direct weak_alias is disabled.

Checked on mips64n64 build with binutils 2.27.51.20161012.

* sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c:
Undefine weak_alias.

7 years agoX86: Don't assert on older Intel CPUs [BZ #20647]
H.J. Lu [Wed, 12 Oct 2016 15:22:52 +0000 (08:22 -0700)]
X86: Don't assert on older Intel CPUs [BZ #20647]

Since the maximum CPUID level of older Intel CPUs is 1, change
handle_intel to return -1, instead of assert, when the maximum
CPUID level is less than 2.

[BZ #20647]
* sysdeps/x86/cacheinfo.c (handle_intel): Return -1 if the
maximum CPUID level is less than 2.

7 years agoAdd totalorder, totalorderf, totalorderl.
Joseph Myers [Wed, 12 Oct 2016 01:20:30 +0000 (01:20 +0000)]
Add totalorder, totalorderf, totalorderl.

TS 18661-1 defines totalorder functions implementing the totalOrder
comparison operation from IEEE 754-2008.  This patch implements these
functions for glibc, including the type-generic macro in <tgmath.h>.
(The totalordermag functions will be added in a separate patch.)

The description of the totalOrder operation is complicated.  However,
for IEEE interchange binary formats and the preferred quiet NaN
convention, what that complicated description means is that you
interpret the representation as a sign-magnitude integer (with -0
coming before +0) and do a <= comparison on that interpretation.  For
finite values and infinities the ordering of the sign-magnitude
integers is just the same as the ordering of floating-point values, so
this extends that to all representations.  (Different representations
of the same floating-point value - which includes same quantum in the
decimal case - must still be considered equal by this operation, but
that issue doesn't arise for IEEE interchange binary formats.)  So the
complications are:

* When MIPS quiet NaN conventions are in use, the representation of
  NaNs needs adjusting before making such an integer comparison.  This
  patch does this adjustment only when both arguments are NaNs, as
  there's no need for it if only one is a NaN, and as long as both are
  NaNs you can just flip the relevant bits without any problems from
  this turning a NaN into an infinity.

* For the m68k version of ldbl-96, where the high mantissa bit is
  "don't care" for infinities and NaNs, representations where it
  differs must compare the same.  Note: although the testcase for this
  compiles, I have not actually tested on m68k.

* For ldbl-128ibm, the low part must be ignored when the high part is
  NaN, and low parts of +0 and -0 must be considered the same whatever
  the high part.

The new tests in libm-test.inc are the first tests there specifying
particular payloads for input NaNs.  Separate tests are also added for
the ldbl-96 and ldbl-128ibm special cases where there are different
representations of the same value that must compare equal (which can't
be covered in libm-test.inc as that only specifies values, not
representations).

Tested for x86_64, x86, mips64 and powerpc.

* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(totalorder): New declaration.
* math/tgmath.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (totalorder):
New macro.
* math/Versions (totalorder): New libm symbol at version
GLIBC_2.25.
(totalorderf): Likewise.
(totalorderl): Likewise.
* math/Makefile (libm-calls): Add s_totalorderF.
* math/gen-libm-test.pl (parse_args): Escape quotes in test name
string.
* math/libm-test.inc (PAYLOAD_DIG): New macro.
(qnan_value_pl): Likewise.
(snan_value_pl): Likewise.
(qnan_value): Define using qnan_value_pl.
(snan_value): Define using snan_value_pl.
(struct test_ff_i_data): Add comment about which tests use this
structure.
(RUN_TEST_ff_b): New macro.
(RUN_TEST_LOOP_ff_b): Likewise.
(totalorder_test_data): New array.
(totalorder_test): New function.
(main): Call totalorder_test.
* math/test-tgmath.c (NCALLS): Increase to 122.
(F(compile_test)): Call totalorder.
(F(totalorder)): New function.
* manual/arith.texi (FP Comparison Functions): Document
totalorder, totalorderf and totalorderl.
* manual/libm-err-tab.pl: Update comment on interfaces without
ulps tabulated.
* sysdeps/ieee754/dbl-64/s_totalorder.c: New file.
* sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c: Likewise.
* sysdeps/ieee754/flt-32/s_totalorderf.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_totalorderl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_totalorderl.c: Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c: Likewise.
* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
totalorder.
(CFLAGS-nldbl-totalorder.c): New variable.
* sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c: New
file.
* sysdeps/ieee754/ldbl-128ibm/Makefile [$(subdir) = math] (tests):
Add test-totalorderl-ldbl-128ibm.
* sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c: New file.
* sysdeps/ieee754/ldbl-96/Makefile [$(subdir) = math] (tests): Add
test-totalorderl-ldbl-96.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.

7 years agoConsolidate Linux sync_file_range implementations
Adhemerval Zanella [Tue, 4 Oct 2016 14:57:38 +0000 (11:57 -0300)]
Consolidate Linux sync_file_range implementations

This patch consolidates all the sync_file_range implementation for Linux
in only one (sysdeps/unix/sysv/linux/sync_file_range.c).  It also removes
the syscall from the auto-generation using assembly macros (except for
x86_64 due x32 [1]).

For current minimum supported kernel (2.6.32 for x86_64 and 3.2 for all
other architectures) either sync_file_range or sync_file_range2 is supported
and it is expected that any future Linux ABI will provide either of one
syscall.  So the code path that returns ENOSYS in the case of missing
syscall is removed.

Checked on x86_64, i386, powerpc64le, aarch64, and armhf.

* sysdeps/unix/sysv/linux/Makefile (tests): Add tst-sync_file_range.
* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: Remove file.
* sysdeps/sysv/linux/powerpc/powerpc64/sync_file_range.c: Likewise.
* sysdeps/unix/sysv/linux/sync_file_range.c: New file.
* sysdeps/unix/sysv/linux/tst-sync_file_range.c (sync_file_range):
Consolidate all Linux implementations.

[1] https://patchwork.ozlabs.org/patch/659794/

7 years agoresolv: Compile without -Wno-write-strings
Florian Weimer [Tue, 11 Oct 2016 13:32:55 +0000 (15:32 +0200)]
resolv: Compile without -Wno-write-strings

7 years agoAvoid M_NAN + M_NAN in complex functions.
Joseph Myers [Tue, 11 Oct 2016 00:50:43 +0000 (00:50 +0000)]
Avoid M_NAN + M_NAN in complex functions.

Some libm complex functions have code that computes M_NAN + M_NAN.
This is nonsensical; it's just equivalent to M_NAN, since it's a quiet
NaN (and the comments suggesting this raises an exception are
similarly wrong).  This patch changes the code just to use M_NAN (and
removes the bogus comments).  (Preferably, code should either
propagate an input NaN or do a computation that raises "invalid" and
generates a default NaN at the same time.  There are various cases,
however, that currently raise "invalid" even for NaN inputs; I think
those are cases where "invalid" is optional in ISO C so a change to
whether it's raised would be OK, but they would still need more
careful consideration than the cases where such issues do not arise.)

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

* math/s_ccosh_template.c (M_DECL_FUNC (__ccosh)): Use M_NAN
instead of M_NAN + M_NAN.
* math/s_csinh_template.c (M_DECL_FUNC (__csinh)): Likewise.

7 years agohurd: Fix unused variable warning
Samuel Thibault [Mon, 10 Oct 2016 20:45:18 +0000 (22:45 +0200)]
hurd: Fix unused variable warning

* misc/getauxval.c [!HAVE_AUX_VECTOR] (__getauxval): Do not define
unused variable 'p'.

7 years agopowerpc32: make PLT call in _mcount compatible with -msecure-plt (bug 20554)
Alan Modra [Tue, 4 Oct 2016 17:59:38 +0000 (19:59 +0200)]
powerpc32: make PLT call in _mcount compatible with -msecure-plt (bug 20554)

7 years agoMake iseqsig handle excess precision.
Joseph Myers [Fri, 7 Oct 2016 23:28:33 +0000 (23:28 +0000)]
Make iseqsig handle excess precision.

iseqsig, like other type-generic comparison macros, should behave like
a comparison operator in not removing excess range and precision from
its arguments (see C11 F.10.11).  This patch implements this by making
definitions of iseqsig appropriately conditional on
__FLT_EVAL_METHOD__ (including support for TS 18661-3 values of that
macro), with a corresponding testcase (that failed for 32-bit x86 in
the absence of the math.h changes) being added.  (Of course the
definitions may need reworking when float128 support is added, just as
with other type-generic macros.)

Tested for x86_64 and x86.

* math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iseqsig): Define
conditional on value of [__FLT_EVAL_METHOD__].
* math/test-iseqsig-excess-precision.c: New file.
* math/Makefile (tests): Add test-iseqsig-excess-precision.

7 years agoFix iseqsig for ports that do not support FE_INVALID
Adhemerval Zanella [Fri, 7 Oct 2016 17:18:31 +0000 (14:18 -0300)]
Fix iseqsig for ports that do not support FE_INVALID

Microblaze, nios2, and tile do not support FE_INVALID and thus
define feraiseexcept as a empty macro.  Include math-private.h
to get such definition.

Checked with a build for microblaze, nios2, and tilepro.

* math/s_iseqsig_template.c: Include math-private.h.

7 years agoConsolidate posix_fadvise implementations
Adhemerval Zanella [Wed, 6 Jul 2016 11:52:11 +0000 (08:52 -0300)]
Consolidate posix_fadvise implementations

This patch consolidates mostly of the Linux posix_fadvise{64} implementations
on sysdeps/unix/sysv/linux/posix_fadvise{64}.c.  It still keeps arch-specific
files for:

  * S390-32: it uses a packed structure to pass all the arguments on syscall.
    It is the only supported port that implements __NR_fadvise64_64 in this
    way.

  * ARM: it does not implement __NR_fadvise64 (as other 32-bits ports), so
    posix_fadvise calls internal posix_fadvise64 symbol.

  * MIPS64 n64: it requires a different version number that other ports.

The new macro SYSCALL_LL{64} is used to handle the offset argument and
INTERNAL_SYSCALL_CALL to handle passing the correct number of expect
arguments.

The default Linux adds two new defines a port can use to control how
__NR_fadvise64_64 passes the kernel arguments:

  * __ASSUME_FADVISE64_64_6ARG: the 'advise' argument is moved on second
    position.  This is the case of powerpc32 and arm to avoid implement
    7 argument syscall.

  * __ASSUME_FADVISE64_64_NO_ALIGN: for ABIs that defines
    __ASSUME_ALIGNED_REGISTER_PAIRS packs the offset without the leading
    '0'.  This is the case of tile 32 bits.

ARM also defines __NR_fadvise64_64 as __NR_arm_fadvise64_64 (which is also
handled on arch kernel-feature.h).

Tested on x86_64, x32, i686, armhf, and aarch64.

* posix/Makefile (tests): Add tst-posix_fadvise and tst-posix_fadvise64.
* posix/tst-posix_fadvise.c: New file.
* posix/tst-posix_fadvise64.c: Likewise.
* posix/tst-posix_fadvise-common.c: Likewise.
* sysdeps/unix/sysv/linux/arm/kernel-features.h
(__ASSUME_FADVISE64_64_6ARG): Define.
* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
[!__powerpc64__] (__ASSUME_FADVISE64_64_6ARG): Add define.
* sysdeps/unix/sysv/linux/arm/posix_fadvise64.c: Remove file.
* sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c: Likewise.
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c:
Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
(SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) [__posix_fadvise64_l64]:
Alias to __posix_fadvise64_l32.
(SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) [__posix_fadvise64_l32]:
Add compat definition to posix_fadvise64.
(SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3) [__posix_fadvise64_l64]:
Add versioned definition to posix_fadvise64.
* sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Build iff
__OFF_T_MATCHES_OFF64_T is defined, use INTERNAL_SYSCALL_CALL, add
__ASSUME_FADVISE64_64_6ARG/__ASSUME_FADVISE64_64_NO_ALIGN support.
* sysdeps/unix/sysv/linux/posix_fadvise64.c (posix_fadvise64): Add
__ASSUME_FADVISE64_64_NO_ALIGN support and use INTERNAL_SYSCALL_CALL.

7 years agoConsolidate posix_fallocate{64} implementations
Adhemerval Zanella [Fri, 19 Aug 2016 14:18:40 +0000 (11:18 -0300)]
Consolidate posix_fallocate{64} implementations

This patch consolidates all the posix_fallocate{64} implementation for Linux
in only one (sysdeps/unix/sysv/linux/posix_fallocate{64}.c).  It also removes
the syscall from the auto-generation using assembly macros.

The macro SYSCALL_LL{64} is used to handle the offset argument along with
the new INTERNAL_SYSCALL_CALL macro to define correct argument count for
internal INTERNAL_SYSCALL call.

Tested on x86_64, i686, x32, aarch64, ppc64le, and armhf.

* io/Makefile (tests): Add tst-posix_fallocate and
tst-posix_fallocate64.
* io/tst-posix_fallocate-common.c: New file.
* io/tst-posix_fallocate.c: Likewise.
* io/tst-posix_fallocate64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate.c: Remove
file.
* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fallocate64.c:
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fallocate64.c:
Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c: Likewise.
* sysdeps/unix/sysv/linux/posix_fallocate.c (posix_fallocate): Use
SYSCALL_LL to pass both offset and len arguments.
* sysdeps/unix/sysv/linux/posix_fallocate64.c (posix_fallocate64):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list (pwrite64): Add
__libc_pwrite64 alias used by posix_fallocate64.

7 years agoConsolidate fallocate{64} implementations
Adhemerval Zanella [Mon, 11 Apr 2016 18:04:59 +0000 (15:04 -0300)]
Consolidate fallocate{64} implementations

This patch consolidates all the fallocate{64} implementation for Linux
in only one (sysdeps/unix/sysv/linux/fallocate{64}.c).  It also removes the
syscall from the auto-generation using assembly macros.

The new macro SYSCALL_LL{64} is used to handle the offset argument.

Checked on x86_64, x32, i386, aarch64, and ppc64le.

* sysdeps/unix/sysv/linux/Makefile (test): Add tst-fallocate and
tst-fallocate64.
* sysdeps/unix/sysv/linux/tst-fallocate.c: New file.
* sysdeps/unix/sysv/linux/tst-fallocate64.c: Likewise.
* sysdeps/unix/sysv/linux/tst-fallocate-common.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c: Remove file.
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate.c: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/fallocate64.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/fallocate.c: Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c: Likewise.
* sysdeps/unix/sysv/linux/fallocate.c (fallocate): Use SYSCALL_LL
macro on offset argument.
* sysdeps/unix/sysv/linux/fallocate64.c (fallocate64): Use
SYSCALL_LL64 on offset argument.
* test-skeleton.c (FAIL_RET): Add macro.
(FAIL_EXIT): Likewise.
(FAIL_EXIT1): Likewise.
(_FAIL): Likewise.

7 years agoresolv: Remove RES_USEBSTRING and its implementation [BZ #20629]
Florian Weimer [Fri, 7 Oct 2016 11:43:48 +0000 (13:43 +0200)]
resolv: Remove RES_USEBSTRING and its implementation [BZ #20629]

In ns_name_ntop, the NS_CMPRSFLGS check is no longer needed because
labellen (called earlier) already rejects everything which is not
a plain label (compression references and extended label types).

7 years agoresolv: Remove RES_NOIP6DOTINT and its implementation
Florian Weimer [Fri, 7 Oct 2016 11:55:47 +0000 (13:55 +0200)]
resolv: Remove RES_NOIP6DOTINT and its implementation

7 years agoresolv: Deprecate unimplemented flags
Florian Weimer [Fri, 7 Oct 2016 15:41:45 +0000 (17:41 +0200)]
resolv: Deprecate unimplemented flags

RES_AAONLY, RES_PRIMARY, RES_NOCHECKNAME, RES_KEEPTSIG result
in compile-time warnings.  Some of these flags are still used in
applications.

7 years agoUse libc_ifunc macro for siglongjmp, longjmp in libpthread.
Stefan Liebler [Fri, 7 Oct 2016 07:56:48 +0000 (09:56 +0200)]
Use libc_ifunc macro for siglongjmp, longjmp in libpthread.

This patch uses the libc_ifunc macro to create already existing ifunc functions
longjmp_ifunc, siglongjmp_ifunc if HAVE_IFUNC is defined.
The s390 pt-longjmp.c includes the common pt-longjmp.c and uses strong_alias
to create the longjmp, siglongjmp symbols for glibc version 2.19.

ChangeLog:

* nptl/pt-longjmp.c (DEFINE_LONGJMP): Use libc_ifunc macro.
* sysdeps/unix/sysv/linux/s390/pt-longjmp.c (longjmp, siglongjmp):
Use strong_alias to create symbols for glibc verison 2.19.

7 years agoUse libc_ifunc macro for vfork in libpthread.
Stefan Liebler [Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)]
Use libc_ifunc macro for vfork in libpthread.

This patch uses the libc_ifunc macro to create already existing ifunc functions
vfork_ifunc and __vfork_ifunc if HAVE_IFUNC is defined.

ChangeLog:

* nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro.

7 years agoUse libc_ifunc macro for system in libpthread.
Stefan Liebler [Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)]
Use libc_ifunc macro for system in libpthread.

This patch uses the libc_ifunc macro to create already existing ifunc function
system_ifunc if HAVE_IFUNC is defined.

ChangeLog:

* nptl/pt-system.c (system_ifunc): Use libc_ifunc macro.

7 years agoUse libc_ifunc macro for clock_* symbols in librt.
Stefan Liebler [Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)]
Use libc_ifunc macro for clock_* symbols in librt.

This patch uses the libc_ifunc macro to create already existing ifunc functions
clock_getres, clock_gettime, clock_settime, clock_getcpuclockid and
clock_nanosleep. If HAVE_IFUNC is defined, the macro COMPAT_REDIRECT uses
the libc_ifunc macro.
Furthermore some whitespace damage is cleaned.

ChangeLog:

* rt/clock-compat.c (COMPAT_REDIRECT): Use libc_ifunc macro.

7 years agoppc: Use libc_ifunc macro for time, gettimeofday.
Stefan Liebler [Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)]
ppc: Use libc_ifunc macro for time, gettimeofday.

This patch uses the libc_ifunc_hidden macro to create already existing ifunc functions
time and gettimeofday on power. This way, the libc_hidden_def macro can be used
instead of inline assemblies.
On ppc32, the __GI_* symbols do not target the ifunc symbol and thus the
redirection construct has to be applied here.

ChangeLog:

* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (__gettimeofday):
Use libc_ifunc_hidden and libc_hidden_def macro. Redirect ifunced function
in header for using it as type for ifunc function because __GI_* symbols
for ppc32 do not target the ifunc symbols.
* sysdeps/unix/sysv/linux/powerpc/time.c (time): Likewise.

7 years agoi386, x86: Use libc_ifunc macro for time, gettimeofday.
Stefan Liebler [Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)]
i386, x86: Use libc_ifunc macro for time, gettimeofday.

This patch uses the libc_ifunc_hidden macro to create already existing ifunc functions
time and gettimeofday on intel. This way, the libc_hidden_def macro can be used
instead of the libc_ifunc_hidden_def one which was only used here. Thus the
macro is removed from libc-symbols.h.
On i386, the __GI_* symbols do not target the ifunc symbol and thus the
redirection construct has to be applied here.

ChangeLog:

* sysdeps/unix/sysv/linux/x86/gettimeofday.c (__gettimeofday):
Use libc_ifunc_hidden macro. Use libc_hidden_def instead of
libc_ifunc_hidden_def.
* sysdeps/unix/sysv/linux/x86/time.c (time): Likewise.
* sysdeps/unix/sysv/linux/i386/gettimeofday.c (__gettimeofday):
Redirect ifunced function in header for using it as type of ifunc'ed
function. Redefine libc_hidden_def to use fallback non ifunc'ed
function for __GI_* symbol.
* sysdeps/unix/sysv/linux/i386/time.c (time): Likewise.
* include/libc-symbols.h
(libc_ifunc_hidden_def, libc_ifunc_hidden_def1): Delete macro.

7 years agos390: Refactor ifunc resolvers due to false debuginfo.
Stefan Liebler [Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)]
s390: Refactor ifunc resolvers due to false debuginfo.

This patch adjusts the s390 specific ifunc helper macros in ifunc-resolve.h to
use the common __ifunc macro, which uses gcc attribute ifunc to get rid of the
false debuginfo. Therefore the redirection construct is applied where needed.

Perhaps in future we can switch some of the internal symbols __GI_* from the
fallback variant to the ifunc function. But this change is not
straightforward due to a segmentation fault while linking libc.so with older
binutils on s390.

ChangeLog:

[BZ #20478]
* sysdeps/s390/multiarch/ifunc-resolve.h
(s390_vx_libc_ifunc2, s390_libc_ifunc): Use __ifunc from libc-symbols.h
to create ifunc symbols.
(s390_vx_libc_ifunc_init, s390_vx_libc_ifunc_redirected
, s390_vx_libc_ifunc2_redirected, s390_libc_ifunc_init): New define.
* sysdeps/s390/multiarch/memchr.c: Redirect ifunced function in header
for using it as type for ifunc function.
* sysdeps/s390/multiarch/mempcpy.c: Likewise.
* sysdeps/s390/multiarch/rawmemchr.c: Likewise.
* sysdeps/s390/multiarch/stpcpy.c: Likewise.
* sysdeps/s390/multiarch/stpncpy.c: Likewise.
* sysdeps/s390/multiarch/strcat.c: Likewise.
* sysdeps/s390/multiarch/strchr.c: Likewise.
* sysdeps/s390/multiarch/strcmp.c: Likewise.
* sysdeps/s390/multiarch/strcpy.c: Likewise.
* sysdeps/s390/multiarch/strcspn.c: Likewise.
* sysdeps/s390/multiarch/strlen.c: Likewise.
* sysdeps/s390/multiarch/strncmp.c: Likewise.
* sysdeps/s390/multiarch/strncpy.c: Likewise.
* sysdeps/s390/multiarch/strnlen.c: Likewise.
* sysdeps/s390/multiarch/strpbrk.c: Likewise.
* sysdeps/s390/multiarch/strrchr.c: Likewise.
* sysdeps/s390/multiarch/strspn.c: Likewise.
* sysdeps/s390/multiarch/wcschr.c: Likewise.
* sysdeps/s390/multiarch/wcscmp.c: Likewise.
* sysdeps/s390/multiarch/wcspbrk.c: Likewise.
* sysdeps/s390/multiarch/wcsspn.c: Likewise.
* sysdeps/s390/multiarch/wmemchr.c: Likewise.
* sysdeps/s390/multiarch/wmemset.c: Likewise.
* sysdeps/s390/s390-32/multiarch/memcmp.c: Likewise.
* sysdeps/s390/s390-32/multiarch/memcpy.c: Likewise.
* sysdeps/s390/s390-32/multiarch/memset.c: Likewise.
* sysdeps/s390/s390-64/multiarch/memcmp.c: Likewise.
* sysdeps/s390/s390-64/multiarch/memcpy.c: Likewise.
* sysdeps/s390/s390-64/multiarch/memset.c: Likewise.

7 years agoUse gcc attribute ifunc in libc_ifunc macro instead of inline assembly due to false...
Stefan Liebler [Fri, 7 Oct 2016 07:56:46 +0000 (09:56 +0200)]
Use gcc attribute ifunc in libc_ifunc macro instead of inline assembly due to false debuginfo.

The current s390 ifunc resolver for vector optimized functions and the common
libc_ifunc macro in include/libc-symbols.h uses something like that to generate ifunc'ed functions:
extern void *__resolve___strlen(unsigned long int dl_hwcap) asm (strlen);
asm (".type strlen, %gnu_indirect_function");

This leads to false debug information:
objdump --dwarf=info libc.so:
...
<1><1e6424>: Abbrev Number: 43 (DW_TAG_subprogram)
    <1e6425>   DW_AT_external    : 1
    <1e6425>   DW_AT_name        : (indirect string, offset: 0x1146e): __resolve___strlen
    <1e6429>   DW_AT_decl_file   : 1
    <1e642a>   DW_AT_decl_line   : 23
    <1e642b>   DW_AT_linkage_name: (indirect string, offset: 0x1147a): strlen
    <1e642f>   DW_AT_prototyped  : 1
    <1e642f>   DW_AT_type        : <0x1e4ccd>
    <1e6433>   DW_AT_low_pc      : 0x998e0
    <1e643b>   DW_AT_high_pc     : 0x16
    <1e6443>   DW_AT_frame_base  : 1 byte block: 9c     (DW_OP_call_frame_cfa)
    <1e6445>   DW_AT_GNU_all_call_sites: 1
    <1e6445>   DW_AT_sibling     : <0x1e6459>
 <2><1e6449>: Abbrev Number: 44 (DW_TAG_formal_parameter)
    <1e644a>   DW_AT_name        : (indirect string, offset: 0x1845): dl_hwcap
    <1e644e>   DW_AT_decl_file   : 1
    <1e644f>   DW_AT_decl_line   : 23
    <1e6450>   DW_AT_type        : <0x1e4c8d>
    <1e6454>   DW_AT_location    : 0x122115 (location list)
...

The debuginfo for the ifunc-resolver function contains the DW_AT_linkage_name
field, which names the real function name "strlen". If you perform an inferior
function call to strlen in lldb, then it fails due to something like that:
"error: no matching function for call to 'strlen'
candidate function not viable: no known conversion from 'const char [6]'
to 'unsigned long' for 1st argument"

The unsigned long is the dl_hwcap argument of the resolver function.
The strlen function itself has no debufinfo.

The s390 ifunc resolver for memset & co uses something like that:
asm (".globl FUNC"
     ".type FUNC, @gnu_indirect_function"
     ".set FUNC, __resolve_FUNC");

This way the debuginfo for the ifunc-resolver function does not conain the
DW_AT_linkage_name field and the real function has no debuginfo, too.

Using this strategy for the vector optimized functions leads to some troubles
for functions like strnlen. Here we have __strnlen and a weak alias strnlen.
The __strnlen function is the ifunc function, which is realized with the asm-
statement above. The weak_alias-macro can't be used here due to undefined symbol:
gcc ../sysdeps/s390/multiarch/strnlen.c -c ...
In file included from <command-line>:0:0:
../sysdeps/s390/multiarch/strnlen.c:28:24: error: ‘strnlen’ aliased to undefined symbol ‘__strnlen’
 weak_alias (__strnlen, strnlen)
                        ^
./../include/libc-symbols.h:111:26: note: in definition of macro ‘_weak_alias’
   extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
                          ^
../sysdeps/s390/multiarch/strnlen.c:28:1: note: in expansion of macro ‘weak_alias’
 weak_alias (__strnlen, strnlen)
 ^
make[2]: *** [build/string/strnlen.o] Error 1

As the __strnlen function is defined with asm-statements the function name
__strnlen isn't known by gcc. But the weak alias can also be done with an
asm statement to resolve this issue:
__asm__ (".weak  strnlen\n\t"
         ".set   strnlen,__strnlen\n");

In order to use the weak_alias macro, gcc needs to know the ifunc function. The
minimum gcc to build glibc is currently 4.7, which supports attribute((ifunc)).
See https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html.
It is only supported if gcc is configured with --enable-gnu-indirect-function
or gcc supports it by default for at least intel and s390x architecture.
This patch uses the old behaviour if gcc support is not available.
Usage of attribute ifunc is something like that:
__typeof (FUNC) FUNC __attribute__ ((ifunc ("__resolve_FUNC")));

Then gcc produces the same .globl, .type, .set assembler instructions like above.
And the debuginfo does not contain the DW_AT_linkage_name field and there is no
debuginfo for the real function, too.

But in order to get it work, there is also some extra work to do.
Currently, the glibc internal symbol on s390x e.g. __GI___strnlen is not the
ifunc symbol, but the fallback __strnlen_c symbol. Thus I have to omit the
libc_hidden_def macro in strnlen.c (here is the ifunc function __strnlen)
because it is already handled in strnlen-c.c (here is __strnlen_c).

Due to libc_hidden_proto (__strnlen) in string.h, compiling fails:
gcc ../sysdeps/s390/multiarch/strnlen.c -c ...
In file included from <command-line>:0:0:
../sysdeps/s390/multiarch/strnlen.c:53:24: error: ‘strnlen’ aliased to undefined symbol ‘__strnlen’
 weak_alias (__strnlen, strnlen)
                        ^
./../include/libc-symbols.h:111:26: note: in definition of macro ‘_weak_alias’
   extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
                          ^
../sysdeps/s390/multiarch/strnlen.c:53:1: note: in expansion of macro ‘weak_alias’
 weak_alias (__strnlen, strnlen)
 ^
make[2]: *** [build/string/strnlen.os] Error 1

I have to redirect the prototypes for __strnlen in string.h and create a copy
of the prototype for using as ifunc function:
__typeof (__redirect___strnlen) __strnlen __attribute__ ((ifunc ("__resolve_strnlen")));
weak_alias (__strnlen, strnlen)

This way there is no trouble with the internal __GI_* symbols.
Glibc builds fine with this construct and the debuginfo is "correct".
For functions without a __GI_* symbol like memccpy this redirection is not needed.

This patch adjusts the common libc_ifunc and libm_ifunc macro to use gcc
attribute ifunc. Due to this change, the macro users where the __GI_* symbol
does not target the ifunc symbol have to be prepared with the redirection
construct.
Furthermore a configure check to test gcc support is added. If it is not supported,
the old behaviour is used.

This patch also prepares the libc_ifunc macro to be useable in s390-ifunc-macro.
The s390 ifunc-resolver-functions do have an hwcaps parameter and not all
resolvers need the same initialization code. The next patch in this series
changes the s390 ifunc macros to use this common one.

ChangeLog:

* include/libc-symbols.h (__ifunc_resolver):
New macro is used by __ifunc* macros.
(__ifunc): New macro uses gcc attribute ifunc or inline assembly
depending on HAVE_GCC_IFUNC.
(libc_ifunc, libm_ifunc): Use __ifunc as base macro.
(libc_ifunc_redirected, libc_ifunc_hidden, libm_ifunc_init): New macro.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finite.c:
Redirect ifunced function in header for using as type for ifunc function.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_finitef.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinf.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isinff.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnan.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/memset.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memcmp.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/mempcpy.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/stpncpy.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strcat.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strchr.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strcmp.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strcpy.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strncmp.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strncpy.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strnlen.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strrchr.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strstr.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_isnanf.c:
Add libc_hidden_def() and use libc_ifunc_hidden() macro
instead of libc_ifunc() macro.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Likewise.

7 years agoAdd configure check to test if gcc supports attribute ifunc.
Stefan Liebler [Fri, 7 Oct 2016 07:56:46 +0000 (09:56 +0200)]
Add configure check to test if gcc supports attribute ifunc.

This patch adds a configure check to test if gcc supports attribute ifunc.
The support can either be enabled in <gcc-src>/gcc/config.gcc for one
architecture in general by setting default_gnu_indirect_function variable to yes
or by configuring gcc with --enable-gnu-indirect-function.

The next patch rewrites libc_ifunc macro to use gcc attribute ifunc instead
of inline assembly to generate the IFUNC symbols due to false debuginfo.

If gcc does not support attribute ifunc, the old approach for generating
ifunc'ed symbols is used. Then the debug-information is false. Thus it is
recommended to use a gcc with indirect function support (See notes in INSTALL).
After this patch-series these inline assemblies for ifunc-handling are not
scattered in multiple files but are used only indirect via ifunc-macros
and can simply removed in libc-symbols.h in future.

If glibc is configured with --enable-multi-arch and gcc does not support
attribute ifunc, a configure warning is dumped!

ChangeLog:

* config.h.in (HAVE_GCC_IFUNC): New undef.
* configure.ac: Add check if gcc supports attribute ifunc feature.
* configure: Regenerated.
* manual/install.texi: Add recommendation for gcc with
indirect-function support.
* INSTALL: Regenerated.

7 years agoAdd iseqsig.
Joseph Myers [Thu, 6 Oct 2016 22:19:38 +0000 (22:19 +0000)]
Add iseqsig.

TS 18661-1 adds an iseqsig type-generic comparison macro to <math.h>.
This macro is like the == operator except that unordered operands
result in the "invalid" exception and errno being set to EDOM.

This patch implements this macro for glibc.  Given the need to set
errno, this is implemented with out-of-line functions __iseqsigf,
__iseqsig and __iseqsigl (of which the last only exists at all if long
double is ABI-distinct from double, so no function aliases or compat
support are needed).  The present patch ignores excess precision
issues; I intend to deal with those in a followup patch.  (Like
comparison operators, type-generic comparison macros should *not*
convert operands to their semantic types but should preserve excess
range and precision, meaning that for some argument types and values
of FLT_EVAL_METHOD, an underlying function should be called for a
wider type than that of the arguments.)

The underlying functions are implemented with the type-generic
template machinery.  Comparing x <= y && x >= y is sufficient in ISO C
to achieve an equality comparison with "invalid" raised for unordered
operands (and the results of those two comparisons can also be used to
tell whether errno needs to be set).  However, some architectures have
GCC bugs meaning that unordered comparison instructions are used
instead of ordered ones.  Thus, a mechanism is provided for
architectures to use an explicit call to feraiseexcept to raise
exceptions if required.  If your architecture has such a bug you
should add a fix-fp-int-compare-invalid.h header for it, with a
comment pointing to the relevant GCC bug report; if such a GCC bug is
fixed, that header's contents should have a __GNUC_PREREQ conditional
added so that the workaround can eventually be removed for that
architecture.

Tested for x86_64, x86, mips64, arm and powerpc.

* math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (iseqsig): New
macro.
* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(__iseqsig): New declaration.
* math/s_iseqsig_template.c: New file.
* math/Versions (__iseqsigf): New libm symbol at version
GLIBC_2.25.
(__iseqsig): Likewise.
(__iseqsigl): Likewise.
* math/libm-test.inc (iseqsig_test_data): New array.
(iseqsig_test): New function.
(main): Call iseqsig_test.
* math/Makefile (gen-libm-calls): Add s_iseqsigF.
* manual/arith.texi (FP Comparison Functions): Document iseqsig.
* manual/libm-err-tab.pl: Update comment on interfaces without
ulps tabulated.
* sysdeps/generic/fix-fp-int-compare-invalid.h: New file.
* sysdeps/powerpc/fpu/fix-fp-int-compare-invalid.h: Likewise.
* sysdeps/x86/fpu/fix-fp-int-compare-invalid.h: Likewise.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.

7 years agoUpdate comments for some functions in s_sin.c
Siddhesh Poyarekar [Thu, 6 Oct 2016 07:39:02 +0000 (13:09 +0530)]
Update comments for some functions in s_sin.c

Update comments for some functions to bring them in sync with what the
functions are actually doing.

7 years agoAdjust calls to do_sincos_1 and do_sincos_2 in s_sincos.c
Siddhesh Poyarekar [Thu, 6 Oct 2016 07:27:07 +0000 (12:57 +0530)]
Adjust calls to do_sincos_1 and do_sincos_2 in s_sincos.c

Adjust calls to do_sincos_1 and do_sincos_2 to pass a boolean
shift_quadrant instead of the numeric 0 and 1.

This does not affect codegen.

7 years agoMake quadrant shift a boolean in reduce_and_compute in s_sin.c
Siddhesh Poyarekar [Thu, 6 Oct 2016 07:24:04 +0000 (12:54 +0530)]
Make quadrant shift a boolean in reduce_and_compute in s_sin.c

Like the previous change, make the quadrant shift a boolean to make it
clearer that we will do at most a single rotation of the quadrants to
compute the cosine from the sine function.

This does not affect codegen.

7 years agoManual typos: System Databases and Name Service Switch
Siddhesh Poyarekar [Thu, 6 Oct 2016 07:06:25 +0000 (12:36 +0530)]
Manual typos: System Databases and Name Service Switch

       * manual/nss.texi: Fix typos in the manual.

7 years agoManual typos: Contributors to
Rical Jasan [Thu, 6 Oct 2016 07:00:03 +0000 (12:30 +0530)]
Manual typos: Contributors to

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/contrib.texi: Fix typos in the manual.

7 years agoManual typos: Library Maintenance
Rical Jasan [Thu, 6 Oct 2016 06:59:11 +0000 (12:29 +0530)]
Manual typos: Library Maintenance

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/maint.texi: Fix typos in the manual.

7 years agoManual typos: Installing
Rical Jasan [Thu, 6 Oct 2016 06:58:45 +0000 (12:28 +0530)]
Manual typos: Installing

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/install.texi: Fix typos in the manual.
* INSTALL: Regenerated.

7 years agoManual typos: C Language Facilities in the Library
Rical Jasan [Thu, 6 Oct 2016 06:57:48 +0000 (12:27 +0530)]
Manual typos: C Language Facilities in the Library

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/lang.texi: Fix typos in the manual.

7 years agoManual typos: Internal probes
Rical Jasan [Thu, 6 Oct 2016 06:56:35 +0000 (12:26 +0530)]
Manual typos: Internal probes

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/probes.texi: Fix typos in the manual.

7 years agoManual typos: POSIX Threads
Rical Jasan [Thu, 6 Oct 2016 06:56:06 +0000 (12:26 +0530)]
Manual typos: POSIX Threads

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/threads.texi: Fix typos in the manual.

7 years agoManual typos: Debugging support
Rical Jasan [Thu, 6 Oct 2016 06:55:38 +0000 (12:25 +0530)]
Manual typos: Debugging support

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/debug.texi: Fix typos in the manual.

7 years agoManual typos: DES Encryption and Password Handling
Rical Jasan [Thu, 6 Oct 2016 06:55:00 +0000 (12:25 +0530)]
Manual typos: DES Encryption and Password Handling

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/crypt.texi: Fix typos in the manual.

7 years agoManual typos: System Configuration Parameters
Rical Jasan [Thu, 6 Oct 2016 06:54:07 +0000 (12:24 +0530)]
Manual typos: System Configuration Parameters

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/conf.texi: Fix typos in the manual.

7 years agoManual typos: System Management
Rical Jasan [Thu, 6 Oct 2016 06:53:27 +0000 (12:23 +0530)]
Manual typos: System Management

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/sysinfo.texi: Fix typos in the manual.

7 years agoManual typos: Users and Groups
Rical Jasan [Thu, 6 Oct 2016 06:51:46 +0000 (12:21 +0530)]
Manual typos: Users and Groups

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/users.texi: Fix typos in the manual.

7 years agoManual typos: Job Control
Rical Jasan [Thu, 6 Oct 2016 06:50:28 +0000 (12:20 +0530)]
Manual typos: Job Control

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/job.texi: Fix typos in the manual.

7 years agoManual typos: Processes
Rical Jasan [Thu, 6 Oct 2016 06:49:59 +0000 (12:19 +0530)]
Manual typos: Processes

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/process.texi: Fix typos in the manual.

7 years agoManual typos: The Basic Program/System Interface
Rical Jasan [Thu, 6 Oct 2016 06:49:25 +0000 (12:19 +0530)]
Manual typos: The Basic Program/System Interface

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/argp.texi: Fix typos in the manual.
* manual/getopt.texi: Likewise.
* manual/startup.texi: Likewise.

7 years agoManual typos: Signal Handling
Rical Jasan [Thu, 6 Oct 2016 06:48:05 +0000 (12:18 +0530)]
Manual typos: Signal Handling

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/signal.texi: Fix typos in the manual.

7 years agoManual typos: Non-Local Exits
Rical Jasan [Thu, 6 Oct 2016 06:47:29 +0000 (12:17 +0530)]
Manual typos: Non-Local Exits

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/setjmp.texi: Fix typos in the manual.

7 years agoManual typos: Resource Usage and Limitation
Rical Jasan [Thu, 6 Oct 2016 06:46:53 +0000 (12:16 +0530)]
Manual typos: Resource Usage and Limitation

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/resource.texi: Fix typos in the manual.

7 years agoManual typos: Date and Time
Rical Jasan [Thu, 6 Oct 2016 06:44:36 +0000 (12:14 +0530)]
Manual typos: Date and Time

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/time.texi: Fix typos in the manual.

7 years agoManual typos: Arithmetic Functions
Rical Jasan [Thu, 6 Oct 2016 06:42:26 +0000 (12:12 +0530)]
Manual typos: Arithmetic Functions

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/arith.texi: Fix typos in the manual.

7 years agoManual typos: Mathematics
Rical Jasan [Thu, 6 Oct 2016 06:41:07 +0000 (12:11 +0530)]
Manual typos: Mathematics

2016-05-06  Rical Jasan  <ricaljasan@pacific.net>

* manual/math.texi: Fix typos in the manual.

This page took 0.101064 seconds and 5 git commands to generate.