platform/upstream/glibc.git
6 years agosupport: Simplify compiling most of support/ outside of glibc
Florian Weimer [Thu, 14 Dec 2017 12:48:56 +0000 (13:48 +0100)]
support: Simplify compiling most of support/ outside of glibc

Some include files were missing because they are implied by the
in-tree build process.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agox86-64: Remove sysdeps/x86_64/fpu/s_cosf.S
H.J. Lu [Thu, 14 Dec 2017 12:39:37 +0000 (04:39 -0800)]
x86-64: Remove sysdeps/x86_64/fpu/s_cosf.S

On Ivy Bridge, bench-cosf reports performance improvement:

           s_cosf.S      s_cosf.c       Improvement
max        114.136       82.401            39%
min        13.119        11.301            16%
mean       22.1882       21.8938           1%

* sysdeps/x86_64/fpu/s_cosf.S: Removed.

6 years agosparc: M7 optimized memset/bzero
Patrick McGehearty [Wed, 13 Dec 2017 20:14:17 +0000 (18:14 -0200)]
sparc: M7 optimized memset/bzero

Support added to identify Sparc M7/T7/S7/M8/T8 processor capability.
Performance tests run on Sparc S7 using new code and old niagara4 code.

Optimizations for memset also apply to bzero as they share code.

For memset/bzero, performance comparison with niagara4 code:
For memset nonzero data,
  256-1023 bytes - 60-90% gain (in cache); 5% gain (out of cache)
  1K+ bytes - 80-260% gain (in cache); 40-80% gain (out of cache)
For memset zero data (and bzero),
  256-1023 bytes - 80-120% gain (in cache), 0% gain (out of cache)
  1024+ bytes - 2-4x gain (in cache), 10-35% gain (out of cache)

Tested in sparcv9-*-* and sparc64-*-* targets in both multi and
non-multi arch configurations.

Patrick McGehearty <patrick.mcgehearty@oracle.com>
Adhemerval Zanella  <adhemerval.zanella@linaro.org>

* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
(sysdeps_routines): Add memset-niagara7.
* sysdeps/sparc/sparc64/multiarch/Makefile (sysdes_rotuines):
Likewise.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S: New
file.
* sysdeps/sparc/sparc64/multiarch/memset-niagara7.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Add __bzero_niagara7 and __memset_niagara7.
* sysdeps/sparc/sparc64/multiarch/ifunc-memset.h (IFUNC_SELECTOR):
Add niagara7 option.
* NEWS: Mention sparc m7 optimized memcpy, mempcpy, memmove, and
memset.

6 years agosparc: M7 optimized memcpy/mempcpy/memmove
Patrick McGehearty [Wed, 13 Dec 2017 20:12:17 +0000 (18:12 -0200)]
sparc: M7 optimized memcpy/mempcpy/memmove

Support added to identify Sparc M7/T7/S7/M8/T8 processor capability.
Performance tests run on Sparc S7 using new code and old niagara4 code.

Optimizations for memcpy also apply to mempcpy and memmove
where they share code. Optimizations for memset also apply
to bzero as they share code.

For memcpy/mempcpy/memmove, performance comparison with niagara4 code:
Long word aligned data
  0-127 bytes - minimal changes
  128-1023 bytes - 7-30% gain
  1024+ bytes - 1-7% gain (in cache); 30-100% gain (out of cache)
Word aligned data
  0-127 bytes - 50%+ gain
  128-1023 bytes - 10-200% gain
  1024+ bytes - 0-15% gain (in cache); 5-50% gain (out of cache)
Unaligned data
  0-127 bytes - 0-70%+ gain
  128-447 bytes - 40-80%+ gain
  448-511 bytes - 1-3% loss
  512-4096 bytes - 2-3% gain (in cache); 0-20% gain (out of cache)
  4096+ bytes - ± 3% (in cache); 20-50% gain (out of cache)

Tested in sparcv9-*-* and sparc64-*-* targets in both multi and
non-multi arch configurations.

Patrick McGehearty  <patrick.mcgehearty@oracle.com>
Adhemerval Zanella  <adhemerval.zanella@linaro.org>

* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
(sysdeps_routines): Add memcpy-memmove-niagara7 and memmove-ultra1.
* sysdeps/sparc/sparc64/multiarch/Makefile (sysdeps_routines):
Likewise.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S:
New file.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S: Likewise.
* sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
(__libc_ifunc_impl_list): Add __memcpy_niagara7, __mempcpy_niagara7,
and __memmove_niagara7.
* sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h (IFUNC_SELECTOR):
Add niagara7 option.
* sysdeps/sparc/sparc64/multiarch/memmove.c: New file.
* sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h: Likewise.
* sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/rtld-memmove.c: Likewise.

6 years agosparc: assembly version of memmove for ultra1+
Jose E. Marchesi [Wed, 13 Dec 2017 20:02:52 +0000 (18:02 -0200)]
sparc: assembly version of memmove for ultra1+

Tested in sparcv9-*-* and sparc64-*-* targets in both non-multi-arch and
multi-arch configurations.

* sysdeps/sparc/sparc32/sparcv9/memmove.S: New file.
* sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c: Likewise.
* sysdeps/sparc/sparc64/memmove.S: Likewise.
* sysdeps/sparc/sparc64/rtld-memmove.c: Likewise.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: support the ADP hw capability
Jose E. Marchesi [Wed, 13 Dec 2017 20:01:21 +0000 (18:01 -0200)]
sparc: support the ADP hw capability

This patch adds support for the ADP (also known as adi) hardware
capability, as reported by the kernel sparc port when running on M7
machines.

Tested in both sparcv9-*-* and sparc64-*-* targets.

* sysdeps/sparc/bits/hwcap.h (HWCAP_SPARC_ADP): Defined.
* sysdeps/sparc/dl-procinfo.c: Added "adp" to the
_dl_sparc_cap_flags array.
* sysdeps/sparc/dl-procinfo.h (_DL_HWCAP_COUNT): Increment.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoaarch64: Improve strcmp unaligned performance
Siddhesh Poyarekar [Wed, 13 Dec 2017 13:20:27 +0000 (18:50 +0530)]
aarch64: Improve strcmp unaligned performance

Replace the simple byte-wise compare in the misaligned case with a
dword compare with page boundary checks in place.  For simplicity I've
chosen a 4K page boundary so that we don't have to query the actual
page size on the system.

This results in up to 3x improvement in performance in the unaligned
case on falkor and about 2.5x improvement on mustang as measured using
bench-strcmp.

* sysdeps/aarch64/strcmp.S (misaligned8): Compare dword at a
time whenever possible.

6 years agoFix testing with nss-crypt.
Carlos O'Donell [Wed, 13 Dec 2017 02:32:42 +0000 (18:32 -0800)]
Fix testing with nss-crypt.

A glibc master build with --enable-nss-crypt using the NSS
crypto libraries fails during make check with the following error:

<command-line>:0:0: error: "USE_CRYPT" redefined [-Werror]
<command-line>:0:0: note: this is the location of the previous
definition

This is caused by commit 36975e8e7ea227f7006abdc722ecfefe2079429b
by H.J. Lu which replaces all = with +=. The fix is to undefine
USE_CRYPT before defining it to zero.

Committed as an obvious fix. Fixes the build issue on x86_64 with
no regressions.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agoAdd sysdeps/ieee754/soft-fp.
Joseph Myers [Tue, 12 Dec 2017 23:34:05 +0000 (23:34 +0000)]
Add sysdeps/ieee754/soft-fp.

The default sysdeps/ieee754 fma implementations rely on exceptions and
rounding modes to achieve correct results through internal use of
round-to-odd.  Thus, glibc configurations without support for
exceptions and rounding modes instead need to use implementations of
fma based on soft-fp.

At present, this is achieved via having implementation files in
soft-fp/ that are #included by sysdeps files for each glibc
configuration that needs them.  In general this means such a
configuration has its own s_fma.c and s_fmaf.c.

TS 18661-1 adds functions that do an operation (+ - * / sqrt fma) on
arguments wider than the return type, with a single rounding of the
infinite-precision result to that return type.  These are also
naturally implemented using round-to-odd on platforms with hardware
support for rounding modes and exceptions but lacking hardware support
for these narrowing operations themselves.  (Platforms that have
direct hardware support for such narrowing operations include at least
ia64, and Power ISA 2.07 or later, which I think means POWER8 or
later.)

So adding the remaining TS 18661-1 functions would mean at least six
narrowing function implementations (fadd fsub fmul fdiv ffma fsqrt),
with aliases for other types and further implementations in some
configurations, that need to be overridden for configurations lacking
hardware exceptions and rounding modes.  Requiring all such
configurations (currently seven of them) to have their own source
files for all those functions seems undesirable.

Thus, this patch adds a directory sysdeps/ieee754/soft-fp to contain
libm function implementations based on soft-fp.  This directory is
then used via Implies from all the configurations that need it, so no
more files need adding to every such configuration when adding more
functions with soft-fp implementations.  A configuration can still
selectively #include a particular file from this directory if desired;
thus, the MIPS #include of the fmal implementation is retained, since
that's appropriate even for hard float (because long double is always
implementated in software for MIPS64, so the soft-fp implementation of
fmal is better than the ldbl-128 one).

This also provides additional motivation for my recent patch removing
--with-fp / --without-fp: previously there was no need for correct use
of --without-fp for no-FPU ARM or SH3, and now we have autodetection
nofpu/ sysdeps directories can be used by this patch for those
configurations without imposing any new requirements on how glibc is
configured.

