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.
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.
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.
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.
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.
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].
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.
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.
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.
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.
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.
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>
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.
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.
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.
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.
Florian Weimer [Wed, 6 Dec 2017 06:39:25 +0000 (07:39 +0100)]
Add references to CVE-2017-17426
Rajalakshmi Srinivasaraghavan [Wed, 6 Dec 2017 05:19:11 +0000 (10:49 +0530)]
Update NEWS to add sinf optimization
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.
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.
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>
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].
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.
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.
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.
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.
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.
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.
Chris Metcalf [Tue, 5 Dec 2017 16:36:26 +0000 (11:36 -0500)]
tilegx: tag __insn_OP builtin issue with gcc bugzilla #
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.
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.
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>
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.
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.
Florian Weimer [Mon, 4 Dec 2017 19:54:24 +0000 (20:54 +0100)]
support: Add TEST_COMPARE macro
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.
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.
Chris Metcalf [Mon, 4 Dec 2017 17:31:20 +0000 (12:31 -0500)]
tile: update ca{cos,sin,tan}{,h} double ULPs
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Aurelien Jarno [Fri, 1 Dec 2017 20:53:51 +0000 (21:53 +0100)]
Update NEWS to add CVE-2017-15804 entry
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>
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>
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>
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.
Andreas Schwab [Fri, 1 Dec 2017 13:37:57 +0000 (14:37 +0100)]
intl: create target directory for bison
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>
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>
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>
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>
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>
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>
Mike FABIAN [Fri, 1 Dec 2017 12:45:51 +0000 (13:45 +0100)]
is_IS locale: Base collation on iso14651_t1 [BZ #22519]
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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>
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>
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>
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>
Mike FABIAN [Thu, 30 Nov 2017 14:57:25 +0000 (15:57 +0100)]
sr_RS and bs_BA locales: make collation rules the same as for hr_HR [BZ #22534]
According to CLDR, collation rules for Serbian and Bosnian
should be the same as for Croatian.
[BZ #22534]
* localedata/Makefile: Add sr_RS.UTF-8 and bs_BA.UTF-8 to test-input
and to the list of locales to be built for testing.
* localedata/bs_BA.UTF-8.in: New file (same as hr_HR.UTF-8.in).
* localedata/sr_RS.UTF-8.in: New file (same as hr_HR.UTF-8.in).
* localedata/locales/bs_BA (LC_COLLATE): Use “copy "hr_HR"”.
* localedata/locales/sr_RS (LC_COLLATE): Use “copy "hr_HR"”.
Mike FABIAN [Thu, 30 Nov 2017 11:13:02 +0000 (12:13 +0100)]
hr_HR locale: fix collation and expand collation test file
* localedata/locales/hr_HR (LC_COLLATE): Fix collation
to make test case pass.
* localedata/hr_HR.UTF-8.in: Add more test strings.
Mike FABIAN [Thu, 30 Nov 2017 09:50:44 +0000 (10:50 +0100)]
Fix test case for hr_HR monetary formatting
* stdlib/tst-strfmon_l.c: Fix testcase. Needed because of [BZ #10580]
Dragan Stanojević - Nevidljivi [Thu, 30 Nov 2017 09:02:55 +0000 (10:02 +0100)]
Add test case for collation in hr_HR locale
* localedata/Makefile: Add hr_HR.UTF-8 to test-input and to
the list of locales to built for testing.
* localedata/hr_HR.UTF-8.in: New file.
Dragan Stanojević - Nevidljivi [Thu, 30 Nov 2017 08:14:51 +0000 (09:14 +0100)]
hr_HR locale: various updates [BZ #10580]
[BZ #10580]
* localedata/locales/hr_HR (LC_COLLATE): Base collation rules on
iso14651_t1.
* localedata/locales/hr_HR (LC_TIME): Sync month and day names with
CLDR (except use ligatures for the digraphs, CLDR does not use
the ligatures), add first_workday, some fixes in the date and time
formats.
* localedata/locales/hr_HR (LC_CTYPE): Add transliteration rules
for Đ and đ.
* localedata/locales/hr_HR (LC_MONETARY): Change currency_symbol to
lower case. p_cs_precedes and n_cs_precedes should be 0 instead of 1.
Add int_p_cs_precedes and int_n_cs_precedes.
* localedata/locales/hr_HR (LC_NUMERIC): Change thousands_sep to
"<U202F>" (NARROW NO-BREAK SPACE) and grouping to 3;3 (Agrees with
LC_MONETARY now).
* localedata/locales/hr_HR (LC_TELEPHONE): Add tel_dom_fmt.
* localedata/locales/hr_HR (LC_NAME): Add name_mr, name_mrs, and
name_miss.
* localedata/locales/hr_HR (LC_ADDRESS): Add country_post, country_isbn,
and lang_lib. Change postal_fmt.
change
H.J. Lu [Thu, 30 Nov 2017 12:49:25 +0000 (04:49 -0800)]
x86: Make a space in jmpbuf for shadow stack pointer
To support Shadow Stack (SHSTK) in Intel Control-flow Enforcement
Technology (CET) in setjmp/longjmp, we need to save shadow stack
pointer in jmp_buf. The __saved_mask field in jmp_buf has type
of __sigset_t. On Linux, __sigset_t is defined as
#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
typedef struct
{
unsigned long int __val[_SIGSET_NWORDS];
} __sigset_t;
which is much bigger than expected by the __sigprocmask system call,
which has
typedef struct {
unsigned long sig[_NSIG_WORDS];
} sigset_t;
For Linux/x86, we can shrink __sigset_t used by __saved_mask in jmp_buf
to add paddings for shadow stack pointer. As long as the new __sigset_t
is not smaller than sigset_t expected by the __sigprocmask system call,
it should work correctly.
This patch adds an internal header file, <setjmpP.h>, to define
__jmp_buf_sigset_t for __saved_mask in jmp_buf for Linux/x86 with a
space to store shadow stack pointer. It verifies __jmp_buf_sigset_t has
the suitable size for the __sigprocmask system call. A run-time test,
tst-saved_mask-1.c, is added to verify that size of __jmp_buf_sigset_t
is sufficient. If its size is too small, the test fails with
rt_sigprocmask(SIG_SETMASK, strace: umoven: short read (4 < 8) @0x7fa8aa28effc
0x7fa8aa28effc, NULL, 8) = -1 EFAULT (Bad address)
rt_sigprocmask(SIG_SETMASK, strace: umoven: short read (4 < 8) @0x7fa8aa28effc
0x7fa8aa28effc, NULL, 8) = -1 EFAULT (Bad address)
rt_sigprocmask(SIG_SETMASK, NULL, 0x7fa8aa28effc, 8) = -1 EFAULT (Bad address)
exit_group(1) = ?
Tested with build-many-glibcs.py.
* debug/longjmp_chk.c: Include <setjmpP.h> instead of
<setjmp.h>.
* setjmp/longjmp.c: Include <setjmpP.h> instead of <setjmp.h>.
(__libc_siglongjmp): Cast &env[0].__saved_mask to "sigset_t *".
* setjmp/sigjmp.c: Include <setjmpP.h> instead of <setjmp.h>.
(__sigjmp_save): Cast &env[0].__saved_mask to "sigset_t *".
* sysdeps/generic/setjmpP.h: New file.
* sysdeps/unix/sysv/linux/x86/jmp_buf-ssp.sym: Likewise.
* sysdeps/unix/sysv/linux/x86/setjmpP.h: Likewise.
* sysdeps/unix/sysv/linux/x86/tst-saved_mask-1.c: Likewise.
* sysdeps/unix/sysv/linux/x86/Makefile (gen-as-const-headers):
Add jmp_buf-ssp.sym.
(tests): Add tst-saved_mask-1.
Arjun Shankar [Thu, 30 Nov 2017 12:31:45 +0000 (13:31 +0100)]
Fix integer overflow in malloc when tcache is enabled [BZ #22375]
When the per-thread cache is enabled, __libc_malloc uses request2size (which
does not perform an overflow check) to calculate the chunk size from the
requested allocation size. This leads to an integer overflow causing malloc
to incorrectly return the last successfully allocated block when called with
a very large size argument (close to SIZE_MAX).
This commit uses checked_request2size instead, removing the overflow.
Joseph Myers [Thu, 30 Nov 2017 00:43:28 +0000 (00:43 +0000)]
Remove SPARC lllrint aliases.
The sparc32/sparcv9/fpu/multiarch implementations of llrint / llrintf
have aliases lllrint / lllrintf. No such function is exported from or
used in libm and these aliases should not be there; I expect they
arose accidentally in the course of converting a 64-bit implementation
(where lrint and llrint can be aliases) to a 32-bit llrint
implementation. This patch removes those spurious aliases.
Tested (compilation only) with build-many-glibcs.py for
sparcv9-linux-gnu.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
(__lllrint): Remove alias.
(lllrint): Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
(__lllrintf): Likewise.
(lllrintf): Likewise.
Joseph Myers [Thu, 30 Nov 2017 00:30:40 +0000 (00:30 +0000)]
Use libm_alias_float for sparc.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes sparc libm function implementations use
libm_alias_float to define function aliases.
Tested with build-many-glibcs.py for all its sparc configurations that
installed stripped shared libraries are unchanged by the patch.
* sysdeps/sparc/sparc32/fpu/s_copysignf.S: Include
<libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/fpu/s_fabsf.S: Include
<libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S:
Include <libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S: Include
<libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c: Include
<libm-alias-float.h>.
(fdimf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c: Include
<libm-alias-float.h>.
(fmaf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S:
Include <libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S: Include
<libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S: Include
<libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S: Include
<libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c: Include
<libm-alias-float.h>.
(fmaf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c: Include
<libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
(llrintf): Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c: Include
<libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/s_copysignf.S: Include
<libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/s_fabsf.c: Include
<libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/s_lrintf.S: Include
<libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
(llrintf): Likewise.
* sysdeps/sparc/sparc64/fpu/s_nearbyintf.S: Include
<libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/sparc/sparc64/fpu/s_rintf.S: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
Joseph Myers [Wed, 29 Nov 2017 23:40:07 +0000 (23:40 +0000)]
Use libm_alias_double for sparc.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes sparc libm function implementations use
libm_alias_double to define function aliases (with consequent
simplification where compat symbol handling is now done by those
macros rather than locally in architecture-specific code).
Tested with build-many-glibcs.py for all its sparc configurations that
installed stripped shared libraries are unchanged by the patch.
* sysdeps/sparc/sparc32/fpu/s_copysign.S: Include
<libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/sparc/sparc32/fpu/s_fabs.S: Include
<libm-alias-double.h>.
(fabs): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S:
Include <libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: Include
<libm-alias-double.h>.
(fabs): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c: Include
<libm-alias-double.h>.
(fdim): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c: Include
<libm-alias-double.h>.
(fma): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S:
Include <libm-alias-double.h>.
(nearbyint): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S: Include
<libm-alias-double.h>.
(fabs): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S: Include
<libm-alias-double.h>.
(llrint): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S: Include
<libm-alias-double.h>.
(nearbyint): Define using libm_alias_double.
* sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Include
<libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c: Include
<libm-alias-double.h>.
(fma): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c: Include
<libm-alias-double.h>.
(lrint): Define using libm_alias_double.
(llrint): Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c: Include
<libm-alias-double.h>.
(nearbyint): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Include
<libm-alias-double.h>.
(trunc): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/s_copysign.S: Include
<libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/s_fabs.c: Include
<libm-alias-double.h>.
(fabs): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/s_lrint.S: Include
<libm-alias-double.h>.
(lrint): Define using libm_alias_double.
(llrint): Likewise.
* sysdeps/sparc/sparc64/fpu/s_nearbyint.S: Include
<libm-alias-double.h>.
(nearbyint): Define using libm_alias_double.
* sysdeps/sparc/sparc64/fpu/s_rint.S: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.
Joseph Myers [Wed, 29 Nov 2017 23:09:03 +0000 (23:09 +0000)]
Fix missing sparcv9 --disable-multi-arch fabsl compat symbol (bug 22229).
The --disable-multi-arch case of sparcv9 libm is missing a fabsl
compat symbol for when long double had the same ABI as double. This
patch adds the missing compat symbol to this implementation. As my
fix for other instances of this missing compat symbol postdates the
last release, I'm considering this as being part of bug 22229 that was
missing from my previous fix rather than as a separate issue, and so
as not needing a new bug report in Bugzilla.
Tested (compilation only) with build-many-glibcs.py for
sparcv9-linux-gnu --disable-multi-arch.
[BZ #22229]
* sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S: Include
<math_ldbl_opt.h>.
(fabsl): Define as compat symbol at version GLIBC_2_0 for libm.
Joseph Myers [Wed, 29 Nov 2017 22:51:46 +0000 (22:51 +0000)]
Add SPARC --disable-multi-arch builds to build-many-glibcs.py.
While working on SPARC changes to use libm_alias_* I noticed that the
non-multi-arch sparc32/sparcv9/fpu/s_fabs.S was missing compat symbol
support for fabsl. This clearly shows inadequate test coverage, so
this patch adds SPARC --disable-multi-arch builds to
build-many-glibcs.py (the 32-bit one fails testing until that bug is
fixed, the 64-bit one passes testing).
* scripts/build-many-glibcs.py (Context.add_all_configs): Add
SPARC --disable-multi-arch glibc variants.
Joseph Myers [Wed, 29 Nov 2017 21:25:41 +0000 (21:25 +0000)]
Use libm_alias_float for x86_64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes x86_64 libm function implementations use
libm_alias_float to define function aliases, or libm_alias_float_other
where the main name is defined with versioned_symbol.
Tested with the glibc testsuite for x86_64, and tested with
build-many-glibcs.py for all its x86_64 configurations that installed
stripped shared libraries are unchanged by the patch.
* sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_expf.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_log2f.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_logf.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_powf.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/s_ceilf.c: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_floorf.c: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Include
<libm-alias-float.h>.
(fmaf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c: Include
<libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_rintf.c: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_truncf.c: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_copysignf.S: Include <libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_cosf.S: Include <libm-alias-float.h>.
(cosf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_fabsf.c: Include <libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_fmaxf.S: Include <libm-alias-float.h>.
(fmaxf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_fminf.S: Include <libm-alias-float.h>.
(fminf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_llrintf.S: Include <libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
[!__ILP32__] (lrintf): Likewise.
* sysdeps/x86_64/fpu/s_sincosf.S: Include <libm-alias-float.h>.
(sincosf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_sinf.S: Include <libm-alias-float.h>.
(sinf): Define using libm_alias_float.
* sysdeps/x86_64/x32/fpu/s_lrintf.S: Include <libm-alias-float.h>.
(lrintf): Define using libm_alias_float.
Joseph Myers [Wed, 29 Nov 2017 19:01:21 +0000 (19:01 +0000)]
Use libm_alias_double for x86_64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes x86_64 libm function implementations use
libm_alias_double to define function aliases.
Tested with the glibc testsuite for x86_64, and tested with
build-many-glibcs.py for all its x86_64 configurations that installed
stripped shared libraries are unchanged by the patch.
* sysdeps/x86_64/fpu/multiarch/s_atan.c: Include
<libm-alias-double.h>.
(atan): Define using libm_alias_double.
* sysdeps/x86_64/fpu/multiarch/s_ceil.c: Include
<libm-alias-double.h>.
(ceil): Define using libm_alias_double.
* sysdeps/x86_64/fpu/multiarch/s_floor.c: Include
<libm-alias-double.h>.
(floor): Define using libm_alias_double.
* sysdeps/x86_64/fpu/multiarch/s_fma.c: Include
<libm-alias-double.h>.
(fma): Define using libm_alias_double.
* sysdeps/x86_64/fpu/multiarch/s_nearbyint.c: Include
<libm-alias-double.h>.
(nearbyint): Define using libm_alias_double.
* sysdeps/x86_64/fpu/multiarch/s_rint.c: Include
<libm-alias-double.h>.
(rint): Define using libm_alias_double.
* sysdeps/x86_64/fpu/multiarch/s_sin.c: Include
<libm-alias-double.h>.
(sin): Define using libm_alias_double.
(cos): Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan.c: Include
<libm-alias-double.h>.
(tan): Define using libm_alias_double.
* sysdeps/x86_64/fpu/multiarch/s_trunc.c: Include
<libm-alias-double.h>.
(trunc): Define using libm_alias_double.
* sysdeps/x86_64/fpu/s_copysign.S: Include <libm-alias-double.h>.
(copysign): Define using libm_alias_double.
* sysdeps/x86_64/fpu/s_fabs.c: Include <libm-alias-double.h>.
(fabs): Define using libm_alias_double.
* sysdeps/x86_64/fpu/s_fmax.S: Include <libm-alias-double.h>.
(fmax): Define using libm_alias_double.
* sysdeps/x86_64/fpu/s_fmin.S: Include <libm-alias-double.h>.
(fmin): Define using libm_alias_double.
* sysdeps/x86_64/fpu/s_llrint.S: Include <libm-alias-double.h>.
(llrint): Define using libm_alias_double.
[!__ILP32__] (lrint): Likewise.
* sysdeps/x86_64/x32/fpu/s_lrint.S: Include <libm-alias-double.h>.
(lrint): Define using libm_alias_double.
Adhemerval Zanella [Fri, 13 Oct 2017 16:42:07 +0000 (13:42 -0300)]
sparc: refactor sparc64 rint{f} 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
s_rint{f}-generic.S).
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_rintf-generic and s_rint-generic
objects.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S: Remove file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Adhemerval Zanella [Fri, 13 Oct 2017 16:20:00 +0000 (13:20 -0300)]
sparc: refactor sparc64 lrint{f} 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
s_lrint{f}-generic.S).
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_lrint-generic and s_lrint-generic
objects.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S: Remove file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Adhemerval Zanella [Fri, 13 Oct 2017 15:00:28 +0000 (12:00 -0300)]
sparc: refactor sparc64 nearbyint{f} 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
s_nearbyint{f}-generic.S).
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_nearbyint-generic and
s_nearbyintf-generic objects.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S: Remove file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Adhemerval Zanella [Fri, 13 Oct 2017 14:48:57 +0000 (11:48 -0300)]
sparc: refactor sparc64 finite{f} 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
s_finite{f}-generic.S).
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls):
Add s_finitef-generic and s_finite-generic objects.
* sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S: Remove file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S: Remove file.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Adhemerval Zanella [Fri, 13 Oct 2017 14:39:43 +0000 (11:39 -0300)]
sparc: refactor sparc64 isinf{f} 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
s_isinf{f}-generic.S).
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls):
Add isinff-generic and s_isinf-generic objects.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S: Remove file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Adhemerval Zanella [Fri, 13 Oct 2017 14:28:55 +0000 (11:28 -0300)]
sparc: refactor sparc64 isnan{f} 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
(s_isnan{f}-generic.S).
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls):
Add s_isnanf-generic and s_isnan-generic objects.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S: Remove file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Adhemerval Zanella [Fri, 13 Oct 2017 12:56:49 +0000 (09:56 -0300)]
sparc: refactor sparc64 signbit{f} 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
(s_signbit{f}-generic.S).
It also simplifies the multiarch Makefile by moving the common objects
from libm-sysdeps_routines and sysdeps_routines to a new sysdeps_call
rule and including it where required with the correct prefix.
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* sysdeps/sparc/sparc-ifunc.h (sparc_libm_ifunc_redirected): New
macro.
* sysdeps/sparc/sparc64/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_signbit-generic and s_signbitf-generic objects.
* sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S: Remove file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Joseph Myers [Wed, 29 Nov 2017 17:38:35 +0000 (17:38 +0000)]
Use libm_alias_float for ia64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes ia64 libm function implementations use
libm_alias_float to define function aliases. The same approach is
followed as with the corresponding long double and double patches: the
ia64-specific macros are left unchanged, with calls to
libm_alias_float_other being added in most cases and libm_alias_float
itself being used in only a few places.
Tested with build-many-glibcs.py for ia64-linux-gnu that installed
stripped shared libraries are unchanged by the patch.
* sysdeps/ia64/fpu/libm-symbols.h: Include <libm-alias-float.h>.
* sysdeps/ia64/fpu/e_acosf.S (acosf): Use libm_alias_float_other.
* sysdeps/ia64/fpu/e_acoshf.S (acoshf): Likewise.
* sysdeps/ia64/fpu/e_asinf.S (asinf): Likewise.
* sysdeps/ia64/fpu/e_atan2f.S (atan2f): Likewise.
* sysdeps/ia64/fpu/e_atanhf.S (atanhf): Likewise.
* sysdeps/ia64/fpu/e_coshf.S (coshf): Likewise.
* sysdeps/ia64/fpu/e_exp10f.S (exp10f): Likewise.
* sysdeps/ia64/fpu/e_exp2f.S (exp2f): Likewise.
* sysdeps/ia64/fpu/e_expf.S (expf): Likewise.
* sysdeps/ia64/fpu/e_fmodf.S (fmodf): Likewise.
* sysdeps/ia64/fpu/e_hypotf.S (hypotf): Likewise.
* sysdeps/ia64/fpu/e_lgammaf_r.c (lgammaf_r): Define using
libm_alias_float_r.
* sysdeps/ia64/fpu/e_log2f.S (log2f): Use libm_alias_float_other.
* sysdeps/ia64/fpu/e_logf.S (log10f): Likewise.
(logf): Likewise.
* sysdeps/ia64/fpu/e_powf.S (powf): Likewise.
* sysdeps/ia64/fpu/e_remainderf.S (remainderf): Likewise.
* sysdeps/ia64/fpu/e_sinhf.S (sinhf): Likewise.
* sysdeps/ia64/fpu/e_sqrtf.S (sqrtf): Likewise.
* sysdeps/ia64/fpu/libm_sincosf.S (sincosf): Likewise.
* sysdeps/ia64/fpu/s_asinhf.S (asinhf): Likewise.
* sysdeps/ia64/fpu/s_atanf.S (atanf): Likewise.
* sysdeps/ia64/fpu/s_cbrtf.S (cbrtf): Likewise.
* sysdeps/ia64/fpu/s_ceilf.S (ceilf): Likewise.
* sysdeps/ia64/fpu/s_copysign.S (copysignf): Define using
libm_alias_float.
* sysdeps/ia64/fpu/s_cosf.S (sinf): Use libm_alias_float_other.
(cosf): Likewise.
* sysdeps/ia64/fpu/s_erfcf.S (erfcf): Likewise.
* sysdeps/ia64/fpu/s_erff.S (erff): Likewise.
* sysdeps/ia64/fpu/s_expm1f.S (expm1f): Likewise.
* sysdeps/ia64/fpu/s_fabsf.S (fabsf): Likewise.
* sysdeps/ia64/fpu/s_fdimf.S (fdimf): Likewise.
* sysdeps/ia64/fpu/s_floorf.S (floorf): Likewise.
* sysdeps/ia64/fpu/s_fmaf.S (fmaf): Likewise.
* sysdeps/ia64/fpu/s_fmaxf.S (fmaxf): Likewise.
* sysdeps/ia64/fpu/s_frexpf.c (frexpf): Likewise.
* sysdeps/ia64/fpu/s_ldexpf.c (ldexpf): Likewise.
* sysdeps/ia64/fpu/s_log1pf.S (log1pf): Likewise.
* sysdeps/ia64/fpu/s_logbf.S (logbf): Likewise.
* sysdeps/ia64/fpu/s_modff.S (modff): Likewise.
* sysdeps/ia64/fpu/s_nearbyintf.S (nearbyintf): Likewise.
* sysdeps/ia64/fpu/s_nextafterf.S (nextafterf): Likewise.
* sysdeps/ia64/fpu/s_rintf.S (rintf): Likewise.
* sysdeps/ia64/fpu/s_roundf.S (roundf): Likewise.
* sysdeps/ia64/fpu/s_scalblnf.c (scalblnf): Likewise.
* sysdeps/ia64/fpu/s_scalbnf.c (scalbnf): Define using
libm_alias_float.
* sysdeps/ia64/fpu/s_tanf.S (tanf): Use libm_alias_float_other.
* sysdeps/ia64/fpu/s_tanhf.S (tanhf): Likewise.
* sysdeps/ia64/fpu/s_truncf.S (truncf): Likewise.
* sysdeps/ia64/fpu/w_lgammaf_main.c
[BUILD_LGAMMA && !USE_AS_COMPAT] (lgammaf): Likewise.
* sysdeps/ia64/fpu/w_tgammaf_compat.S (tgammaf): Likewise.
Alexandre Oliva [Tue, 28 Nov 2017 15:23:02 +0000 (16:23 +0100)]
Collation fix: make forward accent sorting the default [BZ #17750]
[BZ #17750]
* Makefile: add fr_CA.UTF-8 to test-input and LOCALES.
* localedata/fr_CA.UTF-8.in: New file with test data for backward
accents sorting.
* localedata/fr_FR.UTF-8.in: Fix test data for forward accents
sorting.
* localedata/locales/cs_CZ (LC_COLLATE): Remove “define DIACRIT_FORWARD”
* localedata/locales/de_DE (LC_COLLATE): Likewise.
* localedata/locales/hu_HU (LC_COLLATE): Likewise.
* localedata/locales/lb_LU (LC_COLLATE): Likewise.
* localedata/locales/yuw_PG (LC_COLLATE): Likewise.
* localedata/locales/fr_CA (LC_COLLATE): Add “define DIACRIT_BACKWARD”
* localedata/locales/iso14651_t1_common: Use “ifdef DIACRIT_FORWARD”
instead of “ifdef DIACRIT_BACKWARD”.
The only locale which currently needs backward accents sorting is fr_CA.
Therefore, forward accents sorting should be the default.
Before this patch, backwards accent sorting was the default and all
locales except fr_CA had to use
define DIACRIT_FORWARD
before
copy "iso14651_t1"
Most locales didn’t do that and thus got the inappropriate backwards accents sorting
by accident. Now only the fr_CA locale needs to use
define DIACRIT_BACKWARD
before
copy "iso14651_t1"
Original patch slightly modified by: Mike FABIAN <mfabian@redhat.com>
Adhemerval Zanella [Thu, 12 Oct 2017 22:43:50 +0000 (19:43 -0300)]
sparc: Assume VIS3 support
This patch assumes VIS3 support by binutils, which is supported since
version 2.22. This leads to some code simplification, mostly on
multiarch build where there is only one variant instead of previously
two (whether binutils supports VIS3 instructions or not).
For multiarch files where HAVE_AS_VIS3_SUPPORT was checked and
the default implementation was built with a different name, a new
file with (implementation with -generic appended) is added.
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
* config.h.in (HAVE_AS_VIS3_SUPPORT): Remove check for VIS3 support.
* sysdeps/sparc/configure.ac (HAVE_AS_VIS3_SUPPORT): Likewise.
* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c: Likewise.
* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c: Likewise.
* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c: Likewise.
* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Likewise.
* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Likewise.
* sysdeps/sparc/sparc-ifunc.h [!HAVE_AS_VIS3_SUPPORT]
(SPARC_ASM_VIS3_IFUNC, SPARC_ASM_VIS3_VIS2_IFUNC): Remove macros.
* sysdeps/sparc/sparc32/sparcv9/Makefile [$(have-as-vis3) != yes]
(ASFLAGS.o, ASFLAGS-.os, ASFLAGS-.op, ASFLAGS-.oS): Remove rules.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
($(have-as-vis3) == yes): Remove conditional.
* sysdeps/sparc/sparc64/Makefile (($(have-as-vis3) == yes)):
Likewise.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c: New
file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c: New
file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c: New
file.
* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c: New
file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c: New file.
* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c: New file.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>