(The mips64/*/fpu/s_fma.c files added by this patch are needed to keep
the dbl-64 version of fma for double, rather than the ldbl-128 one,
used in that case.)

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch.

* soft-fp/fmadf4.c: Move to ....
* sysdeps/ieee754/soft-fp/s_fma.c: ... here.
* soft-fp/fmasf4.c: Move to ....
* sysdeps/ieee754/soft-fp/s_fmaf.c: ... here.
* soft-fp/fmatf4.c: Move to ....
* sysdeps/ieee754/soft-fp/s_fmal.c: ... here.
* sysdeps/ieee754/soft-fp/Makefile: New file.
* sysdeps/arm/preconfigure.ac: Define with_fp_cond.
* sysdeps/arm/preconfigure: Regenerated.
* sysdeps/arm/nofpu/Implies: New file.
* sysdeps/arm/s_fma.c: Remove file.
* sysdeps/arm/s_fmaf.c: Likewise.
* sysdeps/m68k/coldfire/nofpu/Implies: New file.
* sysdeps/m68k/coldfire/nofpu/s_fma.c: Remove file.
* sysdeps/m68k/coldfire/nofpu/s_fmaf.c: Likewise.
* sysdeps/microblaze/Implies: Add ieee754/soft-fp.
* sysdeps/microblaze/s_fma.c: Remove file.
* sysdeps/microblaze/s_fmaf.c: Likewise.
* sysdeps/mips/mips32/nofpu/Implies: New file.
* sysdeps/mips/mips64/n32/fpu/s_fma.c: Likewise.
* sysdeps/mips/mips64/n32/nofpu/Implies: Likewise.
* sysdeps/mips/mips64/n64/fpu/s_fma.c: Likewise.
* sysdeps/mips/mips64/n64/nofpu/Implies: Likewise.
* sysdeps/mips/ieee754/s_fma.c: Remove file.
* sysdeps/mips/ieee754/s_fmaf.c: Likewise.
* sysdeps/mips/ieee754/s_fmal.c: Update include for move of fmal
implementation.
* sysdeps/nios2/Implies: Add ieee754/soft-fp.
* sysdeps/nios2/s_fma.c: Remove file.
* sysdeps/nios2/s_fmaf.c: Likewise.
* sysdeps/sh/nofpu/Implies: New file.
* sysdeps/sh/s_fma.c: Remove file.
* sysdeps/sh/s_fmaf.c: Likewise.
* sysdeps/tile/Implies: Add ieee754/soft-fp.
* sysdeps/tile/s_fma.c: Remove file.
* sysdeps/tile/s_fmaf.c: Likewise.

6 years agox86-64: Add cosf with FMA
H.J. Lu [Tue, 12 Dec 2017 23:32:58 +0000 (15:32 -0800)]
x86-64: Add cosf with FMA

On Skylake, bench-cosf reports performance improvement:

            Before        After         Improvement
max        135.362       94.552            43%
min        8.532         7.688             11%
mean       17.1446       11.8128           45%

* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add s_cosf-sse2 and s_cosf-fma.
(CFLAGS-s_cosf-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/s_cosf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/s_cosf-sse2.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_cosf.c: Likewise.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoUse memcpy instead of strncpy in nscd/nscd.h to fix build problem with ToT GCC
Steve Ellcey [Tue, 12 Dec 2017 21:47:32 +0000 (13:47 -0800)]
Use memcpy instead of strncpy in nscd/nscd.h to fix build problem with ToT GCC

* nscd/nscd.h (init_traced_file): Change strncpy to memcpy.

6 years agolibio: Free backup area when it not required (BZ#22415)
Adhemerval Zanella [Wed, 22 Nov 2017 20:33:15 +0000 (18:33 -0200)]
libio: Free backup area when it not required (BZ#22415)

Some libio operations fail to correctly free the backup area (created
by _IO_{w}default_pbackfail on unget{w}c) resulting in either invalid
buffer free operations or memory leaks.

For instance, on the example provided by BZ#22415 a following
fputc after a fseek to rewind the stream issues an invalid free on
the buffer.  It is because although _IO_file_overflow correctly
(from fputc) correctly calls _IO_free_backup_area, the
_IO_new_file_seekoff (called by fseek) updates the FILE internal
pointers without first free the backup area (resulting in invalid
values in the internal pointers).

The wide version also shows an issue, but instead of accessing invalid
pointers it leaks the backup memory on fseek/fputwc operation.

Checked on x86_64-linux-gnu and i686-linux-gnu.

* libio/Makefile (tests): Add tst-bz22415.
(tst-bz22415-ENV): New rule.
(generated): Add tst-bz22415.mtrace and tst-bz22415.check.
(tests-special): Add tst-bz22415-mem.out.
($(objpfx)tst-bz22415-mem.out): New rule.
* libio/fileops.c (_IO_new_file_seekoff): Call _IO_free_backup_area
in case of a successful seek operation.
* libio/wfileops.c (_IO_wfile_seekoff): Likewise.
(_IO_wfile_overflow): Call _IO_free_wbackup_area in case a write
buffer is required.
* libio/tst-bz22415.c: New test.

6 years agoUpdate IA64 libm-test-ulps
Adhemerval Zanella [Tue, 12 Dec 2017 18:57:41 +0000 (16:57 -0200)]
Update IA64 libm-test-ulps

Ran on Itanium Processor 9020, GCC 7.2.1.

* sysdeps/ia64/fpu/libm-test-ulps: Update.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoia64: Add ipc_priv.h header to set __IPC_64 to zero
James Clarke [Tue, 12 Dec 2017 14:17:10 +0000 (12:17 -0200)]
ia64: Add ipc_priv.h header to set __IPC_64 to zero

When running strace, IPC_64 was set in the command, but ia64 is
an architecture where CONFIG_ARCH_WANT_IPC_PARSE_VERSION *isn't* set
in the kernel, so ipc_parse_version just returns IPC_64 without
clearing the IPC_64 bit in the command.

* sysdeps/unix/sysv/linux/ia64/ipc_priv.h: New file defining
__IPC_64 to 0 to avoid IPC_64 being set.

Signed-off-by: James Clarke <jrtc27@jrtc27.com>
6 years ago[BZ #22593] Fix nextafter and nexttoward declaration
Szabolcs Nagy [Tue, 12 Dec 2017 10:51:32 +0000 (10:51 +0000)]
[BZ #22593] Fix nextafter and nexttoward declaration

These functions set errno and thus the const attribute was wrong.

[BZ #22593]
* math/bits/mathcalls.h (nextafter): Remove const.
(nexttoward): Likewise.

6 years agoRemove --with-fp / --without-fp.
Joseph Myers [Tue, 12 Dec 2017 13:56:47 +0000 (13:56 +0000)]
Remove --with-fp / --without-fp.

There is a configure option --without-fp that specifies that nofpu
sysdeps directories should be used instead of fpu directories.

For most glibc configurations, this option is of no use: either there
is no valid nofpu variant of that configuration, or there are no fpu
or nofpu sysdeps directories for that processor and so the option does
nothing.  For a few configurations, if you are using a soft-float
compiler this option is required, and failing to use it generally
results in compilation errors from inline asm using unavailable
floating-point instructions.

We're moving away from --with-cpu to configuring glibc based on how
the compiler generates code, and it is natural to do so for
--without-fp as well; in most cases the soft-float and hard-float ABIs
are incompatible so you have no hope of building a working glibc with
an inappropriately configured compiler or libgcc.

This patch eliminates --without-fp, replacing it entirely by automatic
configuration based on the compiler.  Configurations for which this is
relevant (coldfire / mips / powerpc32 / sh) define a variable
with_fp_cond in their preconfigure fragments (under the same
conditions under which those fragments do anything); this is a
preprocessor conditional which the toplevel configure script then uses
in a test to determine which sysdeps directories to use.

The config.make with-fp variable remains.  It's used only by powerpc
(sysdeps/powerpc/powerpc32/Makefile) to add -mhard-float to various
flags variables.  For powerpc, -mcpu= options can imply use of
soft-float.  That could be an issue if you want to build for
e.g. 476fp, but are using --with-cpu=476 because there isn't a 476fp
sysdeps directory.  If in future we eliminate --with-cpu and replace
it entirely by testing the compiler, it would be natural at that point
to eliminate that code as well (as the user should then just use a
compiler defaulting to 476fp and the 476 sysdeps directory would be
used automatically).

Tested for x86_64, and tested with build-many-glibcs.py that installed
shared libraries are unchanged by this patch.

* configure.ac (--with-fp): Remove configure option.
(with_fp_cond): New variable.
(libc_cv_with_fp): New configure test.  Use this variable instead
of with_fp.
* configure: Regenerated.
* config.make.in (with-fp): Use @libc_cv_with_fp@.
* manual/install.texi (Configuring and compiling): Remove
--without-fp.
* INSTALL: Regenerated.
* sysdeps/m68k/preconfigure (with_fp_cond): Define for ColdFire.
* sysdeps/mips/preconfigure (with_fp_cond): Define.
* sysdeps/powerpc/preconfigure (with_fp_cond): Define for 32-bit.
* sysdeps/sh/preconfigure (with_fp_cond): Define.
* scripts/build-many-glibcs.py (Context.add_all_configs): Do not
use --without-fp to configure glibc.

6 years agomanual: Fix a typo in locale.texi.
Rical Jasan [Tue, 12 Dec 2017 11:21:53 +0000 (03:21 -0800)]
manual: Fix a typo in locale.texi.

* manual/locale.texi (nl_langinfo): Fix a typo.

6 years agomanual/conf.texi: add a missing underscore in front of SC_SSIZE_MAX [BZ #22588]
Aurelien Jarno [Mon, 11 Dec 2017 23:11:29 +0000 (00:11 +0100)]
manual/conf.texi: add a missing underscore in front of SC_SSIZE_MAX [BZ #22588]

Changelog:
* manual/conf.texi (SC_SSIZE_MAX): Rename into _SC_SSIZE_MAX.

6 years agoReplace = with += in CFLAGS-xxx.c/CPPFLAGS-xxx.c
H.J. Lu [Mon, 11 Dec 2017 21:11:16 +0000 (13:11 -0800)]
Replace = with += in CFLAGS-xxx.c/CPPFLAGS-xxx.c

Replace = with += in CFLAGS-xxx.c and CPPFLAGS-xxx.c to allow Makefile
under sysdeps to define CFLAGS-xx.c and CPPFLAGS-xxx.c.

* argp/Makefile (CFLAGS-argp-help.c): Replace = with +=.
(CFLAGS-argp-parse.c): Likewise.
(CFLAGS-argp-fmtstream.c): Likewise.
* crypt/Makefile (CPPFLAGS-sha256-crypt.c): Likewise.
(CPPFLAGS-sha512-crypt.c): Likewise.
(CPPFLAGS-md5-crypt.c): Likewise.
* debug/Makefile (CFLAGS-stack_chk_fail.c): Likewise.
(CFLAGS-stack_chk_fail_local.c): Likewise.
(CFLAGS-backtrace.c): Likewise.
(CFLAGS-sprintf_chk.c): Likewise.
(CFLAGS-snprintf_chk.c): Likewise.
(CFLAGS-vsprintf_chk.c): Likewise.
(CFLAGS-vsnprintf_chk.c): Likewise.
(CFLAGS-asprintf_chk.c): Likewise.
(CFLAGS-vasprintf_chk.c): Likewise.
(CFLAGS-obprintf_chk.c): Likewise.
(CFLAGS-dprintf_chk.c): Likewise.
(CFLAGS-vdprintf_chk.c): Likewise.
(CFLAGS-printf_chk.c): Likewise.
(CFLAGS-fprintf_chk.c): Likewise.
(CFLAGS-vprintf_chk.c): Likewise.
(CFLAGS-vfprintf_chk.c): Likewise.
(CFLAGS-gets_chk.c): Likewise.
(CFLAGS-fgets_chk.c): Likewise.
(CFLAGS-fgets_u_chk.c): Likewise.
(CFLAGS-fread_chk.c): Likewise.
(CFLAGS-fread_u_chk.c): Likewise.
(CFLAGS-swprintf_chk.c): Likewise.
(CFLAGS-vswprintf_chk.c): Likewise.
(CFLAGS-wprintf_chk.c): Likewise.
(CFLAGS-fwprintf_chk.c): Likewise.
(CFLAGS-vwprintf_chk.c): Likewise.
(CFLAGS-vfwprintf_chk.c): Likewise.
(CFLAGS-fgetws_chk.c): Likewise.
(CFLAGS-fgetws_u_chk.c): Likewise.
(CFLAGS-read_chk.c): Likewise.
(CFLAGS-pread_chk.c): Likewise.
(CFLAGS-pread64_chk.c): Likewise.
(CFLAGS-recv_chk.c): Likewise.
(CFLAGS-recvfrom_chk.c): Likewise.
(CFLAGS-tst-longjmp_chk.c): Likewise.
(CPPFLAGS-tst-longjmp_chk.c): Likewise.
(CFLAGS-tst-longjmp_chk2.c): Likewise.
(CPPFLAGS-tst-longjmp_chk2.c): Likewise.
(CFLAGS-tst-longjmp_chk3.c): Likewise.
(CPPFLAGS-tst-longjmp_chk3.c): Likewise.
(CFLAGS-tst-chk1.c): Likewise.
(CFLAGS-tst-chk2.c): Likewise.
(CFLAGS-tst-chk3.c): Likewise.
(CFLAGS-tst-chk4.cc): Likewise.
(CFLAGS-tst-chk5.cc): Likewise.
(CFLAGS-tst-chk6.cc): Likewise.
(CFLAGS-tst-lfschk1.c): Likewise.
(CFLAGS-tst-lfschk2.c): Likewise.
(CFLAGS-tst-lfschk3.c): Likewise.
(CFLAGS-tst-lfschk4.cc): Likewise.
(CFLAGS-tst-lfschk5.cc): Likewise.
(CFLAGS-tst-lfschk6.cc): Likewise.
(CFLAGS-tst-ssp-1.c): Likewise.
* dirent/Makefile (CFLAGS-scandir.c): Likewise.
(CFLAGS-scandir64.c): Likewise.
(CFLAGS-scandir-tail.c): Likewise.
(CFLAGS-scandir64-tail.c): Likewise.
* elf/Makefile (CPPFLAGS-dl-tunables.c): Likewise.
(CFLAGS-dl-tunables.c): Likewise.
(CFLAGS-dl-runtime.c): Likewise.
(CFLAGS-dl-lookup.c): Likewise.
(CFLAGS-dl-iterate-phdr.c): Likewise.
(CFLAGS-vismain.c): Likewise.
(CFLAGS-tst-linkall-static.c): Likewise.
(CFLAGS-tst-linkall-static.c): Likewise.
(CPPFLAGS-dl-load.c): Likewise.
(CFLAGS-ldconfig.c): Likewise.
(CFLAGS-dl-cache.c): Likewise.
(CFLAGS-cache.c): Likewise.
(CFLAGS-rtld.c): Likewise.
(CFLAGS-multiload.c): Likewise.
(CFLAGS-filtmod1.c): Likewise.
(CFLAGS-tst-align.c): Likewise.
(CFLAGS-tst-align2.c): Likewise.
(CFLAGS-tst-alignmod.c): Likewise.
(CFLAGS-tst-alignmod2.c): Likewise.
(CPPFLAGS-tst-execstack.c): Likewise.
(CFLAGS-tst-ptrguard1-static.c): Likewise.
(CFLAGS-tst-latepthreadmod.c): Likewise.
* grp/Makefile (CFLAGS-getgrgid_r.c): Likewise.
(CFLAGS-getgrnam_r.c): Likewise.
(CFLAGS-getgrent_r.c): Likewise.
(CFLAGS-getgrent.c): Likewise.
(CFLAGS-fgetgrent.c): Likewise.
(CFLAGS-fgetgrent_r.c): Likewise.
(CFLAGS-putgrent.c): Likewise.
(CFLAGS-initgroups.c): Likewise.
(CFLAGS-getgrgid.c): Likewise.
* gshadow/Makefile (CFLAGS-getsgent_r.c): Likewise.
(CFLAGS-getsgent.c): Likewise.
(CFLAGS-fgetsgent.c): Likewise.
(CFLAGS-fgetsgent_r.c): Likewise.
(CFLAGS-putsgent.c): Likewise.
(CFLAGS-getsgnam.c): Likewise.
(CFLAGS-getsgnam_r.c): Likewise.
* iconv/Makefile (CFLAGS-iconv_prog.c): Likewise.
(CFLAGS-iconv_charmap.c): Likewise.
(CFLAGS-dummy-repertoire.c): Likewise.
(CFLAGS-charmap.c): Likewise.
(CFLAGS-linereader.c): Likewise.
(CFLAGS-simple-hash.c): Likewise.
(CFLAGS-gconv_conf.c): Likewise.
(CFLAGS-iconvconfig.c): Likewise.
* inet/Makefile (CFLAGS-gethstbyad_r.c): Likewise.
(CFLAGS-gethstbyad.c): Likewise.
(CFLAGS-gethstbynm_r.c): Likewise.
(CFLAGS-gethstbynm.c): Likewise.
(CFLAGS-gethstbynm2_r.c): Likewise.
(CFLAGS-gethstbynm2.c): Likewise.
(CFLAGS-gethstent_r.c): Likewise.
(CFLAGS-gethstent.c): Likewise.
(CFLAGS-rcmd.c): Likewise.
(CFLAGS-getnetbynm_r.c): Likewise.
(CFLAGS-getnetbynm.c): Likewise.
(CFLAGS-getnetbyad_r.c): Likewise.
(CFLAGS-getnetbyad.c): Likewise.
(CFLAGS-getnetent_r.c): Likewise.
(CFLAGS-getnetent.c): Likewise.
(CFLAGS-getaliasent_r.c): Likewise.
(CFLAGS-getaliasent.c): Likewise.
(CFLAGS-getrpcent_r.c): Likewise.
(CFLAGS-getrpcent.c): Likewise.
(CFLAGS-getservent_r.c): Likewise.
(CFLAGS-getservent.c): Likewise.
(CFLAGS-getprtent_r.c): Likewise.
(CFLAGS-getprtent.c): Likewise.
(CFLAGS-either_ntoh.c): Likewise.
(CFLAGS-either_hton.c): Likewise.
(CFLAGS-getnetgrent.c): Likewise.
(CFLAGS-getnetgrent_r.c): Likewise.
(CFLAGS-tst-checks-posix.c): Likewise.
(CFLAGS-tst-sockaddr.c): Likewise.
* intl/Makefile (CFLAGS-tst-gettext.c): Likewise.
(CFLAGS-tst-translit.c): Likewise.
(CFLAGS-tst-gettext2.c): Likewise.
(CFLAGS-tst-codeset.c): Likewise.
(CFLAGS-tst-gettext3.c): Likewise.
(CFLAGS-tst-gettext4.c): Likewise.
(CFLAGS-tst-gettext5.c): Likewise.
(CFLAGS-tst-gettext6.c): Likewise.
* io/Makefile (CFLAGS-open.c): Likewise.
(CFLAGS-open64.c): Likewise.
(CFLAGS-creat.c): Likewise.
(CFLAGS-creat64.c): Likewise.
(CFLAGS-fcntl.c): Likewise.
(CFLAGS-poll.c): Likewise.
(CFLAGS-ppoll.c): Likewise.
(CFLAGS-lockf.c): Likewise.
(CFLAGS-statfs.c): Likewise.
(CFLAGS-fstatfs.c): Likewise.
(CFLAGS-statvfs.c): Likewise.
(CFLAGS-fstatvfs.c): Likewise.
(CFLAGS-fts.c): Likewise.
(CFLAGS-fts64.c): Likewise.
(CFLAGS-ftw.c): Likewise.
(CFLAGS-ftw64.c): Likewise.
(CFLAGS-lockf.c): Likewise.
(CFLAGS-posix_fallocate.c): Likewise.
(CFLAGS-posix_fallocate64.c): Likewise.
(CFLAGS-fallocate.c): Likewise.
(CFLAGS-fallocate64.c): Likewise.
(CFLAGS-read.c): Likewise.
(CFLAGS-write.c): Likewise.
(CFLAGS-test-stat.c): Likewise.
(CFLAGS-test-lfs.c): Likewise.
* libio/Makefile (CFLAGS-fileops.c): Likewise.
(CFLAGS-fputc.c): Likewise.
(CFLAGS-fputwc.c): Likewise.
(CFLAGS-freopen64.c): Likewise.
(CFLAGS-freopen.c): Likewise.
(CFLAGS-fseek.c): Likewise.
(CFLAGS-fseeko64.c): Likewise.
(CFLAGS-fseeko.c): Likewise.
(CFLAGS-ftello64.c): Likewise.
(CFLAGS-ftello.c): Likewise.
(CFLAGS-fwide.c): Likewise.
(CFLAGS-genops.c): Likewise.
(CFLAGS-getc.c): Likewise.
(CFLAGS-getchar.c): Likewise.
(CFLAGS-getwc.c): Likewise.
(CFLAGS-getwchar.c): Likewise.
(CFLAGS-iofclose.c): Likewise.
(CFLAGS-iofflush.c): Likewise.
(CFLAGS-iofgetpos64.c): Likewise.
(CFLAGS-iofgetpos.c): Likewise.
(CFLAGS-iofgets.c): Likewise.
(CFLAGS-iofgetws.c): Likewise.
(CFLAGS-iofputs.c): Likewise.
(CFLAGS-iofputws.c): Likewise.
(CFLAGS-iofread.c): Likewise.
(CFLAGS-iofsetpos64.c): Likewise.
(CFLAGS-iofsetpos.c): Likewise.
(CFLAGS-ioftell.c): Likewise.
(CFLAGS-iofwrite.c): Likewise.
(CFLAGS-iogetdelim.c): Likewise.
(CFLAGS-iogetline.c): Likewise.
(CFLAGS-iogets.c): Likewise.
(CFLAGS-iogetwline.c): Likewise.
(CFLAGS-ioputs.c): Likewise.
(CFLAGS-ioseekoff.c): Likewise.
(CFLAGS-ioseekpos.c): Likewise.
(CFLAGS-iosetbuffer.c): Likewise.
(CFLAGS-iosetvbuf.c): Likewise.
(CFLAGS-ioungetc.c): Likewise.
(CFLAGS-ioungetwc.c): Likewise.
(CFLAGS-oldfileops.c): Likewise.
(CFLAGS-oldiofclose.c): Likewise.
(CFLAGS-oldiofgetpos64.c): Likewise.
(CFLAGS-oldiofgetpos.c): Likewise.
(CFLAGS-oldiofsetpos64.c): Likewise.
(CFLAGS-oldiofsetpos.c): Likewise.
(CFLAGS-peekc.c): Likewise.
(CFLAGS-putc.c): Likewise.
(CFLAGS-putchar.c): Likewise.
(CFLAGS-putwc.c): Likewise.
(CFLAGS-putwchar.c): Likewise.
(CFLAGS-rewind.c): Likewise.
(CFLAGS-wfileops.c): Likewise.
(CFLAGS-wgenops.c): Likewise.
(CFLAGS-oldiofopen.c): Likewise.
(CFLAGS-iofopen.c): Likewise.
(CFLAGS-iofopen64.c): Likewise.
(CFLAGS-oldtmpfile.c): Likewise.
(CFLAGS-tst_putwc.c): Likewise.
* locale/Makefile (CFLAGS-md5.c): Likewise.
(CFLAGS-charmap.c): Likewise.
(CFLAGS-locfile.c): Likewise.
(CFLAGS-charmap-dir.c): Likewise.
* login/Makefile (CFLAGS-grantpt.c): Likewise.
(CFLAGS-getpt.c): Likewise.
(CFLAGS-pt_chown.c): Likewise.
* malloc/Makefile (CFLAGS-mcheck-init.c): Likewise.
(CFLAGS-obstack.c): Likewise.
* math/Makefile (CFLAGS-test-tgmath3.c): Likewise.
(CFLAGS-test-double-vlen4-wrappers.c): Likewise.
(CFLAGS-test-double-vlen8-wrappers.c): Likewise.
(CFLAGS-test-float-vlen8-wrappers.c): Likewise.
(CFLAGS-test-float-vlen16-wrappers.c): Likewise.
(CFLAGS-test-tgmath.c): Likewise.
(CFLAGS-test-tgmath2.c): Likewise.
(CFLAGS-test-tgmath-ret.c): Likewise.
(CFLAGS-test-powl.c): Likewise.
(CFLAGS-test-snan.c): Likewise.
(CFLAGS-test-signgam-finite.c): Likewise.
(CFLAGS-test-signgam-finite-c99.c): Likewise.
(CFLAGS-test-signgam-finite-c11.c): Likewise.
(CFLAGS-test-signgam-uchar.c): Likewise.
(CFLAGS-test-signgam-uchar-init.c): Likewise.
(CFLAGS-test-signgam-uchar-static.c): Likewise.
(CFLAGS-test-signgam-uchar-init-static.c): Likewise.
(CFLAGS-test-signgam-uint.c): Likewise.
(CFLAGS-test-signgam-uint-init.c): Likewise.
(CFLAGS-test-signgam-uint-static.c): Likewise.
(CFLAGS-test-signgam-uint-init-static.c): Likewise.
(CFLAGS-test-signgam-ullong.c): Likewise.
(CFLAGS-test-signgam-ullong-init.c): Likewise.
(CFLAGS-test-signgam-ullong-static.c): Likewise.
(CFLAGS-test-signgam-ullong-init-static.c): Likewise.
(CFLAGS-test-math-cxx11.cc): Likewise.
(CFLAGS-test-math-isinff.cc): Likewise.
(CFLAGS-test-math-iszero.cc): Likewise.
(CFLAGS-test-math-issignaling.cc): Likewise.
(CFLAGS-test-math-iscanonical.cc): Likewise.
(CFLAGS-test-iszero-excess-precision.c): Likewise.
(CFLAGS-test-iseqsig-excess-precision.c): Likewise.
(CFLAGS-test-flt-eval-method.c): Likewise.
(CFLAGS-test-fe-snans-always-signal.c): Likewise.
(CFLAGS-test-finite-macros.c): Likewise.
* misc/Makefile (CFLAGS-select.c): Likewise.
(CFLAGS-tsearch.c): Likewise.
(CFLAGS-lsearch.c): Likewise.
(CFLAGS-pselect.c): Likewise.
(CFLAGS-readv.c): Likewise.
(CFLAGS-writev.c): Likewise.
(CFLAGS-preadv.c): Likewise.
(CFLAGS-preadv64.c): Likewise.
(CFLAGS-pwritev.c): Likewise.
(CFLAGS-pwritev64.c): Likewise.
(CFLAGS-preadv2.c): Likewise.
(CFLAGS-preadv64v2.c): Likewise.
(CFLAGS-pwritev2.c): Likewise.
(CFLAGS-pwritev64v2.c): Likewise.
(CFLAGS-usleep.c): Likewise.
(CFLAGS-syslog.c): Likewise.
(CFLAGS-error.c): Likewise.
(CFLAGS-getpass.c): Likewise.
(CFLAGS-mkstemp.c): Likewise.
(CFLAGS-mkstemp64.c): Likewise.
(CFLAGS-getsysstats.c): Likewise.
(CFLAGS-getusershell.c): Likewise.
(CFLAGS-err.c): Likewise.
(CFLAGS-tst-tsearch.c): Likewise.
(CFLAGS-msync.c): Likewise.
(CFLAGS-fdatasync.c): Likewise.
(CFLAGS-fsync.c): Likewise.
* nptl/Makefile (CFLAGS-nptl-init.c): Likewise.
(CFLAGS-unwind.c): Likewise.
(CFLAGS-unwind-forcedunwind.c): Likewise.
(CFLAGS-pthread_cancel.c): Likewise.
(CFLAGS-pthread_setcancelstate.c): Likewise.
(CFLAGS-pthread_setcanceltype.c): Likewise.
(CFLAGS-cancellation.c): Likewise.
(CFLAGS-libc-cancellation.c): Likewise.
(CFLAGS-pthread_exit.c): Likewise.
(CFLAGS-forward.c): Likewise.
(CFLAGS-pthread_testcancel.c): Likewise.
(CFLAGS-pthread_join.c): Likewise.
(CFLAGS-pthread_timedjoin.c): Likewise.
(CFLAGS-pthread_once.c): Likewise.
(CFLAGS-pthread_cond_wait.c): Likewise.
(CFLAGS-sem_wait.c): Likewise.
(CFLAGS-sem_timedwait.c): Likewise.
(CFLAGS-fcntl.c): Likewise.
(CFLAGS-lockf.c): Likewise.
(CFLAGS-pread.c): Likewise.
(CFLAGS-pread64.c): Likewise.
(CFLAGS-pwrite.c): Likewise.
(CFLAGS-pwrite64.c): Likewise.
(CFLAGS-wait.c): Likewise.
(CFLAGS-waitpid.c): Likewise.
(CFLAGS-sigwait.c): Likewise.
(CFLAGS-msgrcv.c): Likewise.
(CFLAGS-msgsnd.c): Likewise.
(CFLAGS-tcdrain.c): Likewise.
(CFLAGS-open.c): Likewise.
(CFLAGS-open64.c): Likewise.
(CFLAGS-pause.c): Likewise.
(CFLAGS-recv.c): Likewise.
(CFLAGS-send.c): Likewise.
(CFLAGS-accept.c): Likewise.
(CFLAGS-sendto.c): Likewise.
(CFLAGS-connect.c): Likewise.
(CFLAGS-recvfrom.c): Likewise.
(CFLAGS-recvmsg.c): Likewise.
(CFLAGS-sendmsg.c): Likewise.
(CFLAGS-close.c): Likewise.
(CFLAGS-read.c): Likewise.
(CFLAGS-write.c): Likewise.
(CFLAGS-nanosleep.c): Likewise.
(CFLAGS-sigsuspend.c): Likewise.
(CFLAGS-msync.c): Likewise.
(CFLAGS-fdatasync.c): Likewise.
(CFLAGS-fsync.c): Likewise.
(CFLAGS-pt-system.c): Likewise.
(CFLAGS-tst-cleanup2.c): Likewise.
(CFLAGS-tst-cleanupx2.c): Likewise.
(CFLAGS-flockfile.c): Likewise.
(CFLAGS-ftrylockfile.c): Likewise.
(CFLAGS-funlockfile.c): Likewise.
(CFLAGS-tst-initializers1.c): Likewise.
(CFLAGS-tst-initializers1-c89.c): Likewise.
(CFLAGS-tst-initializers1-c99.c): Likewise.
(CFLAGS-tst-initializers1-c11.c): Likewise.
(CFLAGS-tst-initializers1-gnu89.c): Likewise.
(CFLAGS-tst-initializers1-gnu99.c): Likewise.
(CFLAGS-tst-initializers1-gnu11.c): Likewise.
* nscd/Makefile (CFLAGS-nscd_getpw_r.c): Likewise.
(CFLAGS-nscd_getgr_r.c): Likewise.
(CFLAGS-nscd_gethst_r.c): Likewise.
(CFLAGS-nscd_getai.c): Likewise.
(CFLAGS-nscd_initgroups.c): Likewise.
* posix/Makefile (CFLAGS-getaddrinfo.c): Likewise.
(CFLAGS-pause.c): Likewise.
(CFLAGS-pread.c): Likewise.
(CFLAGS-pread64.c): Likewise.
(CFLAGS-pwrite.c): Likewise.
(CFLAGS-pwrite64.c): Likewise.
(CFLAGS-sleep.c): Likewise.
(CFLAGS-wait.c): Likewise.
(CFLAGS-waitid.c): Likewise.
(CFLAGS-waitpid.c): Likewise.
(CFLAGS-getopt.c): Likewise.
(CFLAGS-wordexp.c): Likewise.
(CFLAGS-sysconf.c): Likewise.
(CFLAGS-pathconf.c): Likewise.
(CFLAGS-fpathconf.c): Likewise.
(CFLAGS-spawn.c): Likewise.
(CFLAGS-spawnp.c): Likewise.
(CFLAGS-spawni.c): Likewise.
(CFLAGS-glob.c): Likewise.
(CFLAGS-glob64.c): Likewise.
(CFLAGS-getconf.c): Likewise.
(CFLAGS-nanosleep.c): Likewise.
* pwd/Makefile (CFLAGS-getpwent_r.c): Likewise.
(CFLAGS-getpwent.c): Likewise.
(CFLAGS-getpw.c): Likewise.
(CFLAGS-fgetpwent_r.c): Likewise.
* resolv/Makefile (CFLAGS-res_hconf.c): Likewise.
* rt/Makefile (CFLAGS-aio_suspend.c): Likewise.
(CFLAGS-mq_timedreceive.c): Likewise.
(CFLAGS-mq_timedsend.c): Likewise.
(CFLAGS-clock_nanosleep.c): Likewise.
(CFLAGS-librt-cancellation.c): Likewise.
* shadow/Makefile (CFLAGS-getspent_r.c): Likewise.
(CFLAGS-getspent.c): Likewise.
(CFLAGS-fgetspent.c): Likewise.
(CFLAGS-fgetspent_r.c): Likewise.
(CFLAGS-putspent.c): Likewise.
(CFLAGS-getspnam.c): Likewise.
(CFLAGS-getspnam_r.c): Likewise.
* signal/Makefile (CFLAGS-sigpause.c): Likewise.
(CFLAGS-sigsuspend.c): Likewise.
(CFLAGS-sigtimedwait.c): Likewise.
(CFLAGS-sigwait.c): Likewise.
(CFLAGS-sigwaitinfo.c): Likewise.
(CFLAGS-sigreturn.c): Likewise.
* stdio-common/Makefile (CFLAGS-vfprintf.c): Likewise.
(CFLAGS-vfwprintf.c): Likewise.
(CFLAGS-tmpfile.c): Likewise.
(CFLAGS-tmpfile64.c): Likewise.
(CFLAGS-tempname.c): Likewise.
(CFLAGS-psignal.c): Likewise.
(CFLAGS-vprintf.c): Likewise.
(CFLAGS-cuserid.c): Likewise.
(CFLAGS-errlist.c): Likewise.
(CFLAGS-siglist.c): Likewise.
(CFLAGS-scanf15.c): Likewise.
(CFLAGS-scanf17.c): Likewise.
* stdlib/Makefile (CFLAGS-bsearch.c): Likewise.
(CFLAGS-msort.c): Likewise.
(CFLAGS-qsort.c): Likewise.
(CFLAGS-system.c): Likewise.
(CFLAGS-fmtmsg.c): Likewise.
(CFLAGS-strfmon.c): Likewise.
(CFLAGS-strfmon_l.c): Likewise.
(CFLAGS-strfromd.c): Likewise.
(CFLAGS-strfromf.c): Likewise.
(CFLAGS-strfroml.c): Likewise.
(CFLAGS-tst-bsearch.c): Likewise.
(CFLAGS-tst-qsort.c): Likewise.
(CFLAGS-tst-makecontext2.c): Likewise.
* sunrpc/Makefile (CFLAGS-xbootparam_prot.c): Likewise.
(CFLAGS-xnlm_prot.c): Likewise.
(CFLAGS-xrstat.c): Likewise.
(CFLAGS-xyppasswd.c): Likewise.
(CFLAGS-xklm_prot.c): Likewise.
(CFLAGS-xrex.c): Likewise.
(CFLAGS-xsm_inter.c): Likewise.
(CFLAGS-xmount.c): Likewise.
(CFLAGS-xrusers.c): Likewise.
(CFLAGS-xspray.c): Likewise.
(CFLAGS-xnfs_prot.c): Likewise.
(CFLAGS-xrquota.c): Likewise.
(CFLAGS-xkey_prot.c): Likewise.
(CFLAGS-auth_unix.c): Likewise.
(CFLAGS-key_call.c): Likewise.
(CFLAGS-pmap_rmt.c): Likewise.
(CFLAGS-clnt_perr.c): Likewise.
(CFLAGS-openchild.c): Likewise.
* sysvipc/Makefile (CFLAGS-msgrcv.c): Likewise.
(CFLAGS-msgsnd.c): Likewise.
* termios/Makefile (CFLAGS-tcdrain.c): Likewise.
* time/Makefile (CFLAGS-tzfile.c): Likewise.
(CFLAGS-tzset.c): Likewise.
(CFLAGS-getdate.c): Likewise.
(CFLAGS-test_time.c): Likewise.
(CPPFLAGS-tst-tzname.c): Likewise.
* timezone/Makefile (CFLAGS-zdump.c): Likewise.
(CFLAGS-zic.c): Likewise.
* wcsmbs/Makefile (CFLAGS-wcwidth.c): Likewise.
(CFLAGS-wcswidth.c): Likewise.
(CFLAGS-wcstol.c): Likewise.
(CFLAGS-wcstoul.c): Likewise.
(CFLAGS-wcstoll.c): Likewise.
(CFLAGS-wcstoull.c): Likewise.
(CFLAGS-wcstod.c): Likewise.
(CFLAGS-wcstold.c): Likewise.
(CFLAGS-wcstof128.c): Likewise.
(CFLAGS-wcstof.c): Likewise.
(CFLAGS-wcstol_l.c): Likewise.
(CFLAGS-wcstoul_l.c): Likewise.
(CFLAGS-wcstoll_l.c): Likewise.
(CFLAGS-wcstoull_l.c): Likewise.
(CFLAGS-wcstod_l.c): Likewise.
(CFLAGS-wcstold_l.c): Likewise.
(CFLAGS-wcstof128_l.c): Likewise.
(CFLAGS-wcstof_l.c): Likewise.
(CPPFLAGS-tst-wchar-h.c): Likewise.
(CPPFLAGS-wcstold_l.c): Likewise.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
6 years agoNew generic cosf
Paul Clarke [Mon, 11 Dec 2017 19:39:42 +0000 (17:39 -0200)]
New generic cosf

The same logic used in s_cosf.S version for x86 and powerpc
is used to create a generic s_cosf.c, so there is no performance
improvement in x86_64 and powerpc64.

* sysdeps/ieee754/flt-32/s_cosf.c: New implementation.

6 years agopowerpc: POWER8 memcpy optimization for cached memory
Adhemerval Zanella [Mon, 11 Dec 2017 19:39:42 +0000 (17:39 -0200)]
powerpc: POWER8 memcpy optimization for cached memory

On POWER8, unaligned memory accesses to cached memory has little impact
on performance as opposed to its ancestors.

It is disabled by default and will only be available when the tunable
glibc.tune.cached_memopt is set to 1.

                 __memcpy_power8_cached      __memcpy_power7
============================================================
    max-size=4096:     33325.70 ( 12.65%)        38153.00
    max-size=8192:     32878.20 ( 11.17%)        37012.30
   max-size=16384:     33782.20 ( 11.61%)        38219.20
   max-size=32768:     33296.20 ( 11.30%)        37538.30
   max-size=65536:     33765.60 ( 10.53%)        37738.40

* manual/tunables.texi (Hardware Capability Tunables): Document
glibc.tune.cached_memopt.
* sysdeps/powerpc/cpu-features.c: New file.
* sysdeps/powerpc/cpu-features.h: New file.
* sysdeps/powerpc/dl-procinfo.c [!IS_IN(ldconfig)]: Add
_dl_powerpc_cpu_features.
* sysdeps/powerpc/dl-tunables.list: New file.
* sysdeps/powerpc/ldsodefs.h: Include cpu-features.h.
* sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
(INIT_ARCH): Initialize use_aligned_memopt.
* sysdeps/powerpc/powerpc64/dl-machine.h [defined(SHARED &&
IS_IN(rtld))]: Restrict dl_platform_init availability and
initialize CPU features used by tunables.
* sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines):
Add memcpy-power8-cached.
* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Add
__memcpy_power8_cached.
* sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S:
New file.

Reviewed-by: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
6 years agostring: Replace = with += in CFLAGS-xxx.c
H.J. Lu [Mon, 11 Dec 2017 16:39:10 +0000 (08:39 -0800)]
string: Replace = with += in CFLAGS-xxx.c

Replace = with += in CFLAGS-xxx.c to allow Makefile under sysdeps to
define CFLAGS-xx.c.

* string/Makefile (CFLAGS-inl-tester.c): Replace = with +=.
(CFLAGS-noinl-tester.c): Likewise.
(CFLAGS-tst-strlen.c): Likewise.
(CFLAGS-stratcliff.c): Likewise.
(CFLAGS-test-ffs.c): Likewise.
(CFLAGS-tst-inlcall.c): Likewise.
(CFLAGS-tst-xbzero-opt.c): Likewise.
(CFLAGS-memcpy.c): Likewise.
(CFLAGS-wordcopy.c): Likewise.

6 years agoS390: Add CFI rule in _dl_runtime_resolve[_vx] for unwinding.
Stefan Liebler [Mon, 11 Dec 2017 07:47:51 +0000 (08:47 +0100)]
S390: Add CFI rule in _dl_runtime_resolve[_vx] for unwinding.

In _dl_runtime_resolve[_vx], unwinding fails after the new stack frame
is created as there is no CFI rule for r15. This is also observeable in
GDB: Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Therefore this patch is now storing r15 on stack and is using cfi_offset rule.
The stmg/lmg instruction is used to store/load r14 and r15 with one instruction.
On 64bit, the offsets of the fprs have moved to store r15 directly after r14.
On 31bit, the r14/r15 is now stored between the other gprs and fprs as the space
wasn't used.

ChangeLog:

* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_resolve):
Store r15 on stack and add cfi rule.
* sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_resolve):
Likewise.

6 years agoelf/rtld.c (init_tls): Add missing new line to the _dl_fatal_printf call [BZ #22577]
Aurelien Jarno [Sun, 10 Dec 2017 18:09:04 +0000 (19:09 +0100)]
elf/rtld.c (init_tls): Add missing new line to the _dl_fatal_printf call [BZ #22577]

Changelog:
* elf/rtld.c (init_tls): Add missing new line to the _dl_fatal_printf
call.

6 years agox86-64: Add sinf with FMA
H.J. Lu [Thu, 7 Dec 2017 18:11:02 +0000 (10:11 -0800)]
x86-64: Add sinf with FMA

On Skylake, bench-sinf reports performance improvement:

            Before        After         Improvement
max        153.996       100.094           54%
min        8.546         6.852             25%
mean       18.1223       11.802            54%

* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add s_sinf-sse2 and s_sinf-fma.
(CFLAGS-s_sinf-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/s_sinf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/s_sinf-sse2.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sinf.c: Likewise.

6 years agox86-64: Remove sysdeps/x86_64/fpu/s_sinf.S
H.J. Lu [Thu, 7 Dec 2017 17:44:04 +0000 (09:44 -0800)]
x86-64: Remove sysdeps/x86_64/fpu/s_sinf.S

On Ivy Bridge, bench-sinf reports performance improvement:

          s_sinf.S      s_sinf.c       Improvement
max        91.521        86.148            6%
min        14.061        11.265            25%
mean       23.3758       23.3344           0.2%

* sysdeps/x86_64/fpu/s_sinf.S: Removed.

6 years agoFix ctanh (0 + i NaN), ctanh (0 + i Inf) (bug 22568, DR#471).
Joseph Myers [Thu, 7 Dec 2017 16:21:00 +0000 (16:21 +0000)]
Fix ctanh (0 + i NaN), ctanh (0 + i Inf) (bug 22568, DR#471).

As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should
return 0 + i NaN (with "invalid" exception in the second case but not
the first), not NaN + i NaN.  This has corresponding implications for
ctan since its special cases are defined by ctan (z) = -i ctanh (iz).
This patch implements these cases for ctanh and ctan, updating
tests accordingly.

Tested for x86_64.

[BZ #22568]
* math/s_ctan_template.c (M_DECL_FUNC (__ctan)): Set imaginary
part of result to imaginary part of argument if it is zero and the
real part of the argument is not finite.
* math/s_ctanh_template.c (M_DECL_FUNC (__ctanh)): Set real part
of result to real part of argument if it is zero and the imaginary
part of the argument is not finite.

6 years agolt_LT locale: Base collation on copy "iso14651_t1" [BZ #22524]
Mike FABIAN [Wed, 6 Dec 2017 13:37:42 +0000 (14:37 +0100)]
lt_LT locale: Base collation on copy "iso14651_t1" [BZ #22524]

[BZ #22524]
* localedata/Makefile: Add lt_LT.UTF-8 to test-input
and to the list of locales to be built for testing.
* localedata/lt_LT.UTF-8.in: New file for testing the collation.
* localedata/locales/lt_LT (LC_COLLATE): Use “copy "iso14651_t1"”
and build the collation rules upon that.

6 years agoAdd _Float32 function aliases.
Joseph Myers [Thu, 7 Dec 2017 00:48:31 +0000 (00:48 +0000)]
Add _Float32 function aliases.

This patch concludes filling out TS 18661-3 support for different
types by adding *f32 function aliases of float functions to support
_Float32.  As with _Float64 and _Float32x, this is supported for all
glibc configurations.  As with the previous such patches there are
some x86 ulps updates because of inline functions present for float
but not for _Float32.  The patch also has the usual
bits/floatn-common.h update, symbol versions, ABI baselines updates,
test enablement and documentation.

Tested for x86_64 and x86, and with build-many-glibcs.py, with both
GCC 6 and GCC 7.

* bits/floatn-common.h (__HAVE_FLOAT32): Define to 1.
* manual/math.texi (Mathematics): Document support for _Float32.
* math/Makefile (test-types): Add float32.
* math/Versions (GLIBC_2.27): Add _Float32 functions.
* stdlib/Versions (GLIBC_2.27): Likewise.
* wcsmbs/Versions (GLIBC_2.27): Likewise.
* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.

* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.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/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.

6 years agoSupport defining strtof32, wcstof32 aliases.
Joseph Myers [Wed, 6 Dec 2017 23:06:12 +0000 (23:06 +0000)]
Support defining strtof32, wcstof32 aliases.

This patch adds support for defining strtof32, wcstof32, strtof32_l
and wcstof32_l functions as aliases of the corresponding float
functions when _Float32 support is enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float32 changes.

* stdlib/strtof.c: Include <bits/floatn.h>
[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32): Define
and later undefine as macro.  Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32): Define
and later undefine as macro.  Define as weak alias if
[USE_WIDE_CHAR].
* stdlib/strtof_l.c: Include <bits/floatn.h>
[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32_l): Define
and later undefine as macro.  Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32_l): Define
and later undefine as macro.  Define as weak alias if
[USE_WIDE_CHAR].

6 years agoSupport defining strfromf32 alias.
Joseph Myers [Wed, 6 Dec 2017 22:44:56 +0000 (22:44 +0000)]
Support defining strfromf32 alias.

This patch adds support for defining strfromf32 as an alias of
strfromf when _Float32 support is enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float32 changes.

* stdlib/strfromf.c: Include <bits/floatn.h>.
[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strfromf32): Define
and later undefine as macro and define as weak alias.

6 years agoAdd header for _Float32 testing.
Joseph Myers [Wed, 6 Dec 2017 22:17:11 +0000 (22:17 +0000)]
Add header for _Float32 testing.

This patch adds the header required for testing _Float32 function
aliases, using float ulps.  The corresponding makefile support will be
included in the main patch that enables those aliases.

In conjunction with other _Float32 changes, tested for x86_64 and with
build-many-glibcs.py.

* math/test-float32.h: New file.

6 years agoSupport _Float32 in libm_alias_float.
Joseph Myers [Wed, 6 Dec 2017 22:14:09 +0000 (22:14 +0000)]
Support _Float32 in libm_alias_float.

This patch makes the libm_alias_float macro support creating _Float32
aliases, in preparation for enabling glibc support for that type.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float32 changes.

* sysdeps/generic/libm-alias-float.h: Include <bits/floatn.h>.
[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32]
(libm_alias_float_other_r): Create f32 alias.
(libm_alias_float_r): Use semicolon before call to
libm_alias_float_other_r.

6 years agoCorrect some ia64 libm_alias_float_other calls.
Joseph Myers [Wed, 6 Dec 2017 21:50:32 +0000 (21:50 +0000)]
Correct some ia64 libm_alias_float_other calls.

This patch corrects three ia64 libm_alias_float_other calls so they
generate the intended _Float32 aliases when such aliases are enabled.

Tested with build-many-glibcs.py for ia64-linux-gnu (that installed
stripped shared libraries are unchanged when applied to current
sources, and that this enables compilation tests to pass when used in
conjunction with other _Float32 patches).

* sysdeps/ia64/fpu/e_exp2f.S (__exp2f): Use exp2 not __exp2 as
second argument to libm_alias_float_other.
* sysdeps/ia64/fpu/e_log2f.S (__log2f): Use log2 not __log2 as
second argument to libm_alias_float_other.
* sysdeps/ia64/fpu/e_powf.S (__powf): Use pow not __pow as second
argument to libm_alias_float_other.

6 years agoMake cacosh (0 + iNaN) return NaN + i pi/2 (bug 22561, DR#471).
Joseph Myers [Wed, 6 Dec 2017 21:35:20 +0000 (21:35 +0000)]
Make cacosh (0 + iNaN) return NaN + i pi/2 (bug 22561, DR#471).

As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 +
iNaN) should return NaN +/- i pi/2, not NaN + iNaN.

This patch fixes the code accordingly.  The test has hardcoded the
result with positive sign of the imaginary part (with an associated
comment), since the unspecified sign for a result other than 0 or
infinity isn't currently supported by the test infrastructure.

Tested for x86_64.

[BZ #22561]
* math/s_cacosh_template.c (M_DECL_FUNC (__cacosh)): Use pi/2 for
real part of result for argument 0 + i * NaN.
* math/libm-test-cacosh.inc (cacosh_test_data): Update expected
results for tests of 0 + i * NaN.

6 years agoUpdate Alpha libm-test-ulps
Adhemerval Zanella [Wed, 6 Dec 2017 20:55:09 +0000 (18:55 -0200)]
Update Alpha libm-test-ulps

* sysdeps/alpha/fpu/libm-test-ulps: Update.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoSparc ulp update.
David S. Miller [Wed, 6 Dec 2017 20:18:51 +0000 (12:18 -0800)]
Sparc ulp update.

* sysdeps/sparc/fpu/libm-test-ulps: Update
exp_{downward,towardzero,upward} ulps.

6 years agoDon't make local variables static in ldbl-96 j1l.
Joseph Myers [Wed, 6 Dec 2017 15:19:06 +0000 (15:19 +0000)]
Don't make local variables static in ldbl-96 j1l.

The ldbl-96 implementation of j1l has some function-local variables
that are declared static for no apparent reason (this dates back to
the first addition of that file).

Any vaguely recent compiler, probably including any that are supported
for building glibc, optimizes away the "static" here, as the values of
the variables on entry to the function are dead.  So there is not
actually a user-visible bug here at present (but with any compilers
that didn't optimize away the static at all, possibly building with
less or no optimization, so that the function stored intermediate
values to and then loaded them from the variables, there would have
been a thread-safety issue).  But the "static" clearly doesn't belong
there and might potentially make things unsafe were compilation
without optimization to be supported in future, so this patch removes
it.

Tested for x86_64.

* sysdeps/ieee754/ldbl-96/e_j1l.c (qone): Don't make local
variables static.

6 years agoMake some ldbl-128, ldbl-128ibm arrays const.
Joseph Myers [Wed, 6 Dec 2017 13:42:58 +0000 (13:42 +0000)]
Make some ldbl-128, ldbl-128ibm arrays const.

I noticed that an x86_64 build of libm unexpectedly contained more
non-constant data than an older version (before _Float128 support)
did.  The problem is non-const arrays in the ldbl-128 j0l and j1l
implementations; this patch makes those arrays, and the corresponding
ldbl-128ibm ones, const.

Tested for x86_64, and tested compilation for powerpc with
build-many-glibcs.py.

* sysdeps/ieee754/ldbl-128/e_j0l.c (Y0_2N): Make const.
(Y0_2D): Likewise.
* sysdeps/ieee754/ldbl-128/e_j1l.c (Y0_2N): Likewise.
(Y0_2D): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_j0l.c (Y0_2N): Likewise.
(Y0_2D): Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_j1l.c (Y0_2N): Likewise.
(Y0_2D): Likewise.

6 years agohsb_DE locale: Base collation on copy "iso14651_t1" [BZ #22515]
Mike FABIAN [Wed, 6 Dec 2017 09:02:48 +0000 (10:02 +0100)]
hsb_DE locale: Base collation on copy "iso14651_t1" [BZ #22515]

[BZ #22515]
* localedata/Makefile: Add hsb_DE.UTF-8 to test-input
and to the list of locales to be built for testing.
* localedata/hsb_DE.UTF-8.in: New file for testing the collation.
* localedata/locales/hsb_DE (LC_COLLATE): Use “copy "iso14651_t1"”
and build the collation rules upon that.

6 years agoAdd references to CVE-2017-17426
Florian Weimer [Wed, 6 Dec 2017 06:39:25 +0000 (07:39 +0100)]
Add references to CVE-2017-17426

6 years agoUpdate NEWS to add sinf optimization
Rajalakshmi Srinivasaraghavan [Wed, 6 Dec 2017 05:19:11 +0000 (10:49 +0530)]
Update NEWS to add sinf optimization

6 years agoAdd _Float64, _Float32x function aliases.
Joseph Myers [Wed, 6 Dec 2017 00:58:03 +0000 (00:58 +0000)]
Add _Float64, _Float32x function aliases.

This patch continues filling out TS 18661-3 support by adding *f64 and
*f32x function aliases, supporting _Float64 and _Float32x, as aliases
for double functions.  These types are supported for all glibc
configurations.  The API corresponds exactly to that for _Float128 and
_Float64x.  _Float32 aliases to float functions remain to be added in
subsequent patches to complete this process (then there are a few
miscellaneous functions in TS 18661-3 to implement that aren't simply
versions of existing functions for new types).

The patch enables the feature in bits/floatn-common.h, adds symbol
versions and documentation with updates to ABI baselines, and arranges
for the libm functions for the new types to be tested.  As with the
_Float64x changes there are some x86 ulps updates because of header
inlines not used for the new types (and one other change to the
non-multiarch libm-test-ulps, which I suppose comes from using a
different compiler version / configuration from when it was last
regenerated).

Tested for x86_64 and x86, and with build-many-glibcs.py, with both
GCC 6 and GCC 7.

* bits/floatn-common.h (__HAVE_FLOAT64): Define to 1.
(__HAVE_FLOAT32X): Likewise.
* manual/math.texi (Mathematics): Document support for _Float64
and _Float32x.
* math/Makefile (test-types): Add float64 and float32x.
* math/Versions (GLIBC_2.27): Add _Float64 and _Float32x
functions.
* stdlib/Versions (GLIBC_2.27): Likewise.
* wcsmbs/Versions (GLIBC_2.27): Likewise.
* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.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/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.

6 years agoUse long double not double for _Float64 with old GCC if values the same.
Joseph Myers [Tue, 5 Dec 2017 21:52:15 +0000 (21:52 +0000)]
Use long double not double for _Float64 with old GCC if values the same.

If double, long double and _Float64 all have the same set of values,
TS 18661-3 requires the usual arithmetic conversions on long double
and _Float64 to produce _Float64.  For this to be the case when
building with a compiler without a distinct _Float64 type, _Float64
must be a typedef for long double, not for double.  (_Float32x,
however, must be double in such a case, not long double, because the
usual arithmetic conversions on _Float32x and double must produce
double.)

This patch adjusts the fallback definition of _Float64 and associated
macros accordingly in that case, to fix the build of test-tgmath3 with
GCC 6 for such a configuration.  Tested in conjunction with _Float64
changes with build-many-glibcs.py for arm-linux-gnueabi, to make sure
the issue with test-tgmath3 is fixed.  Also tested for x86_64.

* bits/floatn-common.h: Include <bits/long-double.h>.
[__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
&& __NO_LONG_DOUBLE_MATH] (__f64): Use suffix 'l'.
[__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
&& __NO_LONG_DOUBLE_MATH] (__CFLOAT64): Use _Complex long double.
[__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
&& __NO_LONG_DOUBLE_MATH] (_Float64): Use long double.
[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
(__builtin_huge_valf64): Use __builtin_huge_vall.
[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
(__builtin_inff64): Use __builtin_infl.
[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
(__builtin_nanf64): Use __builtin_nanl.
[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
(__builtin_nansf64): Use __builtin_nansl.

6 years agoAdd elision tunables
Rogerio Alves [Tue, 5 Dec 2017 16:24:14 +0000 (14:24 -0200)]
Add elision tunables

This patch adds several new tunables to control the behavior of
elision on supported platforms[1].   Since elision now depends
on tunables, we should always *compile* with elision enabled,
and leave the code disabled, but available for runtime
selection.  This gives us *much* better compile-time testing of
the existing code to avoid bit-rot[2].

Tested on ppc, ppc64, ppc64le, s390x and x86_64.

[1] This part of the patch was initially proposed by
Paul Murphy but was "staled" because the framework have changed
since the patch was originally proposed:

https://patchwork.sourceware.org/patch/10342/

[2] This part of the patch was inititally proposed as a RFC by
Carlos O'Donnell.  Make sense to me integrate this on the patch:

https://sourceware.org/ml/libc-alpha/2017-05/msg00335.html

* elf/dl-tunables.list: Add elision parameters.
* manual/tunables.texi: Add entries about elision tunable.
* sysdeps/unix/sysv/linux/powerpc/elision-conf.c:
Add callback functions to dynamically enable/disable elision.
Add multiple callbacks functions to set elision parameters.
Deleted __libc_enable_secure check.
* sysdeps/unix/sysv/linux/s390/elision-conf.c: Likewise.
* sysdeps/unix/sysv/linux/x86/elision-conf.c: Likewise.
* configure: Regenerated.
* configure.ac: Option enable_lock_elision was deleted.
* config.h.in: ENABLE_LOCK_ELISION flag was deleted.
* config.make.in: Remove references to enable_lock_elision.
* manual/install.texi: Elision configure option was removed.
* INSTALL: Regenerated to remove enable_lock_elision.
* nptl/Makefile:
Disable elision so it can verify error case for destroying a mutex.
* sysdeps/powerpc/nptl/elide.h:
Cleanup ENABLE_LOCK_ELISION check.
Deleted macros for the case when ENABLE_LOCK_ELISION was not defined.
* sysdeps/s390/configure: Regenerated.
* sysdeps/s390/configure.ac: Remove references to enable_lock_elision..
* nptl/tst-mutex8.c:
Deleted all #ifndef ENABLE_LOCK_ELISION from the test.
* sysdeps/powerpc/powerpc32/sysdep.h:
Deleted all ENABLE_LOCK_ELISION checks.
* sysdeps/powerpc/powerpc64/sysdep.h: Likewise.
* sysdeps/powerpc/sysdep.h: Likewise.
* sysdeps/s390/nptl/bits/pthreadtypes-arch.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/force-elision.h: Likewise.
* sysdeps/unix/sysv/linux/s390/elision-conf.h: Likewise.
* sysdeps/unix/sysv/linux/s390/force-elision.h: Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/s390/Makefile: Remove references to
enable-lock-elision.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agoSupport defining strtof64, strtof32x, wcstof64, wcstof32x aliases.
Joseph Myers [Tue, 5 Dec 2017 18:31:53 +0000 (18:31 +0000)]
Support defining strtof64, strtof32x, wcstof64, wcstof32x aliases.

This patch adds support for defining strtof64, strtof32x, wcstof64,
wcstof32x and the corresponding _l functions as aliases of the
corresponding double functions when _Float64 and _Float32x support is
enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float64 / _Float32x changes.

* stdlib/strtod.c: Include <bits/floatn.h>.
(BUILD_DOUBLE): New macro.
[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
(strtof64): Define and later undefine as macro.  Define as weak
alias if [!USE_WIDE_CHAR].
[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
(wcstof64): Define and later undefine as macro.  Define as weak
alias if [USE_WIDE_CHAR].
[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
(strtof32x): Define and later undefine as macro.  Define as weak
alias if [!USE_WIDE_CHAR].
[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
(wcstof32x): Define and later undefine as macro.  Define as weak
alias if [USE_WIDE_CHAR].
* stdlib/strtod_l.c: Include <bits/floatn.h>.
(BUILD_DOUBLE): New macro.
[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
(strtof64_l): Define and later undefine as macro.  Define as weak
alias if [!USE_WIDE_CHAR].
[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
(wcstof64_l): Define and later undefine as macro.  Define as weak
alias if [USE_WIDE_CHAR].
[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
(strtof32x_l): Define and later undefine as macro.  Define as weak
alias if [!USE_WIDE_CHAR].
[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
(wcstof32x_l): Define and later undefine as macro.  Define as weak
alias if [USE_WIDE_CHAR].

6 years agomath: Use sign as double for reduced case in sinf
Adhemerval Zanella [Tue, 5 Dec 2017 17:27:03 +0000 (15:27 -0200)]
math: Use sign as double for reduced case in sinf

This patch avoid an extra floating point to integer conversion in
reduced internal function for generic sinf by defining the sign as
double instead of integers.

There is no much difference on Haswell with GCC 7.2.1:

           Before        After
min          9.11        9.108
mean       21.982      21.9224

However H.J. Lu reported gains on Skylake:

Before:

  "sinf": {
   "": {
    "duration": 3.4044e+10,
    "iterations": 1.9942e+09,
    "max": 141.106,
    "min": 7.704,
    "mean": 17.0715
   }
  }

After:

  "sinf": {
   "": {
    "duration": 3.40665e+10,
    "iterations": 2.03199e+09,
    "max": 95.994,
    "min": 7.704,
    "mean": 16.765
   }
  }

Checked on x86_64-linux-gnu.

* sysdeps/ieee754/flt-32/s_sinf.c (ones): Define as double.
(reduced): Use ones as double instead of integer.

6 years ago[PATCH] fix sinf(NAN)
Szabolcs Nagy [Tue, 5 Dec 2017 18:09:22 +0000 (18:09 +0000)]
[PATCH] fix sinf(NAN)

sinf(NAN) should not signal invalid fp exception
so use isless instead of < where NAN is compared.

this makes the sinf tests pass on aarch64.

* sysdeps/ieee754/flt-32/s_sinf.c (sinf): Use isless.

6 years agoSupport defining strfromf64, strfromf32x aliases.
Joseph Myers [Tue, 5 Dec 2017 18:01:25 +0000 (18:01 +0000)]
Support defining strfromf64, strfromf32x aliases.

This patch adds support for defining strfromf64 and strfromf32x
aliases of strfromd when the corresponding types are enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float64 / _Float32x changes.

* stdlib/strfromd.c: Include <bits/floatn.h>.
[__HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strfromf64): Define
and later undefine as macro and define as weak alias.
[__HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strfromf32x):
Likewise.

6 years agoAdd headers for _Float64, _Float32x testing.
Joseph Myers [Tue, 5 Dec 2017 17:34:25 +0000 (17:34 +0000)]
Add headers for _Float64, _Float32x testing.

This patch adds the headers required for testing _Float64 and
_Float32x function aliases (using double ulps).  The corresponding
makefile support will be included in the patch that actually adds
those aliases; there doesn't seem much point in adding makefile
conditionals for testing something that will be available
unconditionally.

In conjunction with other _Float64 / _Float32x changes, test for
x86_64 and with build-many-glibcs.py.

* math/test-float32x.h: New file.
* math/test-float64.h: Likewise.

6 years agoSupport _Float64, _Float32x in libm_alias_double.
Joseph Myers [Tue, 5 Dec 2017 16:59:34 +0000 (16:59 +0000)]
Support _Float64, _Float32x in libm_alias_double.

This patch makes the libm_alias_double macros support creating
_Float64 and _Float32x aliases, in preparation for enabling glibc
support for those types.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float64 / _Float32x changes.

* sysdeps/generic/libm-alias-double.h: Include <bits/floatn.h>.
(libm_alias_double_other_r_f64): New macro.
(libm_alias_double_other_r_f32x): Likewise.
(libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and
libm_alias_double_other_r_f32x.
(libm_alias_double_r): Use semicolon before call to
libm_alias_double_other_r.
* sysdeps/ieee754/ldbl-opt/libm-alias-double.h: Include
<bits/floatn.h>.
(libm_alias_double_other_r_f64): New macro.
(libm_alias_double_other_r_f32x): Likewise.
(libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and
libm_alias_double_other_r_f32x.

6 years agos_sinf.c: Replace floor with simple casts
H.J. Lu [Tue, 5 Dec 2017 16:32:19 +0000 (08:32 -0800)]
s_sinf.c: Replace floor with simple casts

Since s_sinf.c either assigns the return value of floor to integer or
passes double converted from integer to floor, this patch replaces
floor with simple casts.

Also since long == int for 32-bit targets, we can use long instead of
int to avoid 64-bit integer for 64-bit targets.

On Skylake, bench-sinf reports performance improvement:

           Before        After         Improvement
max        130.566       129.564           30%
min        7.704         7.706             0%
mean       21.8188       19.1363           30%

* sysdeps/ieee754/flt-32/s_sinf.c (reduced): Replace long with
int.
(SINF_FUNC): Likewise.  Replace floor with simple casts.

6 years agotilegx: tag __insn_OP builtin issue with gcc bugzilla #
Chris Metcalf [Tue, 5 Dec 2017 16:36:26 +0000 (11:36 -0500)]
tilegx: tag __insn_OP builtin issue with gcc bugzilla #

6 years agoet_EE locale: Base collation on iso14651_t1 [BZ #22517]
Mike FABIAN [Tue, 5 Dec 2017 14:33:37 +0000 (15:33 +0100)]
et_EE locale: Base collation on iso14651_t1 [BZ #22517]

[BZ #22517]
* localedata/Makefile: Add et_EE.UTF-8 to test-input
and to the list of locales to be built for testing.
* localedata/et_EE.UTF-8.in: New file for testing the collation.
* localedata/locales/et_EE (LC_COLLATE): Use “copy "iso14651_t1"”
        and build the collation rules upon that.

6 years agotilegx: work around vector insn bug in gcc
Chris Metcalf [Tue, 5 Dec 2017 15:24:56 +0000 (10:24 -0500)]
tilegx: work around vector insn bug in gcc

Avoid an issue in gcc where some of the vector (aka SIMD) ops will
sometimes end up getting wrongly optimized out.  We use these
instructions in many of the string implementations.  If/when we
have an upstreamed fix for this problem in gcc we can conditionalize
the use of the extended assembly workaround in glibc.

6 years agoLinux: Implement interfaces for memory protection keys
Florian Weimer [Tue, 5 Dec 2017 14:20:30 +0000 (15:20 +0100)]
Linux: Implement interfaces for memory protection keys

This adds system call wrappers for pkey_alloc, pkey_free, pkey_mprotect,
and x86-64 implementations of pkey_get and pkey_set, which abstract over
the PKRU CPU register and hide the actual number of memory protection
keys supported by the CPU.  pkey_mprotect with a -1 key is implemented
using mprotect, so it will work even if the kernel does not support the
pkey_mprotect system call.

The system call wrapers use unsigned int instead of unsigned long for
parameters, so that no special treatment for x32 is needed.  The flags
argument is currently unused, and the access rights bit mask is limited
to two bits by the current PKRU register layout anyway.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosupport/tst-test_compare: Fix 32-bit/64-bit expected output mismatch
Florian Weimer [Tue, 5 Dec 2017 14:08:59 +0000 (15:08 +0100)]
support/tst-test_compare: Fix 32-bit/64-bit expected output mismatch

The use of a long type resulted in test output differences between
32-bit and 64-bit architectures, causing the test to fail on 32-bit
architectures.

6 years agoUse libm_alias_float for powerpc.
Joseph Myers [Tue, 5 Dec 2017 00:26:26 +0000 (00:26 +0000)]
Use libm_alias_float for powerpc.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes powerpc libm function implementations use
libm_alias_float to define function aliases.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

* sysdeps/powerpc/fpu/s_cosf.c: Include <libm-alias-float.h>.
(cosf): Define using libm_alias_float.
* sysdeps/powerpc/fpu/s_fabs.S: Include <libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/powerpc/fpu/s_fmaf.S: Include <libm-alias-float.h>.
(fmaf): Define using libm_alias_float.
* sysdeps/powerpc/fpu/s_rintf.c: Include <libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/powerpc/fpu/s_sinf.c: Include <libm-alias-float.h>.
(sinf): Define using libm_alias_float.
* sysdeps/powerpc/power5+/fpu/s_modff.c: Include
<libm-alias-float.h>.
(modff): Define using libm_alias_float.
* sysdeps/powerpc/power7/fpu/s_logbf.c: Include
<libm-alias-float.h>.
(logbf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_ceilf.S: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Include
<libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_floorf.S: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Include
<libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Include
<libm-alias-float.h>.
(lroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S: Include
<libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_rintf.S: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Include
<libm-alias-float.h>.
(roundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c:
Include <libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c:
Include <libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c:
Include <libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c:
Include <libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c:
Include <libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c:
Include <libm-alias-float.h>.
(logbf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c:
Include <libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c:
Include <libm-alias-float.h>.
(lroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c:
Include <libm-alias-float.h>.
(modff): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c:
Include <libm-alias-float.h>.
(roundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c:
Include <libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Include
<libm-alias-float.h>.
(lroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S: Include
<libm-alias-float.h>.
(roundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Include
<libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: Include
<libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: Include
<libm-alias-float.h>.
(lroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c: Include
<libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c: Include
<libm-alias-float.h>.
(cosf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c: Include
<libm-alias-float.h>.
(logbf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c: Include
<libm-alias-float.h>.
(modff): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c: Include
<libm-alias-float.h>.
(roundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c: Include
<libm-alias-float.h>.
(sinf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Include
<libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S: Include
<libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Include
<libm-alias-float.h>.
(roundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S: Include
<libm-alias-float.h>.
(roundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Include
<libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S: Include
<libm-alias-float.h>.
(cosf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Include
<libm-alias-float.h>.
(llroundf): Define using libm_alias_float.
* sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S: Include
<libm-alias-float.h>.
(sinf): Define using libm_alias_float.

6 years agosupport: Add TEST_COMPARE macro
Florian Weimer [Mon, 4 Dec 2017 19:54:24 +0000 (20:54 +0100)]
support: Add TEST_COMPARE macro

6 years agotr_TR locale: Base collation on iso14651_t1 [BZ #22527]
Mike FABIAN [Mon, 4 Dec 2017 16:46:28 +0000 (17:46 +0100)]
tr_TR locale: Base collation on iso14651_t1 [BZ #22527]

[BZ #22527]
*  localedata/locales/tr_TR (LC_COLLATE): Base collation rules
on iso14651_t1. A test file localedata/tr_TR.UTF-8.in is already
available, this rewrite of the collation rules does reproduce
the test file in the same order.

6 years agohr_HR locale: Don’t use single code points for the digraphs in LC_TIME
Mike FABIAN [Mon, 4 Dec 2017 12:10:29 +0000 (13:10 +0100)]
hr_HR locale: Don’t use single code points for the digraphs in LC_TIME

[BZ #10580]
* localedata/locales/hr_HR (LC_TIME): Use two letters for the
digraphs in the month and day names. Using single code points for
digraphs is deprecated.  While there are dedicated Unicode
codepoints, for the digraphs, these are included for backwards
compatibility and modern texts use a sequence of Basic Latin
characters. See: https://www.unicode.org/faq/ligature_digraph.html
This makes the month and day names agree exactly with CLDR now,
CLDR does not use the single code points for the digraphs either.

6 years agotile: update ca{cos,sin,tan}{,h} double ULPs
Chris Metcalf [Mon, 4 Dec 2017 17:31:20 +0000 (12:31 -0500)]
tile: update ca{cos,sin,tan}{,h} double ULPs

6 years agoUse __floor not floor in sinf.
Joseph Myers [Mon, 4 Dec 2017 16:58:08 +0000 (16:58 +0000)]
Use __floor not floor in sinf.

The new sinf implementation introduced localplt failures for all
platforms where the compiler did not inline the calls to floor
(converted to trunc by machine-independent optimizations).  This patch
changes the calls to use __floor as normal in libm.

We can't use the public function names floor / floorf / floorl /
floorf128 in libm code in the absence of appropriate asms to redirect
floor/trunc calls, if not inlined, to use the internal names instead
(while avoiding breaking code building the floor functions themselves)
- while having such asms and then calling the public functions
unconditionally would be desirable for optimization (few architectures
have __floor inlines in math_private.h, and once the built-in function
is used you don't need them), using __floor is the minimum safe fix
for the present test regressions.

Tested with build-many-glibcs.py that this fixes the localplt test
failure for arm-linux-gnueabi.

* sysdeps/ieee754/flt-32/s_sinf.c (SINF_FUNC): Use __floor instead
of floor.

6 years agoaarch64: Avoid hidden symbols for memcpy/memmove into static binaries
Siddhesh Poyarekar [Mon, 4 Dec 2017 15:47:17 +0000 (21:17 +0530)]
aarch64: Avoid hidden symbols for memcpy/memmove into static binaries

The __GI_* symbol aliases for __memcpy_generic are unnecessary since
they're never used.  Add them only for libc.so to avoid PLT.  Maybe
some time in future we need to evaluate the relative cost of PLT vs
gains from multiarch memcpy implementations and take a call on whether
to drop this completely.

* sysdeps/aarch64/multiarch/memcpy_generic.S (__GI_memcpy):
Define only for libc.so.

6 years agoS390: Fix backtrace in vdso functions.
Stefan Liebler [Mon, 4 Dec 2017 15:40:13 +0000 (16:40 +0100)]
S390: Fix backtrace in vdso functions.

On s390, GDB fails to show the complete backtrace from within vdso functions.
The macro INTERNAL_VSYSCALL_CALL saves the return address in r14 to r10
before branching to the vdso function. The branch-instruction updates r14
in order to let the vdso function return. Then the original address in r14 is
restored from r10. Unfortunately, there are no cfi-rules and GDB fails.

Furthermore the call of the vdso function does not comply with the s390 ABI
as no stack-frame for the vdso-function is generated.

This patch removes the s390 specific macro INTERNAL_VSYSCALL_CALL
and the common implementation in sysdeps/unix/sysv/linux/sysdep-vdso.h is used.
Then the vdso function is called via function-pointer and GCC generates a
new stack-frame and emits all needed cfi-rules.

The defines CLOBBER_[0-6] are removed as they  were only used in macro
INTERNAL_VSYSCALL_CALL.

The macro INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK is not used on s390.
The only user is power. Thus it is removed from s390 sysdep.h.

ChangeLog:

* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
(INTERNAL_VSYSCALL_CALL, CLOBBER_0, CLOBBER_1, CLOBBER_2,
 CLOBBER_3, CLOBBER_4, CLOBBER_5, CLOBBER_6,
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Remove.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.

6 years agoNew generic sinf
Rajalakshmi Srinivasaraghavan [Mon, 4 Dec 2017 04:42:10 +0000 (10:12 +0530)]
New generic sinf

This implementation is based on optimized sinf assembly versions
of x86_64 and powerpc.

6 years agoHandle __gmon_start__ as undefined weak on hppa.
John David Anglin [Sat, 2 Dec 2017 19:43:28 +0000 (14:43 -0500)]
Handle __gmon_start__ as undefined weak on hppa.

[BZ libc/19170]
* sysdeps/hppa/crti.S: Declare PREINIT_FUNCTION weak_extern when
PREINIT_FUNCTION_WEAK is nonzero.
(gmon_initializer): New function.  Put procedure label for it in
.init_array section.
(_init): Don't call PREINIT_FUNCTION.
* sysdeps/hppa/crtn.S (__gmon_start__): Remove.
* sysdeps/hppa/dl-lookupcfg.h (DL_FIXUP_MAKE_VALUE): Create null fixup
value when map argument is null.

6 years agoImprove PIC pc-relative instruction sequences on hppa.
John David Anglin [Sat, 2 Dec 2017 16:04:16 +0000 (11:04 -0500)]
Improve PIC pc-relative instruction sequences on hppa.

* sysdeps/hppa/dl-fptr.c (elf_machine_resolve): Remove unnecessary
depi instruction from PIC pc-relative sequence.
* sysdeps/hppa/dl-fptr.h (ELF_MACHINE_LOAD_ADDRESS): Likewise.
* sysdeps/hppa/dl-machine.h (elf_machine_dynamic): Likewise.
(elf_machine_load_address): Likewise.
(elf_machine_runtime_setup): Likewise.

6 years agoUse libm_alias_double for remaining powerpc functions.
Joseph Myers [Sat, 2 Dec 2017 00:11:37 +0000 (00:11 +0000)]
Use libm_alias_double for remaining powerpc functions.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes the remaining double powerpc functions use
libm_alias_double to define function aliases (with consequent removal
of the need for local compat symbol handling).  Previous cleanups
avoid this patch changing installed stripped shared libraries for any
build-many-glibcs.py configuration (there are still some functions in
this patch for which the order of double and float aliases changes
within an individual source file, but in this case this doesn't result
in changes to the final library).

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

* sysdeps/powerpc/power7/fpu/s_logb.c: Include
<libm-alias-double.h>.
(logb): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Include
<libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_llrint.c: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_llround.c: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Include
<libm-alias-double.h>.
(lrint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Include
<libm-alias-double.h>.
(lround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c:
Include <libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c:
Include <libm-alias-double.h>.
(llrint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c:
Include <libm-alias-double.h>.
(llround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c: Include
<libm-alias-double.h>.
(logb): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c:
Include <libm-alias-double.h>.
(lrint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c:
Include <libm-alias-double.h>.
(lround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Include
<libm-alias-double.h>.
(lround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Include
<libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: Include
<libm-alias-double.h>.
(lrint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: Include
<libm-alias-double.h>.
(lround): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c: Include
<libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
(lrint): Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
(lround): Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c: Include
<libm-alias-double.h>.
(logb): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Include
<libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
(lrint): Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_llround.S: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
(lround): Likewise.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
(lround): Likewise.
* sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Include
<libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
(lrint): Likewise.
* sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
(lround): Likewise.
* sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
(lrint): Likewise.
* sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Include
<libm-alias-double.h>.
(llround): Define using libm_alias_double.
(lround): Likewise.

6 years agoDefine powerpc64 lroundl compat symbol only once.
Joseph Myers [Fri, 1 Dec 2017 23:58:05 +0000 (23:58 +0000)]
Define powerpc64 lroundl compat symbol only once.

sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c defines the
lroundl compat symbol, version GLIBC_2_1, twice, once based on llround
and once based on __lround.  Those are aliases for each other (llround
weak, __lround strong), but defining it twice does not make sense.
This patch changes it to define the compat symbol once only, matching
how libm_alias_double defines it.

Tested with build-many-glibcs.py for its powerpc64 configurations.

* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
[LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)] (lroundl): Do not define
compat symbol based on llround.

6 years agoBase powerpc logbl compat symbols on __logb not logb.
Joseph Myers [Fri, 1 Dec 2017 23:37:46 +0000 (23:37 +0000)]
Base powerpc logbl compat symbols on __logb not logb.

Some powerpc logb implementations define a compat symbol for logbl
based on logb, whereas libm_alias_double defines such a compat symbol
based on __logb instead.  This difference (logb is weak, __logb isn't)
is enough to result in different installed stripped shared libraries.
The difference in the installed libraries isn't significant, but first
changing the compat_symbol calls helps make it possible to validate a
subsequent change to use libm_alias_double by comparison of libraries,
so this patch does such a preliminary change.

Tested with build-many-glibcs.py for all its hard-float powerpc
configurations.

* sysdeps/powerpc/power7/fpu/s_logb.c
[LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Define as compat
symbol based on __logb, not on logb.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c
[LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
[LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Likewise.

6 years agoUes libm_alias_double for various powerpc functions.
Joseph Myers [Fri, 1 Dec 2017 23:09:47 +0000 (23:09 +0000)]
Ues libm_alias_double for various powerpc functions.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch various powerpc functions use libm_alias_double to
define function aliases (with consequent removal of the need for local
compat symbol handling).  (The present patch excludes the changes to
some functions where such changes could result in differences in
installed stripped shared libraries because of changes to the exact
ordering or properties of symbols in individual .os files.)

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

* sysdeps/powerpc/fpu/s_rint.c: Include <libm-alias-double.h>.
(rint): Define using libm_alias_double.
* sysdeps/powerpc/power5+/fpu/s_modf.c: Include
<libm-alias-double.h>.
(modf): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_ceil.S: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_floor.S: Include
<libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S: Include
<libm-alias-double.h>.
(nearbyint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_rint.S: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_round.S: Include
<libm-alias-double.h>.
(round): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_trunc.S: Include
<libm-alias-double.h>.
(trunc): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c:
Include <libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c: Include
<libm-alias-double.h>.
(modf): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c:
Include <libm-alias-double.h>.
(round): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c:
Include <libm-alias-double.h>.
(trunc): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S: Include
<libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S: Include
<libm-alias-double.h>.
(round): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S: Include
<libm-alias-double.h>.
(trunc): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c: Include
<libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c: Include
<libm-alias-double.h>.
(modf): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c: Include
<libm-alias-double.h>.
(round): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c: Include
<libm-alias-double.h>.
(trunc): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_floor.S: Include
<libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S: Include
<libm-alias-double.h>.
(nearbyint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_rint.S: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_round.S: Include
<libm-alias-double.h>.
(round): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Include
<libm-alias-double.h>.
(trunc): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S: Include
<libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S: Include
<libm-alias-double.h>.
(round): Define using libm_alias_double.
* sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S: Include
<libm-alias-double.h>.
(trunc): Define using libm_alias_double.

6 years agoUse libm_alias_double for powerpc fabs, fma.
Joseph Myers [Fri, 1 Dec 2017 22:23:28 +0000 (22:23 +0000)]
Use libm_alias_double for powerpc fabs, fma.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes powerpc fabs and fma use libm_alias_double
to define function aliases.  This brings in automatic symbol
versioning compat handling, so the powerpc32 and powerpc64 wrappers
that added such handling to the generic sysdeps/powerpc/fpu versions
are removed as no longer required (there are no sysdeps directory
ordering issues that would necessitate keeping trivial wrappers
there).

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

* sysdeps/powerpc/fpu/s_fabs.S: Include <libm-alias-double.h>.
(fabs): Define using libm_alias_double.
* sysdeps/powerpc/fpu/s_fma.S: Include <libm-alias-double.h>.
(fma): Define using libm_alias_double.
* sysdeps/powerpc/powerpc32/fpu/s_fabs.S: Remove file.
* sysdeps/powerpc/powerpc32/fpu/s_fma.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_fabs.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_fma.S: Likewise.

6 years agoUpdate NEWS to add CVE-2017-15804 entry
Aurelien Jarno [Fri, 1 Dec 2017 20:53:51 +0000 (21:53 +0100)]
Update NEWS to add CVE-2017-15804 entry

6 years agopowerpc: Regenerate ULPs
Gabriel F. T. Gomes [Fri, 17 Nov 2017 20:20:42 +0000 (18:20 -0200)]
powerpc: Regenerate ULPs

On POWER9, cbrtf128 fails by 1 ULP.

* sysdeps/powerpc/fpu/libm-test-ulps: Regenerate.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agox32: Remove unused getcpu implementation
Adhemerval Zanella [Sat, 14 Oct 2017 10:55:54 +0000 (07:55 -0300)]
x32: Remove unused getcpu implementation

Checked on x86_64-linux-gnu-x32.

* sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: Remove ununsed ifunc assembly macros
Adhemerval Zanella [Fri, 13 Oct 2017 16:47:36 +0000 (13:47 -0300)]
sparc: Remove ununsed ifunc assembly macros

Now that all SPARC ifunc converted to C implementation there is no need
for both C and assembly macros.  This patch removes the assembly ones.

Checked on sparcv9-linux-gnu and sparc64-linux-gnu.

* sysdeps/sparc/sparc-ifunc.h (SPARC_ASM_IFUNC_DFLT,
SPARC_ASM_IFUNC1, SPARC_ASM_IFUNC2, SET, SPARC_ASM_VIS2_IFUNC,
SPARC_ASM_VIS3_IFUNC, SPARC_ASM_VIS3_VIS2_IFUNC): Remove macros.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: Fix sparv9 multiarch build
Adhemerval Zanella [Fri, 1 Dec 2017 17:43:45 +0000 (15:43 -0200)]
sparc: Fix sparv9 multiarch build

Fix build caused by 5b4e5e78690c4938de312a8b176f4b14eb7bea4a.

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c: Fix build
due redirect macro.

6 years agointl: create target directory for bison
Andreas Schwab [Fri, 1 Dec 2017 13:37:57 +0000 (14:37 +0100)]
intl: create target directory for bison

6 years agosparc: refactor cpu_relax to C
Adhemerval Zanella [Sat, 14 Oct 2017 12:47:08 +0000 (09:47 -0300)]
sparc: refactor cpu_relax to C

* sysdeps/sparc/sparc64/cpu_relax.c: New file.
* sysdeps/sparc/sparc32/sparcv9/cpu_relax.c: Likewise.
* sysdeps/sparc/sparc64/cpu_relax.S: Remove file.
* sysdeps/sparc/sparc32/sparcv9/cpu_relax.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc32 nearbyint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 19:11:33 +0000 (16:11 -0300)]
sparc: refactor sparc32 nearbyint{f} selector to C

This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_nearbyint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_nearbyintf-generic and
s_nearbyint-generic.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S:
New file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S: Remove
file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S:
Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc32 rint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 19:05:24 +0000 (16:05 -0300)]
sparc: refactor sparc32 rint{f} selector to C

This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_rint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_rintf-generic and s_rint-generic.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S: New
file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S: Remove file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc32 llrint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 19:00:36 +0000 (16:00 -0300)]
sparc: refactor sparc32 llrint{f} selector to C

This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_llrint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_llrintf-generic and s_llrint-generic.
* sysdeps/sparc/sparcv9/fpu/multiarch/s_llrint-generic.S: New
file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S: Remove file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc32 fabs{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 18:49:25 +0000 (15:49 -0300)]
sparc: refactor sparc32 fabs{f} selector to C

This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_fabs{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_fabsf-generic and s_fabs-generic.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S: New
file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: Remove file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc32 copysign selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 18:34:33 +0000 (15:34 -0300)]
sparc: refactor sparc32 copysign selector to C

This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_copysign{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
(sysdep_calls): New rule.
(sysdep_routines): Use sysdep_calls as base.
(libm-sysdep_routines): Add generic rule for symbols shared with
libc.  Add s_copysign-generic and s_copysign-generic objects.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S:
New file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S:
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S: Remove file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agois_IS locale: Base collation on iso14651_t1 [BZ #22519]
Mike FABIAN [Fri, 1 Dec 2017 12:45:51 +0000 (13:45 +0100)]
is_IS locale: Base collation on iso14651_t1 [BZ #22519]

6 years agoUse libm_alias_float for e500.
Joseph Myers [Fri, 1 Dec 2017 01:12:42 +0000 (01:12 +0000)]
Use libm_alias_float for e500.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes an e500 libm function implementation use
libm_alias_float to define function aliases.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for its e500 configurations.

* sysdeps/powerpc/powerpc32/e500/nofpu/s_fabsf.S: Include
<libm-alias-float.h>.
(fabsf): Define using libm_alias_float.

6 years agomips: Don't use MIN in dl-machine.h
H.J. Lu [Fri, 1 Dec 2017 00:33:59 +0000 (16:33 -0800)]
mips: Don't use MIN in dl-machine.h

MIN is used, but param.h may not be included, so expand its single use
inline.

* sysdeps/mips/dl-machine.h (elf_machine_reloc): Expand MIN.

6 years agoUse libm_alias_float for coldfire.
Joseph Myers [Thu, 30 Nov 2017 23:52:35 +0000 (23:52 +0000)]
Use libm_alias_float for coldfire.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes coldfire libm function implementations use
libm_alias_float to define function aliases.

Untested, given the currently broken state of GCC for coldfire.

* sysdeps/m68k/coldfire/fpu/s_fabsf.c: Include
<libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/m68k/coldfire/fpu/s_lrintf.c: Include
<libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
* sysdeps/m68k/coldfire/fpu/s_rintf.c: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.

6 years agoUse libm_alias_double for coldfire.
Joseph Myers [Thu, 30 Nov 2017 23:47:18 +0000 (23:47 +0000)]
Use libm_alias_double for coldfire.

Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes coldfire libm function implementations use
libm_alias_double to define function aliases.

Untested, given the currently broken state of GCC for coldfire.

* sysdeps/m68k/coldfire/fpu/s_fabs.c: Include
<libm-alias-double.h>.
(fabs): Define using libm_alias_double.
* sysdeps/m68k/coldfire/fpu/s_lrint.c: Include
<libm-alias-double.h>.
(lrint): Define using libm_alias_double.
* sysdeps/m68k/coldfire/fpu/s_rint.c: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.

6 years agoRework m68k libm functions to use declare_mgen_alias.
Joseph Myers [Thu, 30 Nov 2017 22:39:07 +0000 (22:39 +0000)]
Rework m68k libm functions to use declare_mgen_alias.

Many m68k libm functions use their own system to share code between
different types and functions, involving defining macros before
including code for another function (for example, s_atan.c also acts
as a template that can define other functions).

Thes files serving as templates generate function aliases directly
with e.g. "weak_alias (__CONCATX(__,FUNC), FUNC)" in s_atan.c.  To be
prepared to generate _Float32, _Float64 and _Float32x function
aliases, this needs changing so that the libm_alias_* macros get used
instead.  As the macro to use varies depending on the type, that would
mean additional macros to define in several different places to get
the appropriate alias-generation macro used in each case.

Rather than adding to the m68k-specific mechanisms, this patch
converts the functions in question to use something closer to the
math/ type-generic template mechanism.  After this patch, these
functions have m68k-specific templates such as s_atan_template.c, but
those templates use all the same macros as in the math/ templates,
such as FLOAT, M_DECL_FUNC, M_SUF and declare_mgen_alias.  There is no
automatic generation of the files such as s_atan.c that include the
appropriate math-type-macros-*.h header and the template file (the
existing automatic generation logic is only applicable for the fixed
set of templates listed in math/ - and sysdeps sources always override
files generated that way), so those files are still checked in, but
they are all the obvious two-line files (with one additional
definition in the case of the expm1 implementations), rather than
making e.g. s_atan.c special.

Functions are only converted where they should have aliases for
_FloatN / _FloatNx types.  Those m68k functions that do not generate
public names (those that only generate __ieee754_*, with wrappers
generating the public names, and classification functions that only
exist once per format not once per type so don't get aliases) are
unchanged.  However, log1p (public names generated by wrapper) and
significand (not provided for new types so no new aliases needed)
needed changing because they previously included the atan
implementations.  Now, s_significand.c is the main implementation for
functions with that prototype and using the old implementation
approach, while log1p includes it in place of atan.

Any further cleanups in this area (which preserve the proper set of
functions getting aliases defined by libm_alias_float and
libm_alias_double) are of course welcome, just not needed for the
goals of this patch.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by the patch.

* sysdeps/m68k/m680x0/fpu/s_atan_template.c: New file.
* sysdeps/m68k/m680x0/fpu/s_ceil_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_cos_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_expm1_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_fabs_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_floor_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_frexp_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_lrint_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_modf_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_remquo_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_rint_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_sin_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_sincos_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_tan_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_tanh_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_trunc_template.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_atan.c: Reimplement to use
s_atan_template.c.
* sysdeps/m68k/m680x0/fpu/s_atanf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_atanl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_ceil.c: Reimplement to use
s_ceil_template.c.
* sysdeps/m68k/m680x0/fpu/s_ceilf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_ceill.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_cos.c: Reimplement to use
s_cos_template.c.
* sysdeps/m68k/m680x0/fpu/s_cosf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_cosl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_expm1.c: Reimplement to use
s_expm1_template.c.
* sysdeps/m68k/m680x0/fpu/s_expm1f.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_expm1l.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_fabs.c: Reimplement to use
s_fabs_template.c.
* sysdeps/m68k/m680x0/fpu/s_fabsf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_fabsl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_floor.c: Reimplement to use
s_floor_template.c.
* sysdeps/m68k/m680x0/fpu/s_floorf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_floorl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_frexp.c: Reimplement to use
s_frexp_template.c.
* sysdeps/m68k/m680x0/fpu/s_frexpf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_lrint.c: Reimplement to use
s_lrint_template.c.
* sysdeps/m68k/m680x0/fpu/s_lrintf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_lrintl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_modf.c: Reimplement to use
s_modf_template.c.
* sysdeps/m68k/m680x0/fpu/s_modff.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_modfl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_nearbyint.c: Reimplement to use
s_nearbyint_template.c.
* sysdeps/m68k/m680x0/fpu/s_nearbyintf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_nearbyintl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_remquo.c: Reimplement to use
s_remquo_template.c.
* sysdeps/m68k/m680x0/fpu/s_remquof.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_remquol.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_rint.c: Reimplement to use
s_rint_template.c.
* sysdeps/m68k/m680x0/fpu/s_rintf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_rintl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_sin.c: Reimplement to use
s_sin_template.c.
* sysdeps/m68k/m680x0/fpu/s_sinf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_sinl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_sincos.c: Reimplement to use
s_sincos_template.c.
* sysdeps/m68k/m680x0/fpu/s_sincosf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_sincosl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_tan.c: Reimplement to use
s_tan_template.c.
* sysdeps/m68k/m680x0/fpu/s_tanf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_tanl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_tanh.c: Reimplement to use
s_tanh_template.c.
* sysdeps/m68k/m680x0/fpu/s_tanhf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_tanhl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_trunc.c: Reimplement to use
s_trunc_template.c.
* sysdeps/m68k/m680x0/fpu/s_truncf.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_truncl.c: Likewise.
* sysdeps/m68k/m680x0/fpu/s_significand.c: Reimplement based on
s_atan.c instead of including s_atan.c.
* sysdeps/m68k/m680x0/fpu/s_significandf.c: Reimplement based on
s_atanf.c instead of including s_atanf.c.
* sysdeps/m68k/m680x0/fpu/s_significandl.c: Reimplement based on
s_atanl.c instead of including s_atanl.c.
* sysdeps/m68k/m680x0/fpu/s_log1p.c: Include s_significand.c
instead of s_atan.c.
* sysdeps/m68k/m680x0/fpu/s_log1pf.c: Include s_significandf.c
instead of s_atanf.c.
* sysdeps/m68k/m680x0/fpu/s_log1pl.c: Include s_significandl.c
instead of s_atanl.c.

6 years agoRemove scripts/update-copyrights handling of intl/plural.c.
Joseph Myers [Thu, 30 Nov 2017 21:25:25 +0000 (21:25 +0000)]
Remove scripts/update-copyrights handling of intl/plural.c.

Since this file is no longer checked in, update-copyrights no longer
needs to avoid changing it.

* scripts/update-copyrights: Do not handle intl/plural.c
specially.

6 years agoplural.c: improve reproducibility
Juro Bystricky [Thu, 30 Nov 2017 21:21:15 +0000 (21:21 +0000)]
plural.c: improve reproducibility

There is a subtle non-determinism when building glibc.
This depends on whether the glibc is built using the distibuted
file intl/plural.c or built using the generated file intl/plural.c.
These two files (intl/plural.c generated vs. distributed) are slightly
different, hence we may end up with slightly different libraries.

Originally, having "bison" installed was optional. So if "bison" was
not present, we always built libraries with the distributed plural.c.
If bison was installed, we *** may have *** replaced the distributed
file plural.c with a new plural.c generated from plural.y. if the
timestamps triggered this rule:

plural.c plural.y
$(BISON) $(BISONFLAGS) $@ $^

Given that timestamps are not preserved in GIT repositories, the above
rule is not reliable without explicitly touching plural.c or plural.y.
In other words, the rule may or may not have fired.

In summary: there are two distinct sources of non-determinism:

1. Having "bison" installed or not
2. Having "bison" installed but timestamps poorly defined.

This patch fixes this by requiring "bison" being installed
and by always generating intl/plural.c from intl/plural.y.
(This is achieved by simply removing checked-in intl/plural.c)

[BZ #22432]
* configure.ac (BISON): Require to be present.
* configure: Regenerated.
* intl/Makefile (generated): Add plural.c.
[$(BISON) != no]: Make code unconditional.
(plural.c): Change rule to $(objpfx)plural.c.
($(objpfx)plural.o): Depend on $(objpfx)plural.c.
* intl/plural.c: Remove.
* manual/install.texi (Tools for Compilation): Document bison as
required.
* INSTALL: Regenerated.

6 years agoUse libm_alias macros in m68k llrint functions.
Joseph Myers [Thu, 30 Nov 2017 19:15:21 +0000 (19:15 +0000)]
Use libm_alias macros in m68k llrint functions.

Most m68k libm functions share code via sources for one function
including those for another function or type, in a way that will
require significant changes to create function aliases in a way
friendly to adding _FloatN / _FloatNx aliases.

The llrint function implementations, however, use a conventional
separate implementation for each floating-point type.  Thus preparing
them for _FloatN / _FloatNx aliases is just a matter of changing them
to include the appropriate headers and use the appropriate macros,
which this patch does.  The llrintl changes aren't strictly required,
since m68k long double does not meet the criteria for a _FloatN /
_FloatNx type, but are included anyway to keep consistency between the
implementations for the three types.

Tested with build-many-glibcs.py that installed stripped shared
libraries for m68k-linux-gnu are unchanged by the patch.

* sysdeps/m68k/m680x0/fpu/s_llrint.c: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
* sysdeps/m68k/m680x0/fpu/s_llrintf.c: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/m68k/m680x0/fpu/s_llrintl.c: Include
<libm-alias-ldouble.h>.
(llrintl): Define using libm_alias_ldouble.

6 years agoUse declare_mgen_alias in m68k templates.
Joseph Myers [Thu, 30 Nov 2017 19:03:57 +0000 (19:03 +0000)]
Use declare_mgen_alias in m68k templates.

Some m68k libm functions have their own templates replacing the
generic math/ ones but using the type-generic template machinery.
These currently define function aliases directly using weak_alias.  In
preparation for additional _FloatN / _FloatNx function aliases, this
patch changes them to use declare_mgen_alias for creating aliases
instead.

Tested with build-many-glibcs.py that installed stripped shared
libraries for m68k-linux-gnu are unchanged by the patch.

* sysdeps/m68k/m680x0/fpu/s_ccosh_template.c (ccosh): Use
declare_mgen_alias instead of weak_alias.
* sysdeps/m68k/m680x0/fpu/s_cexp_template.c (cexp): Likewise.
* sysdeps/m68k/m680x0/fpu/s_csin_template.c (csin): Likewise.
* sysdeps/m68k/m680x0/fpu/s_csinh_template.c (csinh): Likewise.

6 years agosparc: refactor sparc64 __mpn_add_n selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 18:01:58 +0000 (15:01 -0300)]
sparc: refactor sparc64 __mpn_add_n selector to C

This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
add_n-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
Add add_n-generic.
* sysdeps/sparc/sparc64/multiarch/add_n-generic.S: New file.
* sysdeps/sparc/sparc64/multiarch/add_n.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/add_n.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc64 __mpn_submul_1 selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:59:09 +0000 (14:59 -0300)]
sparc: refactor sparc64 __mpn_submul_1 selector to C

This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
submul_1-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
Add submul_1-generic.
* sysdeps/sparc/sparc64/multiarch/submul_1-generic.S: New file.
* sysdeps/sparc/sparc64/multiarch/submul_1.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/submul_1.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc64 __mpn_addmul_1 selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:56:29 +0000 (14:56 -0300)]
sparc: refactor sparc64 __mpn_addmul_1 selector to C

This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
addmul_1-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
Add addmul_1-generic.
* sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S: New file.
* sysdeps/sparc/sparc64/multiarch/addmul_1.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/addmul_1.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc64 __mpn_sub_n selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:53:13 +0000 (14:53 -0300)]
sparc: refactor sparc64 __mpn_sub_n selector to C

This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
sub_n-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
Add sub_n-generic.
* sysdeps/sparc/sparc64/multiarch/sub_n-generic.S: New file.
* sysdeps/sparc/sparc64/multiarch/sub_n.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/sub_n.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agosparc: refactor sparc64 __mpn_mul_1 selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:52:51 +0000 (14:52 -0300)]
sparc: refactor sparc64 __mpn_mul_1 selector to C

This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
mul_1-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
Add mul_1-generic.
* sysdeps/sparc/sparc64/multiarch/mul_1-generic.S: New file.
* sysdeps/sparc/sparc64/multiarch/mul_1.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/mul_1.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>