diff options
author | DJ Delorie <dj@delorie.com> | 2016-08-11 18:42:42 -0400 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2016-08-11 18:42:42 -0400 |
commit | 528795b01909b0c41ec3049fa115a107c8898a20 (patch) | |
tree | eb3df1ef5e0f8d502618ba6192c50837339cb50a | |
parent | 4a6779937b839669f2ee8bb085d715125aa882c7 (diff) | |
parent | ab70f211651f50622d7f8afe3f6a68c472b1fb5a (diff) | |
download | glibc-528795b01909b0c41ec3049fa115a107c8898a20.zip glibc-528795b01909b0c41ec3049fa115a107c8898a20.tar.gz glibc-528795b01909b0c41ec3049fa115a107c8898a20.tar.bz2 |
Merge branch 'master' into dj/malloc
352 files changed, 8069 insertions, 4098 deletions
@@ -1,3 +1,1048 @@ +2016-08-10 Joseph Myers <joseph@codesourcery.com> + + [BZ #20455] + * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Mask out + all FE_INVALID sub-exceptions from FPSCR when FE_INVALID specified + to be restored. + + * math/test-fexcept-traps.c: New file. + * math/test-fexcept.c: Likewise. + * math/Makefile (tests): Add test-fexcept and test-fexcept-traps. + * sysdeps/generic/math-tests.h (EXCEPTION_SET_FORCES_TRAP): New + macro. + * sysdeps/powerpc/math-tests.h [!__NO_FPRS__] + (EXCEPTION_SET_FORCES_TRAP): Likewise. + +2016-08-09 Torvald Riegel <triegel@redhat.com> + + * include/atomic.h (atomic_fetch_and_relaxed, + atomic_fetch_and_release, atomic_fetch_or_release, + atomic_fetch_xor_release): New. + +2016-08-06 Christian Seiler <christian@iwakd.de> + + [BZ #20444] + * sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Cope with aport being + MACH_PORT_NULL. + +2016-08-05 Aurelien Jarno <aurelien@aurel32.net> + + * math/s_fdim.c: Avoid alias renamed. + * math/s_fdimf.c: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile + [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines): + Add s_fdimf-vis3, s_fdim-vis3. + (CFLAGS-s_fdimf-vis3.c): New. Set to -Wa,-Av9d -mvis3. + (CFLAGS-s_fdim-vis3.c): Likewise. + sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c: New file. + sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c: Likewise. + +2016-08-05 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile + [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines): + Remove s_fdimf-vis3, s_fdim-vis3. + * sysdeps/sparc/sparc32/fpu/s_fdim.S: Delete file. + * sysdeps/sparc/sparc32/fpu/s_fdimf.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_fdim.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_fdimf.S: Likewise. + +2016-08-05 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/sparc/sparc32/sparcv9/Makefile (sysdep-CFLAGS): Add -mvis. + * sysdeps/sparc/sparc64/Makefile (sysdep-CFLAGS): New. Define to + -Wa,-Av9a -mvis. + +2016-08-05 Paul E. Murphy <murphyp@linux.vnet.ibm.com> + + * math/gen-libm-test.pl (apply_lit): Rewrite to apply + LIT() to individual constants in simple expressions + after splitting on spaces. + (_apply_lit): Rename replaced version, and use it to + apply to what appears to be a token. + + * math/libm-test.inc: Fix many, many issues with + spacing. + +2016-08-05 Joseph Myers <joseph@codesourcery.com> + + * math/math.h: Move comment about <bits/mathdef.h> definitions + above inclusion of <bits/mathdef.h>. Do not mention + FLT_EVAL_METHOD, INFINITY or DECIMAL_DIG in that comment. + +2016-08-05 Torvald Riegel <triegel@redhat.com> + + * include/atomic.h (atomic_exchange_relaxed): New. + +2016-08-04 Joseph Myers <joseph@codesourcery.com> + + * math/e_scalb.c: Do not include <fenv.h>. + (invalid_fn): Do calculation resulting in NaN instead of raising + FE_INVALID and returning a NaN explicitly. + * math/e_scalbf.c: Do not include <fenv.h>. + (invalid_fn): Do calculation resulting in NaN instead of raising + FE_INVALID and returning a NaN explicitly. + * math/e_scalbl.c: Do not include <fenv.h>. + (invalid_fn): Do calculation resulting in NaN instead of raising + FE_INVALID and returning a NaN explicitly. + +2016-08-04 Carlos O'Donell <carlos@redhat.com> + + * po/de.po: Updated from Translation Project. + * po/fi.po: Likewise. + * po/sv.po: Likewise. + +2016-08-04 Florian Weimer <fweimer@redhat.com> + + [BZ #20452] + Use sysdep.o from libc.a in static libraries. + * sysdeps/unix/sysv/linux/i386/Makefile + (libpthread-shared-only-routines): Add sysdep. + (librt-shared-only-routines): Likewise. + +2016-08-03 Joseph Myers <joseph@codesourcery.com> + + * math/tgmath.h (nextdown): Define if + [__GLIBC_USE (IEC_60559_BFP_EXT)], not if [__USE_GNU]. + (nextup): Likewise. + + * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_FUNCS_EXT): New + macro. + * include/features.h (__STDC_WANT_IEC_60559_FUNCS_EXT__): + Document. + * manual/creature.texi (__STDC_WANT_IEC_60559_FUNCS_EXT__): + Document macro. + * manual/math.texi (exp10): Document as ISO from TS 18661-4:2015. + (exp10f): Likewise. + (exp10l): Likewise. + * math/bits/mathcalls.h (exp10): Declare if + [__GLIBC_USE (IEC_60559_FUNCS_EXT)], not [__USE_GNU]. + + * manual/arith.texi (nextup): Fix typo in last change. + +2016-08-03 Zack Weinberg <zackw@panix.com> + + [BZ #19239] + * NEWS: Inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated. + * misc/sys/sysmacros.h: If __SYSMACROS_DEPRECATED_INCLUSION is defined, + define major, minor, and makedev to issue deprecation warnings on use. + If __SYSMACROS_DEPRECATED_INCLUSION is *not* defined, suppress + previously-activated deprecation warnings for these macros and prevent + subsequent inclusions of this header from having any effect. + * posix/sys/types.h: Define __SYSMACROS_DEPRECATED_INCLUSION before + including <sys/sysmacros.h>, and undefine it again afterward. + +2016-08-03 Zack Weinberg <zackw@panix.com> + + * sysdeps/generic/sys/sysmacros.h: Delete file. + * sysdeps/unix/sysv/linux/makedev.c: Delete file. + * sysdeps/unix/sysv/linux/sys/sysmacros.h: Move file ... + * bits/sysmacros.h: ... here; this encoding is now the generic + encoding. Now defines only the following macros: + __SYSMACROS_DECLARE_MAJOR, __SYSMACROS_DEFINE_MAJOR, + __SYSMACROS_DECLARE_MINOR, __SYSMACROS_DEFINE_MINOR, + __SYSMACROS_DECLARE_MAKEDEV, __SYSMACROS_DEFINE_MAKEDEV. + + * misc/sys/sysmacros.h, misc/makedev.c: New files that use + bits/sysmacros.h and the above new macros to generate the + public implementations of major, minor, and makedev. + * misc/tst-makedev.c: New test. + * include/sys/sysmacros.h: New wrapper. + + * misc/Makefile (headers): Add sys/sysmacros.h, bits/sysmacros.h. + (routines): Add makedev. + (tests): Add tst-makedev. + * misc/Versions [GLIBC_2.25]: Add gnu_dev_major, gnu_dev_minor, + gnu_dev_makedev. + * posix/Makefile (headers): Remove sys/sysmacros.h. + * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove makedev. + + * sysdeps/arm/nacl/libc.abilist: Add GLIBC_2.25, + gnu_dev_major, gnu_dev_makedev, gnu_dev_minor. + * sysdeps/unix/sysv/linux/aarch64/libc.abilist + * sysdeps/unix/sysv/linux/alpha/libc.abilist + * sysdeps/unix/sysv/linux/arm/libc.abilist + * sysdeps/unix/sysv/linux/hppa/libc.abilist + * sysdeps/unix/sysv/linux/i386/libc.abilist + * sysdeps/unix/sysv/linux/ia64/libc.abilist + * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist + * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist + * sysdeps/unix/sysv/linux/microblaze/libc.abilist + * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist + * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist + * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist + * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist + * sysdeps/unix/sysv/linux/nios2/libc.abilist + * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist + * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist + * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist + * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist + * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist + * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist + * sysdeps/unix/sysv/linux/sh/libc.abilist + * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist + * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist + * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist + * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist + * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist + * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist + * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: + Add GLIBC_2.25. + + * include/features.h (__glibc_clang_prereq): New macro. + * misc/sys/cdefs.h (__glibc_clang_has_extension) + (__attribute_deprecated_msg__): New macros. + +2016-08-03 Joseph Myers <joseph@codesourcery.com> + + * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_BFP_EXT): New + macro. + * include/features.h (__STDC_WANT_IEC_60559_BFP_EXT__): Document. + * manual/arith.texi (issignaling): Document as ISO from TS + 18661-1:2014. + (nextup): Likewise. + (nextupf): Likewise. + (nextupl): Likewise. + (nextdown): Likewise. + (nextdownf): Likewise. + (nextdownl): Likewise. + * manual/creature.texi (__STDC_WANT_IEC_60559_BFP_EXT__): Document + macro. + * math/math.h: Define + __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include + <bits/libc-header-start.h> instead of including <features.h>. + (issignaling): Define if [__GLIBC_USE (IEC_60559_BFP_EXT)], not + [__USE_GNU]. + * math/bits/mathcalls.h (nextdown): Declare if + [__GLIBC_USE (IEC_60559_BFP_EXT)], not [__USE_GNU]. + (nextup): Likewise. + (__issignaling): Likewise. + +2016-08-03 Paul E. Murphy <murphyp@linux.vnet.ibm.com> + + * s_ccoshf.c (__ccoshf): Remove FE_INVALID + check, and remove __glibc_likely hint + from FP_INFINITE check. + * s_csinhf.c (__csinhf): Likewise. + + * s_ccoshl.c (__ccoshl): Remove __glibc_likely + hint from FP_INFINITE check. + * s_csinhl.c (__csinhl): Likewise. + +2016-08-03 Paul E. Murphy <murphyp@linux.vnet.ibm.com> + + * math/Makefile (libm-calls): Insert F placeholder into + object names. Move w_lgamma_compat* routines into + (libm-compat-calls): New variable. + (libm-compat-calls-ldouble-yes): New variable. + (calls): Insert F placeholder. + (generated): Redefine using new type-foreach macro call. + (routines): Likewise. + + (types): New variable to hold a list of symbolic names + for each type supported by the target machine. + (libm-routines): Redefine using new types variable. + (type-foreach): macro to replace fooF with the + appropriately suffixed foo for each types. + + (type-ldouble-suffix): New variable. + (type-ldouble-routines): Likewise. + (type-ldouble-yes): Likewise. + (type-double-suffix): Likewise. + (type-double-routines): Likewise. + (type-float-suffix): Likewise. + (type-float-routines): Likewise. + + (dbl-only-routines): Remove. + (long-c-yes): Likewise. + (long-m-routines): Likewise. + (long-m-support): Likewise. + (long-m-yes): Likewise. + (test-longdouble-yes): Likewise. + + (test-float.o): Simplify by increasing the scope of the + recipe which adds libm-test.stmp to the vector types. + (test-ifloat.o): Likewise. + (test-float-finite.o): Likewise. + (test-double.o): Likewise + (test-idouble.o): Likewise. + (test-double-finite.o): Likewise. + (test-ldouble.o): Likewise + (test-ildoubl.o): Likewise. + (test-ldouble-finite.o): Likewise. + + (libm-tests): Redefine type tests using foreach and the + list of types in types. + + (CPPFLAGS-test-ildoubl.c): Rename to + (CPPFLAGS-test-ildouble.c): New variable + + * math/test-ildoubl.c: Rename to + * math/test-ildouble.c: New file. + +2016-08-03 Paul E. Murphy <murphyp@linux.vnet.ibm.com> + + * sysdeps/ieee754/ldbl-128/k_tanl.c (__kernal_tanl): + Use fabsl instead of fabs. + * sysdeps/ieee754/ldbl-128/s_logbl.c (__logbl): + Likewise. + * sysdeps/ieee754/ldbl-128/s_atanl.c (__kernel_tanl): + Add long double suffix to constant to ensure proper + promotion to long double. + +2016-08-03 Tom Tromey <tom@tromey.com> + + [BZ #20311] + * nptl_db/Makefile (headers): Add proc_service.h. + * nptl_db/proc_service.h: Add include guard. Use + __BEGIN/__END_DECLS. + (ps_get_thread_area, ps_pstop, ps_pcontinue, ps_lstop) + (ps_lcontinue): Remove "const" from "struct ps_prochandle *" + arguments. + + +2016-08-03 Florian Weimer <fweimer@redhat.com> + + [BZ #17730] + Avoid using memalign for TCB allocations. + * elf/dl-tls.c (tcb_to_pointer_to_free_location): New. + (_dl_allocate_tls_storage): Use malloc and manual alignment. + Avoid alignment gap in the TLS_DTV_AT_TP case. + (_dl_deallocate_tls): Use tcb_to_pointer_to_free_location to + determine the pointer to free. + * nptl/tst-tls3-malloc.c: New test. + * nptl/Makefile (tests): Add it. + (tst-tls3-malloc): Link with libdl, libpthread. + (LDFLAGS-tst-tls3-malloc): Set. + (tst-tls3-malloc.out): Depend on DSO used in test. + +2016-08-03 Florian Weimer <fweimer@redhat.com> + + [BZ #17730] + Avoid using memalign for TLS allocations. + * sysdeps/generic/dl-dtv.h (struct dtv_pointer): New. Replaces + is_static member with to_free member. + (union dtv): Use struct dtv_pointer. + * csu/libc-tls.c (__libc_setup_tls): Set to_free member of struct + dtv_pointer instead of is_static. + * elf/dl-tls.c (_dl_allocate_tls_init): Likewise. + (_dl_deallocate_tls): Free to_free member of struct dtv_pointer + instead of val. + (allocate_dtv_entry): New function. + (allocate_and_init): Return struct dtv_pointer. Call + allocate_dtv_entry instead of __libc_memalign. + (_dl_update_slotinfo): Free to_free member of struct dtv_pointer + instead of val. + (tls_get_addr_tail): Set to_free member of struct dtv_pointer + instead of is_static. Adjust call to allocate_and_init. + * nptl/allocatestack.c (get_cached_stack): Free to_free member of + struct dtv_pointer instead of val. + +2016-08-03 Florian Weimer <fweimer@redhat.com> + + * malloc/malloc.c (INTERNAL_SIZE_T, SIZE_SZ, MALLOC_ALIGNMENT) + (MALLOC_ALIGN_MASK): Move ... + * malloc/malloc-internal.h: ... to here. + * elf/dl-minimal.c (malloc): Allocate with MALLOC_ALIGNMENT. + +2016-08-03 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/gnu/netinet/udp.h (UDP_ENCAP_GTP0): New macro. + (UDP_ENCAP_GTP1U): Likewise. + + * sysdeps/unix/sysv/linux/bits/socket.h (PF_QIPCRTR): New macro. + (PF_MAX): Update value. + (AF_QIPCRTR): New macro. + +2016-08-03 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/ieee754/dbl-64/s_trunc.c: Avoid alias renamed. + * sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c: Likewise. + * sysdeps/ieee754/flt-32/s_truncf.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/Makefile + [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines): + Add s_ceilf-vis3, s_ceil-vis3, s_floorf-vis3, s_floor-vis3, + s_truncf-vis3, s_trunc-vis3. + (CFLAGS-s_ceilf-vis3.c): New. Set to -Wa,-Av9d -mvis3. + (CFLAGS-s_ceil-vis3.c): Likewise. + (CFLAGS-s_floorf-vis3.c): Likewise. + (CFLAGS-s_floor-vis3.c): Likewise. + (CFLAGS-s_truncf-vis3.c): Likewise. + (CFLAGS-s_trunc-vis3.c): Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c: New file. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Likewise. + +2016-08-02 David S. Miller <davem@davemloft.net> + + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S + (__nearbyint_vis3): Don't check for sNaN before float register is + loaded with the incoming argument. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S + (__nearbyintf_vis3): Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S (__nearbyint): + Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S (__nearbyintf): + Likewise. + + * string/test-strncmp.c (do_test_limit): Make sure the test data + stream is aligned as required for the type "CHAR". + (do_test): Likewise. + +2016-08-03 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Replace beqlr instructions + by beq instructions jumping to the end of the function. + * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Add "11", "12", "cr0" to the + clobber list. Use "i" constraint instead of "X". + (ifunc_one): Add "12" to the clobber list. Use "i" constraint instead + of "X". + +2016-08-02 Joseph Myers <joseph@codesourcery.com> + + * bits/libc-header-start.h: New file. + * Makefile (headers): Add bits/libc-header-start.h. + * include/features.h (__STDC_WANT_LIB_EXT2__): Document. + (__GLIBC_USE): New macro. + * libio/stdio.h: Define + __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include + <bits/libc-header-start.h> instead of including <features.h>. + (fmemopen): Declare also if [__GLIBC_USE (LIB_EXT2)]. + (open_memstream): Likewise. + (vasprintf): Declare if [__GLIBC_USE (LIB_EXT2)], not [__USE_GNU]. + (__asprintf): Likewise. + (asprintf): Likewise. + (__getdelim): Declare also if [__GLIBC_USE (LIB_EXT2)]. + (getdelim): Likewise. + (getline): Likewise. + * string/string.h: Define + __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include + <bits/libc-header-start.h> instead of including <features.h>. + (strdup): Declare also if [__GLIBC_USE (LIB_EXT2)] + (strndup): Likewise. + * wcsmbs/wchar.h: Define + __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include + <bits/libc-header-start.h> instead of including <features.h>. + (open_wmemstream): Declare also if [__GLIBC_USE (LIB_EXT2)]. + * manual/creature.texi (__STDC_WANT_LIB_EXT2__): Document macro. + +2016-08-02 Florian Weimer <fweimer@redhat.com> + + Support linking against compatibility symbols, for use in tests. + * include/libc-symbols.h (symbol_version_reference): New macro. + (symbol_version): Use it. + * include/shlib-compat.h: Unconditionally include <abi-versions.h>. + (compat_symbol): Use compat_symbol_reference. + (compat_symbol_1, compat_symbol_2): Remove. + (compat_symbol_reference, compat_symbol_reference_1) + (compat_symbol_reference_2): New macro. Use + symbol_version_reference. + +2016-08-02 Florian Weimer <fweimer@redhat.com> + + [BZ #19469] + * malloc/Makefile (CPPFLAGS): Compile tests with + -DTEST_NO_MALLOPT. + * test-skeleton.c (main): Only call mallopt if !TEST_NO_MALLOPT. + +2016-08-02 Andrew Senkevich <andrew.senkevich@intel.com> + + [BZ #20033] + * sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S: Call + finite version. + * sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/svml_d_exp2_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_d_log2_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_d_pow2_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_s_expf4_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_s_logf4_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_s_powf4_core.S: Likewise. + * math/libm-test.inc (pow_test_data): Exclude tests for qNaN + in zero power. + +2016-08-02 Florian Weimer <fweimer@redhat.com> + + [BZ #20370] + * malloc/arena.c (get_free_list): Update comment. Assert that + arenas on the free list have no attached threads. + (remove_from_free_list): New function. + (reused_arena): Call it. + +2016-08-02 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/alpha/fpu/s_ceil.c (__ceil): Add argument with itself + when it is a NaN. + [_IEEE_FP_INEXACT] Remove. + * sysdeps/alpha/fpu/s_ceilf.c (__ceilf): Likewise. + * sysdeps/alpha/fpu/s_floor.c (__floor): Add argument with itself + when it is a NaN. + [_IEEE_FP_INEXACT] Remove. + * sysdeps/alpha/fpu/s_floorf.c (__floorf): Likewise. + * sysdeps/alpha/fpu/s_rint.c (__rint): Add argument with itself + when it is a NaN. + * sysdeps/alpha/fpu/s_rintf.c (__rintf): Likewise. + * sysdeps/alpha/fpu/s_trunc.c (__trunc): Return the input value + when its absolute value is greater than 0x1.0p52. + [_IEEE_FP_INEXACT] Remove. + * sysdeps/alpha/fpu/s_truncf.c (__truncf): Return the input value + when its absolute value is greater than 0x1.0p23. + [_IEEE_FP_INEXACT] Remove. + +2016-08-01 Carlos O'Donell <carlos@redhat.com> + + * version.h (RELEASE): Set to "development" + (VERSION): Set to 2.24.90. + * NEWS: Add 2.25 section. + + * version.h (RELEASE): Set to "stable" + (VERSION): Set to 2.24. + * include/features.h (__GLIBC_MINOR__): Set to 24. + + * NEWS: Add 2.24 fixed bugs. + * po/libc.pot: Regenerate. + +2016-08-01 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile + [$(subdir) = math] (libm-sysdep_routines): Remove. + [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines): + Remove s_ceilf-vis3, s_ceil-vis3, s_floorf-vis3, s_floor-vis3, + s_truncf-vis3, s_trunc-vis3. + * sysdeps/sparc/sparc64/fpu/multiarch/Makefile: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S: Delete + file. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S: Likewise. + * sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S: Likewise. + * sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_ceil.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_ceilf.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_floor.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_floorf.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_trunc.S: Likewise. + * sysdeps/sparc/sparc64/fpu/s_truncf.S: Likewise. + +2016-07-27 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20384] + * sysdeps/x86_64/fpu/Makefile (extra-test-objs): Add + test-double-libmvec-sincos-avx-main.o, + test-double-libmvec-sincos-avx2-main.o, + test-double-libmvec-sincos-main.o, + test-float-libmvec-sincosf-avx-main.o, + test-float-libmvec-sincosf-avx2-main.o and + test-float-libmvec-sincosf-main.o. + test-float-libmvec-sincosf-avx512-main.o. + ($(objpfx)test-double-libmvec-sincos): Also link with + $(objpfx)test-double-libmvec-sincos-main.o. + ($(objpfx)test-double-libmvec-sincos-avx): Also link with + $(objpfx)test-double-libmvec-sincos-avx-main.o. + ($(objpfx)test-double-libmvec-sincos-avx2): Also link with + $(objpfx)test-double-libmvec-sincos-avx2-main.o. + ($(objpfx)test-float-libmvec-sincosf): Also link with + $(objpfx)test-float-libmvec-sincosf-main.o. + ($(objpfx)test-float-libmvec-sincosf-avx): Also link with + $(objpfx)test-float-libmvec-sincosf-avx2-main.o. + [$(config-cflags-avx512) == yes] (extra-test-objs): Add + test-double-libmvec-sincos-avx512-main.o and + ($(objpfx)test-double-libmvec-sincos-avx512): Also link with + $(objpfx)test-double-libmvec-sincos-avx512-main.o. + ($(objpfx)test-float-libmvec-sincosf-avx512): Also link with + $(objpfx)test-float-libmvec-sincosf-avx512-main.o. + (CFLAGS-test-double-libmvec-sincos.c): Removed. + (CFLAGS-test-float-libmvec-sincosf.c): Likewise. + (CFLAGS-test-double-libmvec-sincos-main.c): New. + (CFLAGS-test-double-libmvec-sincos-avx-main.c): Likewise. + (CFLAGS-test-double-libmvec-sincos-avx2-main.c): Likewise. + (CFLAGS-test-float-libmvec-sincosf-main.c): Likewise. + (CFLAGS-test-float-libmvec-sincosf-avx-main.c): Likewise. + (CFLAGS-test-float-libmvec-sincosf-avx2-main.c): Likewise. + (CFLAGS-test-float-libmvec-sincosf-avx512-main.c): Likewise. + (CFLAGS-test-double-libmvec-sincos-avx.c): Set to -DREQUIRE_AVX. + (CFLAGS-test-float-libmvec-sincosf-avx.c ): Likewise. + (CFLAGS-test-double-libmvec-sincos-avx2.c): Set to + -DREQUIRE_AVX2. + (CFLAGS-test-float-libmvec-sincosf-avx2.c ): Likewise. + (CFLAGS-test-double-libmvec-sincos-avx512.c): Set to + -DREQUIRE_AVX512F. + (CFLAGS-test-float-libmvec-sincosf-avx512.c): Likewise. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos.c: Rewritten. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c: Likewise. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c: New + file. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c: + Likewise. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c: + Likewise. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c: + Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c: + Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c: + Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c: + Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c: + Likewise. + +2016-07-27 Chung-Lin Tang <cltang@codesourcery.com> + + * sysdeps/unix/sysv/linux/nios2/localplt.data (__eqsf2): Remove. + +2016-07-21 Gustavo Romero <gromero@linux.vnet.ibm.com> + + * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Fix missing verb + and typo in a comment about AT_HWCAP entry. + +2016-07-21 Szabolcs Nagy <szabolcs.nagy@arm.com> + + * sysdeps/aarch64/libm-test-ulps: Updated. + +2016-07-20 Stefan Liebler <stli@linux.vnet.ibm.com> + + * sysdeps/s390/s390-32/memcpy.S (memcpy): Eliminate the usage + of r13 as it is not restored in mvcle case. + +2016-07-19 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/unix/sysv/linux/microblaze/sysdep.h (inline_syscall0): + Rename "ret" to "__ret". + (inline_syscall1, inline_syscall2, inline_syscall3, inline_syscall4, + inline_syscall5, inline_syscall6): Likewise. + +2016-07-19 Will Newton <will.newton@gmail.com> + + * elf/elf.h (R_METAG_REL8, R_METAG_REL16, R_METAG_TLS_GD + R_METAG_TLS_LDM, R_METAG_TLS_LDO_HI16, R_METAG_TLS_LDO_LO16, + R_METAG_TLS_LDO, R_METAG_TLS_IE, R_METAG_TLS_IENONPIC, + R_METAG_TLS_IENONPIC_HI16, R_METAG_TLS_IENONPIC_LO16, + R_METAG_TLS_LE, R_METAG_TLS_LE_HI16, R_METAG_TLS_LE_LO16): New. + +2016-07-18 H.J. Lu <hongjiu.lu@intel.com> + + * sysdeps/i386/Makefile (rtld-CFLAGS): New. + [subdir == elf] (CFLAGS-.os): Replace -mno-sse -mno-mmx + -mfpmath=387 with $(rtld-CFLAGS). + [subdir != elf] (CFLAGS-.os): Compile rtld-*.os with + $(rtld-CFLAGS). + +2016-07-18 Ross Burton <ross.burton@intel.com> + Khem Raj <raj.khem@gmail.com> + + * elf/elf.h (R_METAG_HIADDR16, R_METAG_LOADDR16, + R_METAG_ADDR32, R_METAG_NONE, R_METAG_RELBRANCH, + R_METAG_GETSETOFF, R_METAG_REG32OP1, R_METAG_REG32OP2, + R_METAG_REG32OP3, R_METAG_REG16OP1, R_METAG_REG16OP2, + R_METAG_REG16OP3, R_METAG_REG32OP4, R_METAG_HIOG, + R_METAG_LOOG, R_METAG_GNU_VTINHERIT, R_METAG_GNU_VTENTRY, + R_METAG_HI16_GOTOFF, R_METAG_LO16_GOTOFF, + R_METAG_GETSET_GOTOFF, R_METAG_GETSET_GOT, R_METAG_HI16_GOTPC, + R_METAG_LO16_GOTPC, R_METAG_HI16_PLT, R_METAG_LO16_PLT, + R_METAG_RELBRANCH_PLT, R_METAG_GOTOFF, R_METAG_PLT, + R_METAG_COPY, R_METAG_JMP_SLOT, R_METAG_RELATIVE, + R_METAG_GLOB_DAT, R_METAG_TLS_TPOFF, R_METAG_TLS_DTPMOD, + R_METAG_TLS_DTPOFF): New. + +2016-07-18 Siddhesh Poyarekar <siddhesh@sourceware.org> + Matt Clay <mclay@lycos.com> + + [BZ #20357] + * sysdeps/ieee754/dbl-64/s_sin.c (sloww): Fix up condition + to call __mpsin/__mpcos and to negate values. + * math/auto-libm-test-in: Add test. + * math/auto-libm-test-out: Regenerate. + +2016-07-18 Zack Weinberg <zackw@panix.com> + + * grp/Makefile: Don't install the internal header grp-merge.h. + +2016-07-18 Szabolcs Nagy <szabolcs.nagy@arm.com> + + * sysdeps/aarch64/libm-test-ulps: Regenerated. + +2016-07-13 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * bits/termios.h (TABDLY): Change macro to include TAB3 bit too. + +2016-07-13 Adhemerval Zanella <adhemerval.zanella@linaro.org> + + [BZ #15368] + * sysdeps/unix/sysv/linux/nptl-signals.h + (__nptl_clear_internal_signals): New function. + (__libc_signal_block_all): Likewise. + (__libc_signal_block_app): Likewise. + (__libc_signal_restore_set): Likewise. + * sysdeps/unix/sysv/linux/pt-raise.c (raise): Use Linux raise.c + implementation. + * sysdeps/unix/sysv/linux/raise.c (raise): Reimplement to not use + the cached pid/tid value in pthread structure. + +2016-07-13 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20347] + * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated. + +2016-07-12 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20348] + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add pread64, + preadv64, pwrite64 and pwritev64. + +2016-07-12 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20350] + * posix/tst-preadwrite.c: Renamed to ... + * posix/tst-preadwrite-common.c: This. + (PREAD): Removed. + (PWRITE): Likewise. + (STRINGIFY): Likewise. + (STRINGIFY2): Likewise. + (do_prepare): Make it static and remove function arguments. + (do_test): Likewise. + (PREPARE): Updated. + (TEST_FUNCTION): New. + (name): Make it static. + (fd): Likewise. + (do_prepare): Use create_temp_file. + (do_test): Renamed to ... + (do_test_with_offset): This. Make it static and accept offset. + Properly check return value of PWRITE and PREAD. Return bytes + read. Don't close fd nor unlink name. + * posix/tst-preadwrite.c: Rewrite. + * posix/tst-preadwrite64.c: Likewise. + +2016-07-12 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20309] + * configure.ac (have-mtls-dialect-gnu2): Set to yes if + -mtls-dialect=gnu2 works. + * configure: Regenerated. + * elf/Makefile [have-mtls-dialect-gnu2 = yes] + (tests): Add tst-gnu2-tls1. + (modules-names): Add tst-gnu2-tls1mod. + ($(objpfx)tst-gnu2-tls1): New. + (tst-gnu2-tls1mod.so-no-z-defs): Likewise. + (CFLAGS-tst-gnu2-tls1mod.c): Likewise. + * elf/tst-gnu2-tls1.c: New file. + * elf/tst-gnu2-tls1mod.c: Likewise. + * sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add 8 + bytes for push in the PLT entry to align the stack. + +2016-07-11 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20349] + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (LO_HI_LONG): New. + +2016-07-11 Szabolcs Nagy <szabolcs.nagy@arm.com> + + [BZ #18707] + * sysdeps/aarch64/Makefile (CFLAGS-mcount.c): Add -mgeneral-regs-only. + * sysdeps/aarch64/sysdep.h (CALL_MCOUNT): Save argument registers. + +2016-07-08 Adhemerval Zanella <adhemerval.zanella@linaro.org> + + * sysdeps/unix/sysv/linux/sysdep.h + [__WORDSIZE == 64 || __ASSUME_WORDSIZE64_ILP32] (LO_HI_LONG): Remove + guards. + * misc/tst-preadvwritev-common.c: New file. + * misc/tst-preadvwritev.c: Use tst-preadvwritev-common.c. + * misc/tst-preadvwritev64.c: Use tst-preadwritev-common.c and add + a check for files larger than 2GB. + + * sysdeps/unix/sysv/linux/mips/kernel-features.h + (__ASSUME_OFF_DIFF_OFF64): Remove define. + * sysdeps/unix/sysv/linux/pread.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread): Replace by + __OFF_T_MATCHES_OFF64_T. + * sysdeps/unix/sysv/linux/pread64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pread64): Likewise. + * sysdeps/unix/sysv/linux/preadv.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv): Likewise. + * sysdeps/unix/sysv/linux/preadv64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (preadv64): Likewise. + * sysdeps/unix/sysv/linux/pwrite.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite): Likewise. + * sysdeps/unix/sysv/linux/pwrite64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwrite64): Likewise. + * sysdeps/unix/sysv/linux/pwritev.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev): Likewise. + * sysdeps/unix/sysv/linux/pwritev64.c + [__WORDSIZE != 64 || __ASSUME_OFF_DIFF_OFF64] (pwritev64): Likewise. + +2016-07-08 Chris Metcalf <cmetcalf@mellanox.com> + + * sysdeps/unix/sysv/linux/tile/kernel-features.h + (__ASSUME_ALIGNED_REGISTER_PAIRS): Only define if !_LP64. + +2016-07-08 Aurelien Jarno <aurelien@aurel32.net> + + * bits/in.h (__USE_KERNEL_IPV6_DEFS): Define to 0. + +2016-07-08 Aurelien Jarno <aurelien@aurel32.net> + + [BZ #20240] + * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile + (CFLAGS-s_modf-ppc32.c): New variable. + (CFLAGS-s_modff-ppc32.c): Likewise. + * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile + (CFLAGS-s_modf-ppc64.c): Likewise. + (CFLAGS-s_modff-ppc64.c): Likewise. + +2016-07-07 Andreas Schwab <schwab@suse.de> + + [BZ #20263] + * nptl/tst-robust10.c: New test. + * nptl/Makefile (tests): Add tst-robust10. + +2016-07-07 Jiyoung Yun <t2wish@gmail.com> + + [BZ #20263] + * nptl/lowlevelrobustlock.c: Implement ETIMEDOUT logic. + +2016-07-06 Stefan Liebler <stli@linux.vnet.ibm.com> + + * sysdeps/s390/linkmap.h (struct link_map_machine): + Remove member gotplt and add member jmprel. + * sysdeps/s390/s390-32/dl-machine.h + (elf_machine_runtime_setup): Setup member jmprel with DT_JMPREL + instead of gotplt with &got[3]. + (elf_machine_lazy_rel): Calculate address with reloc and jmprel. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + +2016-07-06 John David Anglin <danglin@gcc.gnu.org> + + * sysdeps/hppa/fpu/libm-test-ulps: Regenerate. + +2016-07-06 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * libio/iofopncook.c (_IO_cookie_read, _IO_cookie_write, + _IO_cookie_seek, _IO_cookie_close, _IO_old_cookie_seek) + [!PTR_DEMANGLE]: Do not call PTR_DEMANGLE. + (set_callbacks) [!PTR_MANGLE]: Do not call PTR_MANGLE. + * libio/vtables.c (_IO_vtable_check) + [!PTR_DEMANGLE]: Do not call PTR_DEMANGLE. + * libio/libioP.h (IO_set_accept_foreign_vtables) + [!PTR_MANGLE]: Do not call PTR_MANGLE. + +2016-07-05 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20314] + * Makeconfig (CXXFLAGS): Prepend -I$(common-objpfx). + * Makerules (before-compile): Add $(common-objpfx)cstdlib and + $(common-objpfx)cmath. + ($(common-objpfx)cstdlib): New target. + ($(common-objpfx)cmath): Likewise. + +2016-07-05 Chris Metcalf <cmetcalf@mellanox.com> + + * malloc/tst-malloc-thread-fail.c (TIMEOUT): Bump up to 30s. + +2016-07-05 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> + + [BZ #20327] + * sysdeps/powerpc/powerpc64/power8/strcasecmp.S: Mask bits that + are not part of the string. + +2016-07-05 Adhemerval Zanella <adhemerval.zanella@linaro.org> + + * nptl/tst-cancel4-common.c (do_test): Add temporary fifo creation. + * nptl/tst-cancel4-common.h (fifoname): New variable. + (fifofd): Likewise. + (cl_fifo): New function. + * nptl/tst-cancel4.c (tf_sigpause): Replace SIGCANCEL usage by + SIGINT. + (tf_open): Add early cancel test. + +2016-07-04 Andreas Schwab <schwab@linux-m68k.org> + + * sysdeps/m68k/Makefile (CFLAGS-mcount.c): Define. + +2016-07-01 Maciej W. Rozycki <macro@imgtec.com> + + * sysdeps/generic/ldsodefs.h + (dl_symbol_visibility_binds_local_p): New inline function. + * elf/dl-addr.c (determine_info): Treat hidden and internal + symbols as local. + * elf/dl-lookup.c (do_lookup_x): Likewise. + * elf/dl-reloc.c (RESOLVE_MAP): Likewise. + +2016-07-01 Aurelien Jarno <aurelien@aurel32.net> + + * sparc/sparc32/sparcv9/fpu/s_nearbyint.S (__nearbyint): Trigger an + invalid exception for a sNaN input. + * sparc/sparc32/sparcv9/fpu/s_nearbyintf.S (__nearbyintf): Likewise. + * sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S + (__nearbyint_vis3): Likewise + * sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S + (__nearbyintf_vis3): Likewise + * sparc/sparc64/fpu/s_nearbyint.S (__nearbyint): Likewise. + * sparc/sparc64/fpu/s_nearbyintf.S (__nearbyintf): Likewise. + * sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S (__nearbyint_vis3): + Likewise. + * sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S (__nearbyintf_vis3): + Likewise. + +2016-07-01 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #20139] + * config.h.in (HAVE_AVX512_ASM_SUPPORT): Renamed to ... + (HAVE_AVX512DQ_ASM_SUPPORT): This. + * sysdeps/x86_64/configure.ac: Require assembler from binutils + 2.24 or above. + (HAVE_AVX512_ASM_SUPPORT): Removed. + (HAVE_AVX512DQ_ASM_SUPPORT): New. + * sysdeps/x86_64/configure: Regenerated. + * sysdeps/x86_64/dl-trampoline.S: Make HAVE_AVX512_ASM_SUPPORT + check unconditional. + * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Likewise. + * sysdeps/x86_64/multiarch/memcpy.S: Likewise. + * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise. + * sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S: + Likewise. + * sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S: + Likewise. + * sysdeps/x86_64/multiarch/memmove.S: Likewise. + * sysdeps/x86_64/multiarch/memmove_chk.S: Likewise. + * sysdeps/x86_64/multiarch/mempcpy.S: Likewise. + * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise. + * sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S: + Likewise. + * sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S: + Likewise. + * sysdeps/x86_64/multiarch/memset.S: Likewise. + * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S: Check + HAVE_AVX512DQ_ASM_SUPPORT instead of HAVE_AVX512_ASM_SUPPORT. + * sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx51: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S: + Likewise. + +2016-07-01 Andrew Senkevich <andrew.senkevich@intel.com> + + [BZ #20024] + * sysdeps/x86/fpu/test-math-vector-sincos.h: New. + * sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S: Fixed ABI + of this implementation of vector function. + * sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S: + Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S: Likewise. + * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S: Likewise. + * sysdeps/x86_64/fpu/svml_d_sincos2_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_d_sincos4_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S: Likewise. + * sysdeps/x86_64/fpu/svml_d_sincos8_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_s_sincosf16_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_s_sincosf4_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_s_sincosf8_core.S: Likewise. + * sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S: Likewise. + * sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c: Use another wrapper + for testing vector sincos with fixed ABI. + * sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c: Likewise. + * sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c: Likewise. + * sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c: Likewise. + * sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c: Likewise. + * sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c: Likewise. + * sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c: Likewise. + * sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c: Likewise. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c: New test. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c: Likewise. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c: Likewise. + * sysdeps/x86_64/fpu/test-double-libmvec-sincos.c: Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c: Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c: Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c: Likewise. + * sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c: Likewise. + * sysdeps/x86_64/fpu/Makefile: Added new tests. + +2016-06-30 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data: Add _Qp_cmp. + 2016-06-30 Anton Blanchard <anton@samba.org> * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile diff --git a/ChangeLog.11 b/ChangeLog.11 index d9b0364..356da03 100644 --- a/ChangeLog.11 +++ b/ChangeLog.11 @@ -1017,7 +1017,7 @@ * elf/dl-error.c (_dl_signal_error): Allocate memory for objname as well. Reported by Alexander V. Lukyanov <lav@yars.free.net>. - * iconvdata/gconv-modules: Add aliases for Winblowz charsets. + * iconvdata/gconv-modules: Add aliases for Windows charsets. Patch by Joseph S. Myers <jsm28@cam.ac.uk>. 2000-10-13 Andreas Schwab <schwab@suse.de> diff --git a/ChangeLog.8 b/ChangeLog.8 index 5c3be9f..52b85a6 100644 --- a/ChangeLog.8 +++ b/ChangeLog.8 @@ -525,7 +525,7 @@ 1998-07-29 12:58 Ulrich Drepper <drepper@cygnus.com> - * sysdeps/generic/glob.c: Winblowz compatibility stuff. + * sysdeps/generic/glob.c: Windows compatibility stuff. Patch received from Paul D. Smith <psmith@BayNetworks.COM>. 1998-07-29 Andreas Jaeger <aj@arthur.rhein-neckar.de> @@ -889,7 +889,8 @@ override CFLAGS = -std=gnu11 -fgnu89-inline $(config-extra-cflags) \ $(CFLAGS-$(@F)) $(tls-model) \ $(foreach lib,$(libof-$(basename $(@F))) \ $(libof-$(<F)) $(libof-$(@F)),$(CFLAGS-$(lib))) -override CXXFLAGS = $(c++-sysincludes) \ +# Use our copies of cstdlib and cmath. +override CXXFLAGS = -I$(common-objpfx) $(c++-sysincludes) \ $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \ $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F)) @@ -60,7 +60,8 @@ endif # $(AUTOCONF) = no $(addprefix install-, no-libc.a bin lib data headers others) headers := limits.h values.h features.h gnu-versions.h \ - bits/xopen_lim.h gnu/libc-version.h stdc-predef.h + bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \ + bits/libc-header-start.h echo-headers: subdir_echo-headers @@ -109,6 +109,30 @@ endif # avoid-generated endif # $(build-shared) = yes ifndef avoid-generated +ifneq (,$(CXX)) +# If C++ headers <cstdlib> or <cmath> are used, GCC 6 will include +# /usr/include/stdlib.h or /usr/include/math.h from "#include_next" +# (instead of stdlib/stdlib.h or math/math.h in the glibc source +# directory), and this turns up as a make dependency. An implicit +# rule will kick in and make will try to install stdlib/stdlib.h or +# math/math.h as /usr/include/stdlib.h or /usr/include/math.h because +# the target is out of date. We make a copy of <cstdlib> and <cmath> +# in the glibc build directory so that stdlib/stdlib.h and math/math.h +# will be used instead of /usr/include/stdlib.h and /usr/include/math.h. +before-compile := $(common-objpfx)cstdlib $(common-objpfx)cmath \ + $(before-compile) +cstdlib=$(shell echo "\#include <cstdlib>" | $(CXX) -M -MP -x c++ - \ + | sed -n "/cstdlib:/{s/:$$//;p}") +$(common-objpfx)cstdlib: $(cstdlib) + $(INSTALL_DATA) $< $@T + $(move-if-change) $@T $@ +cmath=$(shell echo "\#include <cmath>" | $(CXX) -M -MP -x c++ - \ + | sed -n "/cmath:/{s/:$$//;p}") +$(common-objpfx)cmath: $(cmath) + $(INSTALL_DATA) $< $@T + $(move-if-change) $@T $@ +endif + before-compile := $(common-objpfx)libc-abis.h $(before-compile) $(common-objpfx)libc-abis.h: $(common-objpfx)libc-abis.stamp; @: $(common-objpfx)libc-abis.stamp: $(..)scripts/gen-libc-abis \ @@ -5,6 +5,42 @@ See the end for copying conditions. Please send GNU C library bug reports via <http://sourceware.org/bugzilla/> using `glibc' in the "product" field. +Version 2.25 + +* The feature test macro __STDC_WANT_LIB_EXT2__, from ISO/IEC TR + 24731-2:2010, is supported to enable declarations of functions from that + TR. Note that not all functions from that TR are supported by the GNU C + Library. + +* The feature test macro __STDC_WANT_IEC_60559_BFP_EXT__, from ISO/IEC TS + 18661-1:2014, is supported to enable declarations of functions and macros + from that TS. Note that most features from that TS are not supported by + the GNU C Library. + +* The feature test macro __STDC_WANT_IEC_60559_FUNCS_EXT__, from ISO/IEC TS + 18661-4:2015, is supported to enable declarations of functions and macros + from that TS. Note that most features from that TS are not supported by + the GNU C Library. + +* The inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated. This + means that in a future release, the macros “major”, “minor”, and “makedev” + will only be available from <sys/sysmacros.h>. + + These macros are not part of POSIX nor XSI, and their names frequently + collide with user code; see for instance glibc bug 19239 and Red Hat bug + 130601. <stdlib.h> includes <sys/types.h> under _GNU_SOURCE, and C++ code + presently cannot avoid being compiled under _GNU_SOURCE, exacerbating the + problem. + +Security related changes: + + [Add security related changes here] + +The following bugs are resolved with this release: + + [The release manager will add the list generated by + scripts/list-fixed-bugs.py just before the release.] + Version 2.24 * The minimum Linux kernel version that this version of the GNU C Library @@ -66,10 +102,250 @@ Security related changes: flooded with crafted ICMP and UDP messages. Reported by Aldy Hernandez' alloca plugin for GCC. (CVE-2016-4429) +* The IPv6 name server management code in libresolv could result in a memory + leak for each thread which is created, performs a failing naming lookup, + and exits. Over time, this could result in a denial of service due to + memory exhaustion. Reported by Matthias Schiffer. (CVE-2016-5417) + The following bugs are resolved with this release: - [The release manager will add the list generated by - scripts/list-fixed-bugs.py just before the release.] + [1170] localedata: ne_NP: update Nepali locale definition file + [3629] manual: stpcpy description in string.texi refers to MS-DOG instead + of MS-DOS. + [6527] malloc: [powerpc] Malloc alignment insufficient for PowerPC + [6796] math: fdim() does not set errno on overflow + [10354] libc: posix_spawn should use vfork() in more cases than presently + [11213] localedata: localedata: add copyright disclaimer to locale files + [12143] localedata: chr_US: new Cherokee locale + [12450] localedata: sgs_LT: new locale + [12676] localedata: ln_CD: new locale + [13237] localedata: LC_ADDRESS.country_name: update all locales w/latest + CLDR data + [13304] math: fma, fmaf, fmal produce wrong results + [14259] build: --localedir arg to configure is ignored + [14499] nptl: Does posix_spawn invoke atfork handlers / use vfork? + [14750] libc: Race condition in posix_spawn vfork usage vs signal handlers + [14934] localedata: es_CL: wrong first weekday chilean locale + [15262] localedata: LC_MESSAGES.yesexpr/noexpr: inconsistent use of + romanisation + [15263] localedata: LC_MESSAGES.yesexpr/noexpr: inconsistent use of 1/0 + and +/- + [15264] localedata: LC_MESSAGES.yesstr/nostr: lacking in many locales + [15368] nptl: raise() is not async-signal-safe + [15479] math: ceil, floor, round and trunc raise inexact exception + [15578] localedata: kk_KZ: various updates + [16003] localedata: pap_AN: punt old locale + [16137] localedata: iw_IL: punt old locale + [16190] localedata: eo: new esperanto locale + [16374] localedata: lv_LV: change currency symbol in LC_MONETARY to euro + [16742] malloc: race condition: pthread_atfork() called before first + malloc() results in unexpected locking behaviour/deadlocks + [16975] localedata: LC_MESSAGES.yesexpr/noexpr: revisit capitalization in + all locales + [16983] localedata: postal_fmt does not allow %l and %n modifiers + [17565] localedata: pt_PT: wrong (work-)week start + [17899] math: [powerpc] floorl returns negative zero with FE_DOWNWARD + [17950] build: Build fails with -msse + [18205] localedata: be_BY*: wrong first_weekday and first_workday + [18433] libc: posix_spawn does not return correctly upon failure to + execute + [18453] localedata: charmaps/IBM875: incorrect codes + [18712] string: bits/string2.h incompatible with -O2 -Werror=packed + -Wsystem-headers + [18896] localedata: he_IL: improvements for currency + [18911] localedata: ro_RO: Correcting week day name for "Tuesday" in + Romanian locale data + [18960] locale: s390: _nl_locale_subfreeres uses larl opcode on misaligned + symbol + [19056] libc: Deprecate readdir_r + [19133] localedata: pt_*: days & months should be lowercase in Portuguese + language + [19198] localedata: nl_NL: small improvements for Dutch locales + [19257] network: Per-thread memory leak in __res_vinit with IPv6 + nameservers (CVE-2016-5417) + [19269] build: tst-audit4 and tst-audit10 failures with gcc-6 on non avx + machine + [19400] locale: Language missing in "iso-639.def", trivial fix in + description + [19431] malloc: Deadlock between fflush, getdelim, and fork + [19505] libc: Incorrect file descriptor validity checks in + posix_spawn_file_actions_add{open,close,dup2} + [19509] dynamic-link: dlsym, dlvsym do not report errors through dlerror + when using RTLD_NEXT + [19512] locale: Stale `#ifndef HAVE_BUILTIN_EXPECT' in + `intl/{gettextP,loadinfo}.h' + [19534] libc: execle, execlp may use malloc + [19568] localedata: *_CH: Swiss locales have inconsistent start of week + [19573] network: res_nclose and __res_maybe_init disagree about name + server initialization, breaking Hesiod + [19575] localedata: Status of GB18030 tables + [19581] localedata: sr_* date_fmt string contains additional newline + [19583] string: SSSE3_Fast_Copy_Backward flag needs to be enabled for AMD + Excavator core + [19592] math: [ldbl-128ibm] ceill incorrect in non-default rounding modes + [19593] math: [ldbl-128ibm] truncl incorrect in non-default rounding modes + [19594] math: [ldbl-128ibm] roundl incorrect in non-default rounding modes + [19595] math: [ldbl-128ibm] fmodl incorrect for results in subnormal + double range + [19602] math: [ldbl-128ibm] fmodl handling of equal arguments with low + part zero incorrect + [19603] math: [ldbl-128ibm] remainderl, remquol incorrect sign handling in + equality tests + [19610] dynamic-link: ldconfig -X removes stale symbolic links + [19613] libc: s390x (64 bit) macro expansion WCOREDUMP and others + [19633] locale: strfmon_l applies global locale to number formatting + [19642] network: Memory leak in getnameinfo + [19648] libc: test-skeleton.c: Do not set RLIMIT_DATA + [19653] libc: Potential for NULL pointer dereference (CWE-476) in + glibc-2.22 + [19654] math: [x86_64] Need testcase for BZ #19590 fix + [19671] localedata: Missing Sanity Check for malloc() in 'tst-fmon.c' & + 'tst-numeric.c' + [19674] math: [ldbl-128ibm] powl incorrect overflow handling + [19677] math: [ldbl-128ibm] remainderl equality test incorrect for zero + low part + [19678] math: [ldbl-128ibm] nextafterl, nexttowardl incorrect sign of zero + result + [19679] dynamic-link: gcc-4.9.3 C++ exception handling broken due to + unaligned stack + [19726] locale: Converting UCS4LE to INTERNAL with iconv() does not update + pointers and lengths in error-case. + [19727] locale: Converting from/to UTF-xx with iconv() does not always + report errors on UTF-16 surrogates values. + [19755] nscd: nscd assertion failure in gc + [19758] dynamic-link: Typo in EXTRA_LD_ENVVARS for x86-64 + [19759] libc: mempcpy shouldn't be inlined + [19762] dynamic-link: HAS_CPU_FEATURE/HAS_ARCH_FEATURE are easy to misuse + [19765] libc: s390 needs an optimized mempcpy + [19779] glob: glob: buffer overflow with GLOB_ALTDIRFUNC due to incorrect + NAME_MAX limit assumption (CVE-2016-1234) + [19783] build: benchtests don't support --enable-hardcoded-path-in-tests + [19787] network: Missing and incorrect truncation checks in getnameinfo + [19790] math: [ldbl-128ibm] nearbyintl incorrect in non-default rounding + modes + [19791] network: Assertion failure in res_query.c with un-connectable name + server addresses + [19792] libc: MIPS: backtrace yields infinite backtrace with makecontext + [19822] math: libm.so install clobbers old version + [19825] network: resolv: send_vc can return uninitialized data in second + response to getaddrinfo + [19830] network: nss_dns: should check RDATA length against buffer length + [19831] network: nss_dns: getaddrinfo returns uninitialized data when + confronted with A/AAAA records of invalid size + [19837] nss: nss_db: No retries for some long lines with a larger buffer + [19848] math: powl(10,n) for n=-4,-5,-6,-7 is off by more than 1 ULP + [19853] stdio: Printing IBM long double in decimal with high precision is + sometimes incorrect + [19860] build: x86_64: compile errors for tst-audit10 and tst-auditmod10b + [19861] nptl: libpthread IFUNC resolver for fork can lead to crash + [19862] network: resolv, nss_dns: Remove remaining logging of unexpected + record types + [19865] network: Assertion failure or memory leak in + _nss_dns_getcanonname_r + [19868] network: nss_dns: netent code does not skip over non-PTR records + [19879] network: nss_dns: Stack overflow in getnetbyname implementation + (CVE-2016-3075) + [19881] string: Improve x86-64 memset + [19907] string: Incorrect memcpy tests + [19916] dynamic-link: S390: fprs/vrs are not saved/restored while + resolving symbols + [19925] libc: termios.h XCASE namespace + [19928] string: memmove-vec-unaligned-erms.S is slow with large data size + [19929] libc: limits.h NL_NMAX namespace + [19931] stdio: Memory leak in vfprintf + [19957] libc: clone(CLONE_VM) access invalid parent memory + [19963] localedata: en_IL: New locale + [19989] stdio: stdio.h cuserid namespace + [19994] network: getaddrinfo does not restore RES_USE_INET6 flag in + gethosts + [19996] locale: langinfo.h nl_langinfo_l namespace + [20005] stdio: fflush on a file opened with fmemopen resets position to 0 + [20010] network: getaddrinfo: Stack overflow in hostent translation + (CVE-2016-3706) + [20012] stdio: libio: fmemopen append mode failure + [20014] stdio: stdio.h namespace for pre-threads POSIX + [20017] network: resolv: Use gmtime_r instead of gmtime in p_secstodate + [20023] libc: fcntl.h timespec namespace + [20024] math: [x86_64] vectorized sincos trashes the stack + [20031] network: nss_hesiod: Heap overflow in get_txt_records + [20041] time: sys/time.h timespec namespace + [20043] libc: unistd.h missing cuserid for UNIX98 and before + [20044] libc: unistd.h missing pthread_atfork for UNIX98 + [20051] libc: ttyslot in wrong header under wrong conditions + [20054] libc: gethostname not declared for XPG4 + [20055] libc: termios.h missing tcgetsid for XPG4 + [20072] dynamic-link: x86 init_cpu_features is called twice in static + executable + [20073] libc: sys/stat.h fchmod namespace + [20074] libc: stdlib.h rand_r namespace + [20076] libc: sys/stat.h missing S_IFSOCK, S_ISSOCK for XPG4 + [20094] libc: stdlib.h should not declare grantpt, ptsname, unlockpt for + XPG3 + [20111] libc: struct sockaddr_storage cannot be aggregate-copied + [20112] network: sunrpc: stack (frame) overflow in Sun RPC clntudp_call + (CVE-2016-4429) + [20115] string: Extra alignment in memset-vec-unaligned-erms.S + [20119] libc: Wrong mask for processors level type from CPUID + [20139] dynamic-link: Upper part of zmm is zeroed if Glibc is built with + AS not supporting AVX512 + [20151] math: [ldbl-128/ldbl-128ibm] j0l, j1l, y0l, y1l return sNaN for + sNaN argument + [20153] math: [ldbl-128ibm] sqrtl (sNaN) returns sNaN + [20156] math: [ldbl-128ibm] ceill, rintl etc. return sNaN for sNaN + argument + [20157] math: [powerpc] fabsl (sNaN) wrongly raises "invalid" + [20160] math: [powerpc] ceil, rint etc. return sNaN for sNaN input + [20178] libc: posix_spawn{p} should not call exit + [20191] stdio: libio: vtables hardening + [20195] string: FMA4 detection requires CPUID execution with register + eax=0x80000001 + [20198] libc: quick_exit incorrectly destroys C++11 thread objects. + [20205] math: [i386/x86_64] nextafterl incorrect incrementing negative + subnormals + [20212] math: acos (sNaN) returns sNaN + [20213] math: asin (sNaN) returns sNaN + [20214] network: Linux header sync with linux/in6.h and ipv6.h again. + [20218] math: [i386] asinhl (sNaN) returns sNaN + [20219] math: [i386] atanhl (sNaN) returns sNaN + [20222] stdio: fopencookie: Mangle function pointers + [20224] math: [i386] cbrtl (sNaN) returns sNaN + [20225] math: ldexp, scalbn, scalbln return sNaN for sNaN input + [20226] math: [i386/x86_64] expl, exp10l, expm1l return sNaN for sNaN + input + [20227] math: [i386/x86_64] logl (sNaN) returns sNaN + [20228] math: [i386/x86_64] log10l (sNaN) returns sNaN + [20229] math: [i386/x86_64] log1pl (sNaN) returns sNaN + [20232] math: [ldbl-128] expm1l (sNaN) returns sNaN + [20233] math: [ldbl-128ibm] expm1l (sNaN) returns sNaN + [20234] math: [ldbl-128ibm] log1pl (sNaN) returns sNaN + [20235] math: [i386/x86_64] log2l (sNaN) returns sNaN + [20237] nss: nss_db: get*ent segfaults without preceding set*ent + [20240] math: modf (sNaN) returns sNaN + [20248] libc: debug/tst-longjump_chk2 calls printf from a signal handler + [20250] math: frexp (sNaN) returns sNaN + [20252] math: atan2 (sNaN, qNaN) fails to raise "invalid" + [20255] math: [i386] fdim, fdimf return with excess range and precision / + double rounding + [20256] math: [i386/x86_64] fdiml returns sNaN for sNaN input + [20260] string: ../sysdeps/x86/bits/string.h:1092:3: error: array + subscript is below array bounds [-Werror=array-bounds] + [20262] nis: _nss_nis_initgroups_dyn always returns NSS_STATUS_NOTFOUND + [20263] nptl: robust mutex deadlocks if other thread requests timedlock + (Only arm/linux) + [20277] libc: $dp is not initialized correctly in sysdeps/hppa/start.S + [20284] malloc: malloc: Corrupt arena avoidance causes unnecessary mmap + fallbacks + [20296] math: [i386/x86_64] scalbl returns sNaN for sNaN input, missing + "invalid" exceptions + [20314] nptl: make[4]: *** [/usr/include/stdlib.h] Error 1 + [20316] localedata: id_ID: Februari instead of Pebruari + [20327] string: POWER8 strcasecmp returns incorrect result + [20347] math: Failure: Test: j0_downward (0xap+0) + [20348] libc: FAIL: misc/tst-preadvwritev64 + [20349] libc: 64-bit value is passed differently in p{readv,writev}{64} + [20350] libc: There is no test for p{read,write}64 + [20357] math: Incorrect cos result for 1.5174239687223976 + [20384] build: Don't run libmvec-sincos-avx* tests on non avx machines Version 2.23 @@ -21,6 +21,9 @@ # error "Never use <bits/in.h> directly; include <netinet/in.h> instead." #endif +/* This is the generic version, do not assume a linux-based kernel. */ +#define __USE_KERNEL_IPV6_DEFS 0 + /* To select the IP level. */ #define SOL_IP 0 diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h new file mode 100644 index 0000000..ee6a876 --- /dev/null +++ b/bits/libc-header-start.h @@ -0,0 +1,61 @@ +/* Handle feature test macros at the start of a header. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This header is internal to glibc and should not be included outside + of glibc headers. Headers including it must define + __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION first. This header + cannot have multiple include guards because ISO C feature test + macros depend on the definition of the macro when an affected + header is included, not when the first system header is + included. */ + +#ifndef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +# error "Never include <bits/libc-header-start.h> directly." +#endif + +#undef __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION + +#include <features.h> + +/* ISO/IEC TR 24731-2:2010 defines the __STDC_WANT_LIB_EXT2__ + macro. */ +#undef __GLIBC_USE_LIB_EXT2 +#if (defined __USE_GNU \ + || (defined __STDC_WANT_LIB_EXT2__ && __STDC_WANT_LIB_EXT2__ > 0)) +# define __GLIBC_USE_LIB_EXT2 1 +#else +# define __GLIBC_USE_LIB_EXT2 0 +#endif + +/* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ + macro. */ +#undef __GLIBC_USE_IEC_60559_BFP_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ +# define __GLIBC_USE_IEC_60559_BFP_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_BFP_EXT 0 +#endif + +/* ISO/IEC TS 18661-4:2015 defines the + __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */ +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT +#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ +# define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 +#else +# define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 +#endif diff --git a/bits/sysmacros.h b/bits/sysmacros.h new file mode 100644 index 0000000..e2c0bc2 --- /dev/null +++ b/bits/sysmacros.h @@ -0,0 +1,74 @@ +/* Definitions of macros to access `dev_t' values. + Copyright (C) 1996-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SYSMACROS_H +#define _BITS_SYSMACROS_H 1 + +#ifndef _SYS_SYSMACROS_H +# error "Never include <bits/sysmacros.h> directly; use <sys/sysmacros.h> instead." +#endif + +/* dev_t in glibc is a 64-bit quantity, with 32-bit major and minor numbers. + Our default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of + the major number and m is a hex digit of the minor number. This is + downward compatible with legacy systems where dev_t is 16 bits wide, + encoded as MMmm. It is also downward compatible with the Linux kernel, + which (as of 2016) uses 32-bit dev_t, encoded as mmmM MMmm. + + Systems that use an incompatible encoding for dev_t should override this + file in the appropriate sysdeps subdirectory. */ + +#define __SYSMACROS_DECLARE_MAJOR(DECL_TEMPL) \ + DECL_TEMPL(unsigned int, major, (__dev_t __dev)) + +#define __SYSMACROS_DEFINE_MAJOR(DECL_TEMPL) \ + __SYSMACROS_DECLARE_MAJOR (DECL_TEMPL) \ + { \ + unsigned int __major; \ + __major = ((__dev & (__dev_t) 0x00000000000fff00u) >> 8); \ + __major |= ((__dev & (__dev_t) 0xfffff00000000000u) >> 32); \ + return __major; \ + } + +#define __SYSMACROS_DECLARE_MINOR(DECL_TEMPL) \ + DECL_TEMPL(unsigned int, minor, (__dev_t __dev)) + +#define __SYSMACROS_DEFINE_MINOR(DECL_TEMPL) \ + __SYSMACROS_DECLARE_MINOR (DECL_TEMPL) \ + { \ + unsigned int __minor; \ + __minor = ((__dev & (__dev_t) 0x00000000000000ffu) >> 0); \ + __minor |= ((__dev & (__dev_t) 0x00000ffffff00000u) >> 12); \ + return __minor; \ + } + +#define __SYSMACROS_DECLARE_MAKEDEV(DECL_TEMPL) \ + DECL_TEMPL(__dev_t, makedev, (unsigned int __major, unsigned int __minor)) + +#define __SYSMACROS_DEFINE_MAKEDEV(DECL_TEMPL) \ + __SYSMACROS_DECLARE_MAKEDEV (DECL_TEMPL) \ + { \ + __dev_t __dev; \ + __dev = (((__dev_t) (__major & 0x00000fffu)) << 8); \ + __dev |= (((__dev_t) (__major & 0xfffff000u)) << 32); \ + __dev |= (((__dev_t) (__minor & 0x000000ffu)) << 0); \ + __dev |= (((__dev_t) (__minor & 0xffffff00u)) << 12); \ + return __dev; \ + } + +#endif /* bits/sysmacros.h */ diff --git a/bits/termios.h b/bits/termios.h index f28b492..c1b1a99 100644 --- a/bits/termios.h +++ b/bits/termios.h @@ -152,7 +152,7 @@ struct termios # define NLDLY (3 << 8) /* NL delay. */ # define NL0 (0 << 8) /* NL type 0. */ # define NL1 (1 << 8) /* NL type 1. */ -# define TABDLY (3 << 10) /* TAB delay. */ +# define TABDLY (3 << 10 | 1 << 2) /* TAB delay. */ # define TAB0 (0 << 10) /* TAB delay type 0. */ # define TAB1 (1 << 10) /* TAB delay type 1. */ # define TAB2 (2 << 10) /* TAB delay type 2. */ diff --git a/config.h.in b/config.h.in index b28b513..856ef6a 100644 --- a/config.h.in +++ b/config.h.in @@ -67,8 +67,8 @@ /* Define if compiler supports AVX512. */ #undef HAVE_AVX512_SUPPORT -/* Define if assembler supports AVX512. */ -#undef HAVE_AVX512_ASM_SUPPORT +/* Define if assembler supports AVX512DQ. */ +#undef HAVE_AVX512DQ_ASM_SUPPORT /* Define if assembler supports vector instructions on S390. */ #undef HAVE_S390_VX_ASM_SUPPORT @@ -619,6 +619,7 @@ LIBGD libc_cv_cc_loop_to_function libc_cv_cc_submachine libc_cv_cc_nofma +libc_cv_mtls_dialect_gnu2 stack_protector fno_unit_at_a_time libc_cv_output_format @@ -5824,6 +5825,38 @@ elif test "$libc_cv_ssp" = "yes"; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mtls-dialect=gnu2" >&5 +$as_echo_n "checking for -mtls-dialect=gnu2... " >&6; } +if ${libc_cv_mtls_dialect_gnu2+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<EOF +__thread int i; +void foo (void) +{ + i = 10; +} +EOF +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -fPIC -mtls-dialect=gnu2 + conftest.c 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then + libc_cv_mtls_dialect_gnu2=yes +else + libc_cv_mtls_dialect_gnu2=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mtls_dialect_gnu2" >&5 +$as_echo "$libc_cv_mtls_dialect_gnu2" >&6; } + +config_vars="$config_vars +have-mtls-dialect-gnu2 = $libc_cv_mtls_dialect_gnu2" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc puts quotes around section names" >&5 $as_echo_n "checking whether cc puts quotes around section names... " >&6; } if ${libc_cv_have_section_quotes+:} false; then : diff --git a/configure.ac b/configure.ac index 123f0d2..33bcd62 100644 --- a/configure.ac +++ b/configure.ac @@ -1412,6 +1412,26 @@ elif test "$libc_cv_ssp" = "yes"; then fi AC_SUBST(stack_protector) +AC_CACHE_CHECK([for -mtls-dialect=gnu2], libc_cv_mtls_dialect_gnu2, +[dnl +cat > conftest.c <<EOF +__thread int i; +void foo (void) +{ + i = 10; +} +EOF +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -fPIC -mtls-dialect=gnu2 + conftest.c 1>&AS_MESSAGE_LOG_FD]) +then + libc_cv_mtls_dialect_gnu2=yes +else + libc_cv_mtls_dialect_gnu2=no +fi +rm -f conftest*]) +AC_SUBST(libc_cv_mtls_dialect_gnu2) +LIBC_CONFIG_VAR([have-mtls-dialect-gnu2], [$libc_cv_mtls_dialect_gnu2]) + AC_CACHE_CHECK(whether cc puts quotes around section names, libc_cv_have_section_quotes, [cat > conftest.c <<EOF diff --git a/csu/libc-tls.c b/csu/libc-tls.c index d6425e0..235ac79 100644 --- a/csu/libc-tls.c +++ b/csu/libc-tls.c @@ -175,7 +175,7 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign) #else # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" #endif - _dl_static_dtv[2].pointer.is_static = true; + _dl_static_dtv[2].pointer.to_free = NULL; /* sbrk gives us zero'd memory, so we don't need to clear the remainder. */ memcpy (_dl_static_dtv[2].pointer.val, initimage, filesz); diff --git a/elf/Makefile b/elf/Makefile index 210dde9..593403c 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -224,6 +224,13 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \ tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \ tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 +ifeq (yes,$(have-mtls-dialect-gnu2)) +tests += tst-gnu2-tls1 +modules-names += tst-gnu2-tls1mod +$(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so +tst-gnu2-tls1mod.so-no-z-defs = yes +CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2 +endif ifeq (yes,$(have-protected-data)) modules-names += tst-protected1moda tst-protected1modb tests += tst-protected1a tst-protected1b diff --git a/elf/dl-addr.c b/elf/dl-addr.c index 291ff55..1b16a58 100644 --- a/elf/dl-addr.c +++ b/elf/dl-addr.c @@ -88,6 +88,7 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info, for (; (void *) symtab < (void *) symtabend; ++symtab) if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK) + && __glibc_likely (!dl_symbol_visibility_binds_local_p (symtab)) && ELFW(ST_TYPE) (symtab->st_info) != STT_TLS && (symtab->st_shndx != SHN_UNDEF || symtab->st_value != 0) diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 6d299c1..52c994e 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -516,6 +516,10 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash, #endif } + /* Hidden and internal symbols are local, ignore them. */ + if (__glibc_unlikely (dl_symbol_visibility_binds_local_p (sym))) + goto skip; + switch (ELFW(ST_BIND) (sym->st_info)) { case STB_WEAK: diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c index c8a8f8d..6034b5a 100644 --- a/elf/dl-minimal.c +++ b/elf/dl-minimal.c @@ -27,6 +27,7 @@ #include <sys/types.h> #include <ldsodefs.h> #include <_itoa.h> +#include <malloc/malloc-internal.h> #include <assert.h> @@ -90,7 +91,7 @@ __libc_memalign (size_t align, size_t n) void * weak_function malloc (size_t n) { - return __libc_memalign (sizeof (double), n); + return __libc_memalign (MALLOC_ALIGNMENT, n); } /* We use this function occasionally since the real implementation may diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index 14709f9..42bddc1 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -233,7 +233,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */ #define RESOLVE_MAP(ref, version, r_type) \ - (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ + ((ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ + && __glibc_likely (!dl_symbol_visibility_binds_local_p (*ref))) \ ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ ? (bump_num_cache_relocations (), \ diff --git a/elf/dl-tls.c b/elf/dl-tls.c index ed13fd9..17567ad 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -347,6 +347,22 @@ _dl_get_tls_static_info (size_t *sizep, size_t *alignp) *alignp = GL(dl_tls_static_align); } +/* Derive the location of the pointer to the start of the original + allocation (before alignment) from the pointer to the TCB. */ +static inline void ** +tcb_to_pointer_to_free_location (void *tcb) +{ +#if TLS_TCB_AT_TP + /* The TCB follows the TLS blocks, and the pointer to the front + follows the TCB. */ + void **original_pointer_location = tcb + TLS_TCB_SIZE; +#elif TLS_DTV_AT_TP + /* The TCB comes first, preceded by the pre-TCB, and the pointer is + before that. */ + void **original_pointer_location = tcb - TLS_PRE_TCB_SIZE - sizeof (void *); +#endif + return original_pointer_location; +} void * internal_function @@ -359,39 +375,50 @@ _dl_allocate_tls_storage (void) /* Memory layout is: [ TLS_PRE_TCB_SIZE ] [ TLS_TCB_SIZE ] [ TLS blocks ] ^ This should be returned. */ - size += (TLS_PRE_TCB_SIZE + GL(dl_tls_static_align) - 1) - & ~(GL(dl_tls_static_align) - 1); + size += TLS_PRE_TCB_SIZE; #endif - /* Allocate a correctly aligned chunk of memory. */ - result = __libc_memalign (GL(dl_tls_static_align), size); - if (__builtin_expect (result != NULL, 1)) - { - /* Allocate the DTV. */ - void *allocated = result; + /* Perform the allocation. Reserve space for the required alignment + and the pointer to the original allocation. */ + size_t alignment = GL(dl_tls_static_align); + void *allocated = malloc (size + alignment + sizeof (void *)); + if (__glibc_unlikely (allocated == NULL)) + return NULL; + /* Perform alignment and allocate the DTV. */ #if TLS_TCB_AT_TP - /* The TCB follows the TLS blocks. */ - result = (char *) result + size - TLS_TCB_SIZE; - - /* Clear the TCB data structure. We can't ask the caller (i.e. - libpthread) to do it, because we will initialize the DTV et al. */ - memset (result, '\0', TLS_TCB_SIZE); + /* The TCB follows the TLS blocks, which determine the alignment. + (TCB alignment requirements have been taken into account when + calculating GL(dl_tls_static_align).) */ + void *aligned = (void *) roundup ((uintptr_t) allocated, alignment); + result = aligned + size - TLS_TCB_SIZE; + + /* Clear the TCB data structure. We can't ask the caller (i.e. + libpthread) to do it, because we will initialize the DTV et al. */ + memset (result, '\0', TLS_TCB_SIZE); #elif TLS_DTV_AT_TP - result = (char *) result + size - GL(dl_tls_static_size); - - /* Clear the TCB data structure and TLS_PRE_TCB_SIZE bytes before it. - We can't ask the caller (i.e. libpthread) to do it, because we will - initialize the DTV et al. */ - memset ((char *) result - TLS_PRE_TCB_SIZE, '\0', - TLS_PRE_TCB_SIZE + TLS_TCB_SIZE); + /* Pre-TCB and TCB come before the TLS blocks. The layout computed + in _dl_determine_tlsoffset assumes that the TCB is aligned to the + TLS block alignment, and not just the TLS blocks after it. This + can leave an unused alignment gap between the TCB and the TLS + blocks. */ + result = (void *) roundup + (sizeof (void *) + TLS_PRE_TCB_SIZE + (uintptr_t) allocated, + alignment); + + /* Clear the TCB data structure and TLS_PRE_TCB_SIZE bytes before + it. We can't ask the caller (i.e. libpthread) to do it, because + we will initialize the DTV et al. */ + memset (result - TLS_PRE_TCB_SIZE, '\0', TLS_PRE_TCB_SIZE + TLS_TCB_SIZE); #endif - result = allocate_dtv (result); - if (result == NULL) - free (allocated); - } + /* Record the value of the original pointer for later + deallocation. */ + *tcb_to_pointer_to_free_location (result) = allocated; + result = allocate_dtv (result); + if (result == NULL) + free (allocated); return result; } @@ -494,7 +521,7 @@ _dl_allocate_tls_init (void *result) maxgen = MAX (maxgen, listp->slotinfo[cnt].gen); dtv[map->l_tls_modid].pointer.val = TLS_DTV_UNALLOCATED; - dtv[map->l_tls_modid].pointer.is_static = false; + dtv[map->l_tls_modid].pointer.to_free = NULL; if (map->l_tls_offset == NO_TLS_OFFSET || map->l_tls_offset == FORCED_DYNAMIC_TLS_OFFSET) @@ -551,26 +578,14 @@ _dl_deallocate_tls (void *tcb, bool dealloc_tcb) /* We need to free the memory allocated for non-static TLS. */ for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt) - if (! dtv[1 + cnt].pointer.is_static - && dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED) - free (dtv[1 + cnt].pointer.val); + free (dtv[1 + cnt].pointer.to_free); /* The array starts with dtv[-1]. */ if (dtv != GL(dl_initial_dtv)) free (dtv - 1); if (dealloc_tcb) - { -#if TLS_TCB_AT_TP - /* The TCB follows the TLS blocks. Back up to free the whole block. */ - tcb -= GL(dl_tls_static_size) - TLS_TCB_SIZE; -#elif TLS_DTV_AT_TP - /* Back up the TLS_PRE_TCB_SIZE bytes. */ - tcb -= (TLS_PRE_TCB_SIZE + GL(dl_tls_static_align) - 1) - & ~(GL(dl_tls_static_align) - 1); -#endif - free (tcb); - } + free (*tcb_to_pointer_to_free_location (tcb)); } rtld_hidden_def (_dl_deallocate_tls) @@ -594,21 +609,49 @@ rtld_hidden_def (_dl_deallocate_tls) # define GET_ADDR_OFFSET ti->ti_offset # endif +/* Allocate one DTV entry. */ +static struct dtv_pointer +allocate_dtv_entry (size_t alignment, size_t size) +{ + if (powerof2 (alignment) && alignment <= _Alignof (max_align_t)) + { + /* The alignment is supported by malloc. */ + void *ptr = malloc (size); + return (struct dtv_pointer) { ptr, ptr }; + } -static void * + /* Emulate memalign to by manually aligning a pointer returned by + malloc. First compute the size with an overflow check. */ + size_t alloc_size = size + alignment; + if (alloc_size < size) + return (struct dtv_pointer) {}; + + /* Perform the allocation. This is the pointer we need to free + later. */ + void *start = malloc (alloc_size); + if (start == NULL) + return (struct dtv_pointer) {}; + + /* Find the aligned position within the larger allocation. */ + void *aligned = (void *) roundup ((uintptr_t) start, alignment); + + return (struct dtv_pointer) { .val = aligned, .to_free = start }; +} + +static struct dtv_pointer allocate_and_init (struct link_map *map) { - void *newp; - - newp = __libc_memalign (map->l_tls_align, map->l_tls_blocksize); - if (newp == NULL) + struct dtv_pointer result = allocate_dtv_entry + (map->l_tls_align, map->l_tls_blocksize); + if (result.val == NULL) oom (); /* Initialize the memory. */ - memset (__mempcpy (newp, map->l_tls_initimage, map->l_tls_initimage_size), + memset (__mempcpy (result.val, map->l_tls_initimage, + map->l_tls_initimage_size), '\0', map->l_tls_blocksize - map->l_tls_initimage_size); - return newp; + return result; } @@ -678,12 +721,9 @@ _dl_update_slotinfo (unsigned long int req_modid) { /* If this modid was used at some point the memory might still be allocated. */ - if (! dtv[total + cnt].pointer.is_static - && (dtv[total + cnt].pointer.val - != TLS_DTV_UNALLOCATED)) - free (dtv[total + cnt].pointer.val); + free (dtv[total + cnt].pointer.to_free); dtv[total + cnt].pointer.val = TLS_DTV_UNALLOCATED; - dtv[total + cnt].pointer.is_static = false; + dtv[total + cnt].pointer.to_free = NULL; } continue; @@ -708,16 +748,9 @@ _dl_update_slotinfo (unsigned long int req_modid) dtv entry free it. */ /* XXX Ideally we will at some point create a memory pool. */ - if (! dtv[modid].pointer.is_static - && dtv[modid].pointer.val != TLS_DTV_UNALLOCATED) - /* Note that free is called for NULL is well. We - deallocate even if it is this dtv entry we are - supposed to load. The reason is that we call - memalign and not malloc. */ - free (dtv[modid].pointer.val); - + free (dtv[modid].pointer.to_free); dtv[modid].pointer.val = TLS_DTV_UNALLOCATED; - dtv[modid].pointer.is_static = false; + dtv[modid].pointer.to_free = NULL; if (modid == req_modid) the_map = map; @@ -780,7 +813,7 @@ tls_get_addr_tail (GET_ADDR_ARGS, dtv_t *dtv, struct link_map *the_map) #endif __rtld_lock_unlock_recursive (GL(dl_load_lock)); - dtv[GET_ADDR_MODULE].pointer.is_static = true; + dtv[GET_ADDR_MODULE].pointer.to_free = NULL; dtv[GET_ADDR_MODULE].pointer.val = p; return (char *) p + GET_ADDR_OFFSET; @@ -788,10 +821,11 @@ tls_get_addr_tail (GET_ADDR_ARGS, dtv_t *dtv, struct link_map *the_map) else __rtld_lock_unlock_recursive (GL(dl_load_lock)); } - void *p = dtv[GET_ADDR_MODULE].pointer.val = allocate_and_init (the_map); - assert (!dtv[GET_ADDR_MODULE].pointer.is_static); + struct dtv_pointer result = allocate_and_init (the_map); + dtv[GET_ADDR_MODULE].pointer = result; + assert (result.to_free != NULL); - return (char *) p + GET_ADDR_OFFSET; + return (char *) result.val + GET_ADDR_OFFSET; } @@ -3682,6 +3682,68 @@ enum #define R_BPF_NONE 0 /* No reloc */ #define R_BPF_MAP_FD 1 /* Map fd to pointer */ +/* Imagination Meta specific relocations. */ + +#define R_METAG_HIADDR16 0 +#define R_METAG_LOADDR16 1 +#define R_METAG_ADDR32 2 /* 32bit absolute address */ +#define R_METAG_NONE 3 /* No reloc */ +#define R_METAG_RELBRANCH 4 +#define R_METAG_GETSETOFF 5 + +/* Backward compatability */ +#define R_METAG_REG32OP1 6 +#define R_METAG_REG32OP2 7 +#define R_METAG_REG32OP3 8 +#define R_METAG_REG16OP1 9 +#define R_METAG_REG16OP2 10 +#define R_METAG_REG16OP3 11 +#define R_METAG_REG32OP4 12 + +#define R_METAG_HIOG 13 +#define R_METAG_LOOG 14 + +#define R_METAG_REL8 15 +#define R_METAG_REL16 16 + +/* GNU */ +#define R_METAG_GNU_VTINHERIT 30 +#define R_METAG_GNU_VTENTRY 31 + +/* PIC relocations */ +#define R_METAG_HI16_GOTOFF 32 +#define R_METAG_LO16_GOTOFF 33 +#define R_METAG_GETSET_GOTOFF 34 +#define R_METAG_GETSET_GOT 35 +#define R_METAG_HI16_GOTPC 36 +#define R_METAG_LO16_GOTPC 37 +#define R_METAG_HI16_PLT 38 +#define R_METAG_LO16_PLT 39 +#define R_METAG_RELBRANCH_PLT 40 +#define R_METAG_GOTOFF 41 +#define R_METAG_PLT 42 +#define R_METAG_COPY 43 +#define R_METAG_JMP_SLOT 44 +#define R_METAG_RELATIVE 45 +#define R_METAG_GLOB_DAT 46 + +/* TLS relocations */ +#define R_METAG_TLS_GD 47 +#define R_METAG_TLS_LDM 48 +#define R_METAG_TLS_LDO_HI16 49 +#define R_METAG_TLS_LDO_LO16 50 +#define R_METAG_TLS_LDO 51 +#define R_METAG_TLS_IE 52 +#define R_METAG_TLS_IENONPIC 53 +#define R_METAG_TLS_IENONPIC_HI16 54 +#define R_METAG_TLS_IENONPIC_LO16 55 +#define R_METAG_TLS_TPOFF 56 +#define R_METAG_TLS_DTPMOD 57 +#define R_METAG_TLS_DTPOFF 58 +#define R_METAG_TLS_LE 59 +#define R_METAG_TLS_LE_HI16 60 +#define R_METAG_TLS_LE_LO16 61 + __END_DECLS #endif /* elf.h */ diff --git a/sysdeps/generic/sys/sysmacros.h b/elf/tst-gnu2-tls1.c index 4cc5961..f55de59 100644 --- a/sysdeps/generic/sys/sysmacros.h +++ b/elf/tst-gnu2-tls1.c @@ -1,5 +1,5 @@ -/* Definitions of macros to access `dev_t' values. - Copyright (C) 1996-2016 Free Software Foundation, Inc. +/* Test local and global dynamic models for GNU2 TLS. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,15 +16,37 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _SYS_SYSMACROS_H -#define _SYS_SYSMACROS_H 1 +#include <stdio.h> +#include <stdlib.h> -/* For compatibility we provide alternative names. +extern int * get_gd (void); +extern void set_gd (int); +extern int test_gd (int); +extern int * get_ld (void); +extern void set_ld (int); +extern int test_ld (int); - The problem here is that compilers other than GCC probably don't - have the `long long' type and so `dev_t' is actually an array. */ -#define major(dev) ((int)(((unsigned int) (dev) >> 8) & 0xff)) -#define minor(dev) ((int)((dev) & 0xff)) -#define makedev(major, minor) (((major) << 8) | (minor)) +__thread int gd = 1; -#endif /* sys/sysmacros.h */ +static int +do_test (void) +{ + int *p; + + p = get_gd (); + set_gd (3); + if (*p != 3 || !test_gd (3)) + abort (); + + p = get_ld (); + set_ld (4); + if (*p != 4 || !test_ld (4)) + abort (); + + printf ("PASS\n"); + + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/elf/tst-gnu2-tls1mod.c b/elf/tst-gnu2-tls1mod.c new file mode 100644 index 0000000..45c4816 --- /dev/null +++ b/elf/tst-gnu2-tls1mod.c @@ -0,0 +1,56 @@ +/* DSO used by tst-gnu2-tls1. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +static __thread int ld; + +int * +get_ld (void) +{ + return &ld; +} + +void +set_ld (int i) +{ + ld = i; +} + +int +test_ld (int i) +{ + return ld == i; +} +extern __thread int gd; + +int * +get_gd (void) +{ + return &gd; +} + +void +set_gd (int i) +{ + gd = i; +} + +int +test_gd (int i) +{ + return gd == i; +} diff --git a/grp/Makefile b/grp/Makefile index b4d52e2..3807bfa 100644 --- a/grp/Makefile +++ b/grp/Makefile @@ -22,7 +22,7 @@ subdir := grp include ../Makeconfig -headers := grp.h grp-merge.h +headers := grp.h routines := fgetgrent initgroups setgroups \ getgrent getgrgid getgrnam putgrent \ diff --git a/include/atomic.h b/include/atomic.h index ad3db25..5a8e7e7 100644 --- a/include/atomic.h +++ b/include/atomic.h @@ -588,6 +588,9 @@ void __atomic_link_error (void); __atomic_compare_exchange_n ((mem), (expected), (desired), 1, \ __ATOMIC_RELEASE, __ATOMIC_RELAXED); }) +# define atomic_exchange_relaxed(mem, desired) \ + ({ __atomic_check_size((mem)); \ + __atomic_exchange_n ((mem), (desired), __ATOMIC_RELAXED); }) # define atomic_exchange_acquire(mem, desired) \ ({ __atomic_check_size((mem)); \ __atomic_exchange_n ((mem), (desired), __ATOMIC_ACQUIRE); }) @@ -608,9 +611,15 @@ void __atomic_link_error (void); ({ __atomic_check_size((mem)); \ __atomic_fetch_add ((mem), (operand), __ATOMIC_ACQ_REL); }) +# define atomic_fetch_and_relaxed(mem, operand) \ + ({ __atomic_check_size((mem)); \ + __atomic_fetch_and ((mem), (operand), __ATOMIC_RELAXED); }) # define atomic_fetch_and_acquire(mem, operand) \ ({ __atomic_check_size((mem)); \ __atomic_fetch_and ((mem), (operand), __ATOMIC_ACQUIRE); }) +# define atomic_fetch_and_release(mem, operand) \ + ({ __atomic_check_size((mem)); \ + __atomic_fetch_and ((mem), (operand), __ATOMIC_RELEASE); }) # define atomic_fetch_or_relaxed(mem, operand) \ ({ __atomic_check_size((mem)); \ @@ -618,6 +627,13 @@ void __atomic_link_error (void); # define atomic_fetch_or_acquire(mem, operand) \ ({ __atomic_check_size((mem)); \ __atomic_fetch_or ((mem), (operand), __ATOMIC_ACQUIRE); }) +# define atomic_fetch_or_release(mem, operand) \ + ({ __atomic_check_size((mem)); \ + __atomic_fetch_or ((mem), (operand), __ATOMIC_RELEASE); }) + +# define atomic_fetch_xor_release(mem, operand) \ + ({ __atomic_check_size((mem)); \ + __atomic_fetch_xor ((mem), (operand), __ATOMIC_RELEASE); }) #else /* !USE_ATOMIC_COMPILER_BUILTINS */ @@ -684,6 +700,12 @@ void __atomic_link_error (void); *(expected) == __atg103_expected; }) # endif +/* XXX Fall back to acquire MO because archs do not define a weaker + atomic_exchange. */ +# ifndef atomic_exchange_relaxed +# define atomic_exchange_relaxed(mem, val) \ + atomic_exchange_acq ((mem), (val)) +# endif # ifndef atomic_exchange_acquire # define atomic_exchange_acquire(mem, val) \ atomic_exchange_acq ((mem), (val)) @@ -715,12 +737,24 @@ void __atomic_link_error (void); atomic_exchange_and_add_acq ((mem), (operand)); }) # endif +/* XXX Fall back to acquire MO because archs do not define a weaker + atomic_and_val. */ +# ifndef atomic_fetch_and_relaxed +# define atomic_fetch_and_relaxed(mem, operand) \ + atomic_fetch_and_acquire ((mem), (operand)) +# endif /* XXX The default for atomic_and_val has acquire semantics, but this is not documented. */ # ifndef atomic_fetch_and_acquire # define atomic_fetch_and_acquire(mem, operand) \ atomic_and_val ((mem), (operand)) # endif +# ifndef atomic_fetch_and_release +/* XXX This unnecessarily has acquire MO. */ +# define atomic_fetch_and_release(mem, operand) \ + ({ atomic_thread_fence_release (); \ + atomic_and_val ((mem), (operand)); }) +# endif /* XXX The default for atomic_or_val has acquire semantics, but this is not documented. */ @@ -734,6 +768,28 @@ void __atomic_link_error (void); # define atomic_fetch_or_relaxed(mem, operand) \ atomic_fetch_or_acquire ((mem), (operand)) # endif +/* XXX Contains an unnecessary acquire MO because archs do not define a weaker + atomic_or_val. */ +# ifndef atomic_fetch_or_release +# define atomic_fetch_or_release(mem, operand) \ + ({ atomic_thread_fence_release (); \ + atomic_fetch_or_acquire ((mem), (operand)); }) +# endif + +# ifndef atomic_fetch_xor_release +# define atomic_fetch_xor_release(mem, operand) \ + ({ __typeof (*(mem)) __atg104_old; \ + __typeof (mem) __atg104_memp = (mem); \ + __typeof (*(mem)) __atg104_op = (operand); \ + \ + do \ + __atg104_old = (*__atg104_memp); \ + while (__builtin_expect \ + (atomic_compare_and_exchange_bool_rel ( \ + __atg104_memp, __atg104_old ^ __atg104_op, __atg104_old), 0));\ + \ + __atg104_old; }) +#endif #endif /* !USE_ATOMIC_COMPILER_BUILTINS */ diff --git a/include/features.h b/include/features.h index 9514d35..650d4c5 100644 --- a/include/features.h +++ b/include/features.h @@ -24,6 +24,10 @@ __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. + __STDC_WANT_LIB_EXT2__ Extensions to ISO C99 from TR 27431-2:2010. + __STDC_WANT_IEC_60559_BFP_EXT__ Extensions to ISO C11 from TS 18661-1:2014. + __STDC_WANT_IEC_60559_FUNCS_EXT__ Extensions to ISO C11 from + TS 18661-4:2015. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993; @@ -58,6 +62,10 @@ These are defined by this file and are used by the header files to decide what to declare or define: + __GLIBC_USE (F) Define things from feature set F. This is defined + to 1 or 0; the subsequent macros are either defined + or undefined, and those tests should be moved to + __GLIBC_USE. __USE_ISOC11 Define ISO C11 things. __USE_ISOC99 Define ISO C99 things. __USE_ISOC95 Define ISO C90 AMD1 (C95) things. @@ -90,7 +98,14 @@ explicitly undefined if they are not explicitly defined. Feature-test macros that are not defined by the user or compiler but are implied by the other feature-test macros defined (or by the - lack of any definitions) are defined by the file. */ + lack of any definitions) are defined by the file. + + ISO C feature test macros depend on the definition of the macro + when an affected header is included, not when the first system + header is included, and so they are handled in + <bits/libc-header-start.h>, which does not have a multiple include + guard. Feature test macros that can be handled from the first + system header included are handled here. */ /* Undefine everything, so we get a clean slate. */ @@ -125,13 +140,13 @@ # define __KERNEL_STRICT_NAMES #endif -/* Convenience macros to test the versions of glibc and gcc. - Use them like this: +/* Convenience macro to test the version of gcc. + Use like this: #if __GNUC_PREREQ (2,8) ... code requiring gcc 2.8 or later ... #endif - Note - they won't work for gcc1 or glibc1, since the _MINOR macros - were not defined then. */ + Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was + added in 2.0. */ #if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) @@ -139,6 +154,20 @@ # define __GNUC_PREREQ(maj, min) 0 #endif +/* Similarly for clang. Features added to GCC after version 4.2 may + or may not also be available in clang, and clang's definitions of + __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such + features can be queried via __has_extension/__has_feature. */ +#if defined __clang_major__ && defined __clang_minor__ +# define __glibc_clang_prereq(maj, min) \ + ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) +#else +# define __glibc_clang_prereq(maj, min) 0 +#endif + +/* Whether to use feature set F. */ +#define __GLIBC_USE(F) __GLIBC_USE_ ## F + /* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not issue a warning; the expectation is that the source is being @@ -357,7 +386,7 @@ /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ #define __GLIBC__ 2 -#define __GLIBC_MINOR__ 23 +#define __GLIBC_MINOR__ 24 #define __GLIBC_PREREQ(maj, min) \ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 4548e09..c2b499a 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -282,19 +282,28 @@ for linking") past the last element in SET. */ #define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set) +/* Use symbol_version_reference to specify the version a symbol + reference should link to. Use symbol_version or + default_symbol_version for the definition of a versioned symbol. + The difference is that the latter is a no-op in non-shared + builds. */ +#ifdef __ASSEMBLER__ +# define symbol_version_reference(real, name, version) \ + .symver real, name##@##version +#else /* !__ASSEMBLER__ */ +# define symbol_version_reference(real, name, version) \ + __asm__ (".symver " #real "," #name "@" #version) +#endif + #ifdef SHARED # define symbol_version(real, name, version) \ - _symbol_version(real, name, version) + symbol_version_reference(real, name, version) # define default_symbol_version(real, name, version) \ _default_symbol_version(real, name, version) # ifdef __ASSEMBLER__ -# define _symbol_version(real, name, version) \ - .symver real, name##@##version # define _default_symbol_version(real, name, version) \ .symver real, name##@##@##version # else -# define _symbol_version(real, name, version) \ - __asm__ (".symver " #real "," #name "@" #version) # define _default_symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@@" #version) # endif diff --git a/include/shlib-compat.h b/include/shlib-compat.h index c1c5e2c..025c731 100644 --- a/include/shlib-compat.h +++ b/include/shlib-compat.h @@ -19,10 +19,10 @@ #ifndef _SHLIB_COMPAT_H #define _SHLIB_COMPAT_H 1 -#ifdef SHARED - # include <abi-versions.h> +#ifdef SHARED + /* The file abi-versions.h (generated by scripts/abi-versions.awk) defines symbols like `ABI_libm_GLIBC_2_0' for each version set in the source code for each library. For a version set that is subsumed by a later @@ -62,11 +62,7 @@ default_symbol_version (local, symbol, name) # define compat_symbol(lib, local, symbol, version) \ - compat_symbol_1 (lib, local, symbol, version) -# define compat_symbol_1(lib, local, symbol, version) \ - compat_symbol_2 (local, symbol, VERSION_##lib##_##version) -# define compat_symbol_2(local, symbol, name) \ - symbol_version (local, symbol, name) + compat_symbol_reference (lib, local, symbol, version) #else @@ -82,6 +78,14 @@ #endif +/* Use compat_symbol_reference for a reference to a specific version + of a symbol. Use compat_symbol to define such a symbol. */ +#define compat_symbol_reference(lib, local, symbol, version) \ + compat_symbol_reference_1 (lib, local, symbol, version) +#define compat_symbol_reference_1(lib, local, symbol, version) \ + compat_symbol_reference_2 (local, symbol, VERSION_##lib##_##version) +#define compat_symbol_reference_2(local, symbol, name) \ + symbol_version_reference (local, symbol, name) # ifdef LINK_OBSOLETE_RPC /* Export the symbol for both static and dynamic linking. */ diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h new file mode 100644 index 0000000..87813c5 --- /dev/null +++ b/include/sys/sysmacros.h @@ -0,0 +1 @@ +#include <misc/sys/sysmacros.h> diff --git a/libio/iofopncook.c b/libio/iofopncook.c index ae5df17..0d05fe6 100644 --- a/libio/iofopncook.c +++ b/libio/iofopncook.c @@ -44,7 +44,9 @@ _IO_cookie_read (_IO_FILE *fp, void *buf, _IO_ssize_t size) { struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; cookie_read_function_t *read_cb = cfile->__io_functions.read; +#ifdef PTR_DEMANGLE PTR_DEMANGLE (read_cb); +#endif if (read_cb == NULL) return -1; @@ -57,7 +59,9 @@ _IO_cookie_write (_IO_FILE *fp, const void *buf, _IO_ssize_t size) { struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; cookie_write_function_t *write_cb = cfile->__io_functions.write; +#ifdef PTR_DEMANGLE PTR_DEMANGLE (write_cb); +#endif if (write_cb == NULL) { @@ -77,7 +81,9 @@ _IO_cookie_seek (_IO_FILE *fp, _IO_off64_t offset, int dir) { struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; cookie_seek_function_t *seek_cb = cfile->__io_functions.seek; +#ifdef PTR_DEMANGLE PTR_DEMANGLE (seek_cb); +#endif return ((seek_cb == NULL || (seek_cb (cfile->__cookie, &offset, dir) @@ -91,7 +97,9 @@ _IO_cookie_close (_IO_FILE *fp) { struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; cookie_close_function_t *close_cb = cfile->__io_functions.close; +#ifdef PTR_DEMANGLE PTR_DEMANGLE (close_cb); +#endif if (close_cb == NULL) return 0; @@ -140,10 +148,12 @@ static void set_callbacks (_IO_cookie_io_functions_t *target, _IO_cookie_io_functions_t source) { +#ifdef PTR_MANGLE PTR_MANGLE (source.read); PTR_MANGLE (source.write); PTR_MANGLE (source.seek); PTR_MANGLE (source.close); +#endif *target = source; } @@ -228,7 +238,9 @@ _IO_old_cookie_seek (_IO_FILE *fp, _IO_off64_t offset, int dir) struct _IO_cookie_file *cfile = (struct _IO_cookie_file *) fp; int (*seek_cb) (_IO_FILE *, _IO_off_t, int) = (int (*) (_IO_FILE *, _IO_off_t, int)) cfile->__io_functions.seek;; +#ifdef PTR_DEMANGLE PTR_DEMANGLE (seek_cb); +#endif if (seek_cb == NULL) return _IO_pos_BAD; diff --git a/libio/libioP.h b/libio/libioP.h index 54dc35c..3e12876 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -906,7 +906,9 @@ extern void (*IO_accept_foreign_vtables) (void) attribute_hidden; static inline void IO_set_accept_foreign_vtables (void (*flag) (void)) { +#ifdef PTR_MANGLE PTR_MANGLE (flag); +#endif atomic_store_relaxed (&IO_accept_foreign_vtables, flag); } diff --git a/libio/stdio.h b/libio/stdio.h index 4511c3c..e37f901 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -24,7 +24,8 @@ #if !defined __need_FILE && !defined __need___FILE # define _STDIO_H 1 -# include <features.h> +# define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +# include <bits/libc-header-start.h> __BEGIN_DECLS @@ -316,7 +317,7 @@ extern FILE *fopencookie (void *__restrict __magic_cookie, _IO_cookie_io_functions_t __io_funcs) __THROW __wur; #endif -#ifdef __USE_XOPEN2K8 +#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) /* Create a new stream that refers to a memory buffer. */ extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) __THROW __wur; @@ -395,7 +396,7 @@ extern int vsnprintf (char *__restrict __s, size_t __maxlen, __END_NAMESPACE_C99 #endif -#ifdef __USE_GNU +#if __GLIBC_USE (LIB_EXT2) /* Write formatted output to a string dynamically allocated with `malloc'. Store the address of the string in *PTR. */ extern int vasprintf (char **__restrict __ptr, const char *__restrict __f, @@ -653,7 +654,7 @@ extern char *fgets_unlocked (char *__restrict __s, int __n, #endif -#ifdef __USE_XOPEN2K8 +#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) /* Read up to (and including) a DELIMITER from STREAM into *LINEPTR (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as diff --git a/libio/vtables.c b/libio/vtables.c index e364ea0..b361f44 100644 --- a/libio/vtables.c +++ b/libio/vtables.c @@ -41,7 +41,9 @@ _IO_vtable_check (void) #ifdef SHARED /* Honor the compatibility flag. */ void (*flag) (void) = atomic_load_relaxed (&IO_accept_foreign_vtables); +#ifdef PTR_DEMANGLE PTR_DEMANGLE (flag); +#endif if (flag == &_IO_vtable_check) return; diff --git a/localedata/ChangeLog b/localedata/ChangeLog index b935e7d..9aedf51 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,27 @@ +2016-08-10 Martin Pitt <martin.pitt@ubuntu.com> + + [BZ #9842] + * locales/en_CA (d_fmt): Change to %Y-%m-%d. + +2016-08-10 Mike Frysinger <vapier@gentoo.org> + + * charmaps/CP10007: Change M$ to Microsoft. + +2016-07-07 Aurelien Jarno <aurelien@aurel32.net> + + * locales/de_LI (postal_fmt): Fix indentation. + (country_name): Likewise. + +2016-07-06 Aurelien Jarno <aurelien@aurel32.net> + + * locales/de_LI: New locale. + * SUPPORTED: Add de_LI. + +2016-07-04 Gunnar Hjalmarsson <gunnarhj@ubuntu.com> + + [BZ #20316] + * locales/id_ID (abmon, mon): Change "Peb" to "Feb". + 2016-06-16 Simion Onea <simionea@gmail.com> [BZ #18911] diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED index 965e2b8..843ce78 100644 --- a/localedata/SUPPORTED +++ b/localedata/SUPPORTED @@ -109,6 +109,7 @@ de_DE/ISO-8859-1 \ de_DE@euro/ISO-8859-15 \ de_IT.UTF-8/UTF-8 \ de_IT/ISO-8859-1 \ +de_LI.UTF-8/UTF-8 \ de_LU.UTF-8/UTF-8 \ de_LU/ISO-8859-1 \ de_LU@euro/ISO-8859-15 \ diff --git a/localedata/charmaps/CP10007 b/localedata/charmaps/CP10007 index ed674ca..ceacdbd 100644 --- a/localedata/charmaps/CP10007 +++ b/localedata/charmaps/CP10007 @@ -2,7 +2,7 @@ <comment_char> % <escape_char> / -% This is the old MacCyrillic which M$ keeps around as CP10007. +% This is the old MacCyrillic which Microsoft keeps around as CP10007. CHARMAP <U0000> /x00 NULL <U0001> /x01 START OF HEADING diff --git a/localedata/locales/de_LI b/localedata/locales/de_LI new file mode 100644 index 0000000..663f788 --- /dev/null +++ b/localedata/locales/de_LI @@ -0,0 +1,98 @@ +comment_char % +escape_char / + +% This file is part of the GNU C Library and contains locale data. +% The Free Software Foundation does not claim any copyright interest +% in the locale data contained in this file. The foregoing does not +% affect the license of the GNU C Library as a whole. It does not +% exempt you from the conditions of the license if your use would +% otherwise be governed by that license. + +% German Language Locale for Liechtenstein + +LC_IDENTIFICATION +title "German locale for Liechtenstein" +source "" +address "" +contact "" +email "bug-glibc-locales@gnu.org" +tel "" +fax "" +language "German" +territory "Liechtenstein" +revision "1.0" +date "2007-11-27" +% +category "i18n:2012";LC_IDENTIFICATION +category "i18n:2012";LC_CTYPE +category "i18n:2012";LC_COLLATE +category "i18n:2012";LC_TIME +category "i18n:2012";LC_NUMERIC +category "i18n:2012";LC_MONETARY +category "i18n:2012";LC_MESSAGES +category "i18n:2012";LC_PAPER +category "i18n:2012";LC_NAME +category "i18n:2012";LC_ADDRESS +category "i18n:2012";LC_TELEPHONE +END LC_IDENTIFICATION + +LC_CTYPE +copy "de_CH" +END LC_CTYPE + +LC_COLLATE +copy "de_CH" +END LC_COLLATE + +LC_MESSAGES +copy "de_CH" +END LC_MESSAGES + +LC_MONETARY +copy "de_CH" +END LC_MONETARY + +LC_NUMERIC +copy "de_CH" +END LC_NUMERIC + +LC_TIME +copy "de_CH" +END LC_TIME + +LC_PAPER +copy "de_CH" +END LC_PAPER + +LC_TELEPHONE +% same as i18n +tel_int_fmt "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025><U006C>" +int_prefix "<U0034><U0032><U0033>" +END LC_TELEPHONE + +LC_MEASUREMENT +copy "de_CH" +END LC_MEASUREMENT + +LC_NAME +copy "de_CH" +END LC_NAME + +LC_ADDRESS +postal_fmt "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/ +<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/ +<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/ +<U004E><U0025><U0025><U007A><U0020><U0025><U0054><U0025>/ +<U004E><U0025><U0063><U0025><U004E>" +country_name "<U004C><U0069><U0065><U0063><U0068><U0074><U0065><U006E><U0073><U0074>/ +<U0065><U0069><U006E>" +country_ab2 "<U004C><U0049>" +country_ab3 "<U004C><U0049><U0045>" +country_num 438 +country_car "<U0046><U004C>" +country_post "<U004C><U0049>" +lang_name "<U0044><U0065><U0075><U0074><U0073><U0063><U0068>" +lang_ab "<U0064><U0065>" +lang_term "<U0064><U0065><U0075>" +lang_lib "<U0067><U0065><U0072>" +END LC_ADDRESS diff --git a/localedata/locales/en_CA b/localedata/locales/en_CA index 8206765..cd97137 100644 --- a/localedata/locales/en_CA +++ b/localedata/locales/en_CA @@ -129,7 +129,7 @@ mon "<U004A><U0061><U006E><U0075><U0061><U0072><U0079>";/ "<U004E><U006F><U0076><U0065><U006D><U0062><U0065><U0072>";/ "<U0044><U0065><U0063><U0065><U006D><U0062><U0065><U0072>" d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0072><U0020><U0025><U005A>" -d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>" +d_fmt "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064>" t_fmt "<U0025><U0072>" am_pm "<U0041><U004D>";"<U0050><U004D>" t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>" diff --git a/localedata/locales/id_ID b/localedata/locales/id_ID index 53ce462..ef0010f 100644 --- a/localedata/locales/id_ID +++ b/localedata/locales/id_ID @@ -98,14 +98,14 @@ day "<U004D><U0069><U006E><U0067><U0067><U0075>";/ "<U004B><U0061><U006D><U0069><U0073>";/ "<U004A><U0075><U006D><U0061><U0074>";/ "<U0053><U0061><U0062><U0074><U0075>" -abmon "<U004A><U0061><U006E>";"<U0050><U0065><U0062>";/ +abmon "<U004A><U0061><U006E>";"<U0046><U0065><U0062>";/ "<U004D><U0061><U0072>";"<U0041><U0070><U0072>";/ "<U004D><U0065><U0069>";"<U004A><U0075><U006E>";/ "<U004A><U0075><U006C>";"<U0041><U0067><U0075>";/ "<U0053><U0065><U0070>";"<U004F><U006B><U0074>";/ "<U004E><U006F><U0076>";"<U0044><U0065><U0073>" mon "<U004A><U0061><U006E><U0075><U0061><U0072><U0069>";/ - "<U0050><U0065><U0062><U0072><U0075><U0061><U0072><U0069>";/ + "<U0046><U0065><U0062><U0072><U0075><U0061><U0072><U0069>";/ "<U004D><U0061><U0072><U0065><U0074>";/ "<U0041><U0070><U0072><U0069><U006C>";/ "<U004D><U0065><U0069>";/ diff --git a/malloc/Makefile b/malloc/Makefile index 5fa4ba5..761a976 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -185,3 +185,7 @@ $(objpfx)libmemusage.so: $(libdl) # Extra dependencies $(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c + +# Compile the tests with a flag which suppresses the mallopt call in +# the test skeleton. +$(tests:%=$(objpfx)%.o): CPPFLAGS += -DTEST_NO_MALLOPT diff --git a/malloc/arena.c b/malloc/arena.c index 8c057ea..6c23c8e 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -716,8 +716,7 @@ _int_new_arena (size_t size) } -/* Remove an arena from free_list. The arena may be in use because it - was attached concurrently to a thread by reused_arena below. */ +/* Remove an arena from free_list. */ static mstate get_free_list (void) { @@ -732,7 +731,8 @@ get_free_list (void) free_list = result->next_free; /* The arena will be attached to this thread. */ - ++result->attached_threads; + assert (result->attached_threads == 0); + result->attached_threads = 1; detach_arena (replaced_arena); } @@ -749,6 +749,26 @@ get_free_list (void) return result; } +/* Remove the arena from the free list (if it is present). + free_list_lock must have been acquired by the caller. */ +static void +remove_from_free_list (mstate arena) +{ + mstate *previous = &free_list; + for (mstate p = free_list; p != NULL; p = p->next_free) + { + assert (p->attached_threads == 0); + if (p == arena) + { + /* Remove the requested arena from the list. */ + *previous = p->next_free; + break; + } + else + previous = &p->next_free; + } +} + /* Lock and return an arena that can be reused for memory allocation. Avoid AVOID_ARENA as we have already failed to allocate memory in it and it is currently locked. */ @@ -796,14 +816,25 @@ reused_arena (mstate avoid_arena) (void) mutex_lock (&result->mutex); out: - /* Attach the arena to the current thread. Note that we may have - selected an arena which was on free_list. */ + /* Attach the arena to the current thread. */ { /* Update the arena thread attachment counters. */ mstate replaced_arena = thread_arena; (void) mutex_lock (&free_list_lock); detach_arena (replaced_arena); + + /* We may have picked up an arena on the free list. We need to + preserve the invariant that no arena on the free list has a + positive attached_threads counter (otherwise, + arena_thread_freeres cannot use the counter to determine if the + arena needs to be put on the free list). We unconditionally + remove the selected arena from the free list. The caller of + reused_arena checked the free list and observed it to be empty, + so the list is very short. */ + remove_from_free_list (result); + ++result->attached_threads; + (void) mutex_unlock (&free_list_lock); } diff --git a/malloc/malloc-internal.h b/malloc/malloc-internal.h index 98afd14..a3df8c3 100644 --- a/malloc/malloc-internal.h +++ b/malloc/malloc-internal.h @@ -19,6 +19,59 @@ #ifndef _MALLOC_INTERNAL_H #define _MALLOC_INTERNAL_H +#include <malloc-machine.h> +#include <malloc-sysdep.h> + +/* INTERNAL_SIZE_T is the word-size used for internal bookkeeping of + chunk sizes. + + The default version is the same as size_t. + + While not strictly necessary, it is best to define this as an + unsigned type, even if size_t is a signed type. This may avoid some + artificial size limitations on some systems. + + On a 64-bit machine, you may be able to reduce malloc overhead by + defining INTERNAL_SIZE_T to be a 32 bit `unsigned int' at the + expense of not being able to handle more than 2^32 of malloced + space. If this limitation is acceptable, you are encouraged to set + this unless you are on a platform requiring 16byte alignments. In + this case the alignment requirements turn out to negate any + potential advantages of decreasing size_t word size. + + Implementors: Beware of the possible combinations of: + - INTERNAL_SIZE_T might be signed or unsigned, might be 32 or 64 bits, + and might be the same width as int or as long + - size_t might have different width and signedness as INTERNAL_SIZE_T + - int and long might be 32 or 64 bits, and might be the same width + + To deal with this, most comparisons and difference computations + among INTERNAL_SIZE_Ts should cast them to unsigned long, being + aware of the fact that casting an unsigned int to a wider long does + not sign-extend. (This also makes checking for negative numbers + awkward.) Some of these casts result in harmless compiler warnings + on some systems. */ +#ifndef INTERNAL_SIZE_T +# define INTERNAL_SIZE_T size_t +#endif + +/* The corresponding word size. */ +#define SIZE_SZ (sizeof (INTERNAL_SIZE_T)) + +/* MALLOC_ALIGNMENT is the minimum alignment for malloc'ed chunks. It + must be a power of two at least 2 * SIZE_SZ, even on machines for + which smaller alignments would suffice. It may be defined as larger + than this though. Note however that code and data structures are + optimized for the case of 8-byte alignment. */ +#ifndef MALLOC_ALIGNMENT +# define MALLOC_ALIGNMENT (2 * SIZE_SZ < __alignof__ (long double) \ + ? __alignof__ (long double) : 2 * SIZE_SZ) +#endif + +/* The corresponding bit mask value. */ +#define MALLOC_ALIGN_MASK (MALLOC_ALIGNMENT - 1) + + /* Called in the parent process before a fork. */ void __malloc_fork_lock_parent (void) internal_function attribute_hidden; diff --git a/malloc/malloc.c b/malloc/malloc.c index 7c090aa..1fa9487 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -173,8 +173,6 @@ Changing default word sizes: INTERNAL_SIZE_T size_t - MALLOC_ALIGNMENT MAX (2 * sizeof(INTERNAL_SIZE_T), - __alignof__ (long double)) Configuration and functionality options: @@ -216,9 +214,6 @@ #include <stdlib.h> /* for getenv(), abort() */ #include <unistd.h> /* for __libc_enable_secure */ -#include <malloc-machine.h> -#include <malloc-sysdep.h> - #include <atomic.h> #include <_itoa.h> #include <bits/wordsize.h> @@ -340,64 +335,6 @@ _m_printf(const char *fmt, ...) #endif /* - INTERNAL_SIZE_T is the word-size used for internal bookkeeping - of chunk sizes. - - The default version is the same as size_t. - - While not strictly necessary, it is best to define this as an - unsigned type, even if size_t is a signed type. This may avoid some - artificial size limitations on some systems. - - On a 64-bit machine, you may be able to reduce malloc overhead by - defining INTERNAL_SIZE_T to be a 32 bit `unsigned int' at the - expense of not being able to handle more than 2^32 of malloced - space. If this limitation is acceptable, you are encouraged to set - this unless you are on a platform requiring 16byte alignments. In - this case the alignment requirements turn out to negate any - potential advantages of decreasing size_t word size. - - Implementors: Beware of the possible combinations of: - - INTERNAL_SIZE_T might be signed or unsigned, might be 32 or 64 bits, - and might be the same width as int or as long - - size_t might have different width and signedness as INTERNAL_SIZE_T - - int and long might be 32 or 64 bits, and might be the same width - To deal with this, most comparisons and difference computations - among INTERNAL_SIZE_Ts should cast them to unsigned long, being - aware of the fact that casting an unsigned int to a wider long does - not sign-extend. (This also makes checking for negative numbers - awkward.) Some of these casts result in harmless compiler warnings - on some systems. -*/ - -#ifndef INTERNAL_SIZE_T -#define INTERNAL_SIZE_T size_t -#endif - -/* The corresponding word size */ -#define SIZE_SZ (sizeof(INTERNAL_SIZE_T)) - - -/* - MALLOC_ALIGNMENT is the minimum alignment for malloc'ed chunks. - It must be a power of two at least 2 * SIZE_SZ, even on machines - for which smaller alignments would suffice. It may be defined as - larger than this though. Note however that code and data structures - are optimized for the case of 8-byte alignment. -*/ - - -#ifndef MALLOC_ALIGNMENT -# define MALLOC_ALIGNMENT (2 * SIZE_SZ < __alignof__ (long double) \ - ? __alignof__ (long double) : 2 * SIZE_SZ) -#endif - -/* The corresponding bit mask value */ -#define MALLOC_ALIGN_MASK (MALLOC_ALIGNMENT - 1) - - - -/* REALLOC_ZERO_BYTES_FREES should be set if a call to realloc with zero bytes should be the same as a call to free. This is required by the C standard. Otherwise, since this malloc diff --git a/malloc/tst-malloc-thread-fail.c b/malloc/tst-malloc-thread-fail.c index fc090ef..fca0eb8 100644 --- a/malloc/tst-malloc-thread-fail.c +++ b/malloc/tst-malloc-thread-fail.c @@ -436,7 +436,7 @@ do_test (void) } /* The repeated allocations take some time on slow machines. */ -#define TIMEOUT 20 +#define TIMEOUT 30 #define TEST_FUNCTION do_test () #include "../test-skeleton.c" diff --git a/manual/arith.texi b/manual/arith.texi index f54b1ec..ea8ff48 100644 --- a/manual/arith.texi +++ b/manual/arith.texi @@ -397,12 +397,11 @@ to @end deftypefn @comment math.h -@comment GNU +@comment ISO @deftypefn {Macro} int issignaling (@emph{float-type} @var{x}) @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} This macro returns a nonzero value if @var{x} is a signaling NaN -(sNaN). It is based on draft TS 18661 and currently enabled as a GNU -extension. +(sNaN). It is from TS 18661-1:2014. @end deftypefn Another set of floating-point classification functions was provided by @@ -1703,13 +1702,13 @@ double}. @end deftypefun @comment math.h -@comment GNU +@comment ISO @deftypefun double nextup (double @var{x}) @comment math.h -@comment GNU +@comment ISO @deftypefunx float nextupf (float @var{x}) @comment math.h -@comment GNU +@comment ISO @deftypefunx {long double} nextupl (long double @var{x}) @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{nextup} function returns the next representable neighbor of @var{x} @@ -1718,18 +1717,18 @@ subnormal number in the type of @var{x} the function returns @code{-0}. If @math{@var{x} = @code{0}} the function returns the smallest positive subnormal number in the type of @var{x}. If @var{x} is NaN, NaN is returned. If @var{x} is @math{+@infinity{}}, @math{+@infinity{}} is returned. -@code{nextup} is based on TS 18661 and currently enabled as a GNU extension. +@code{nextup} is from TS 18661-1:2014. @code{nextup} never raises an exception except for signaling NaNs. @end deftypefun @comment math.h -@comment GNU +@comment ISO @deftypefun double nextdown (double @var{x}) @comment math.h -@comment GNU +@comment ISO @deftypefunx float nextdownf (float @var{x}) @comment math.h -@comment GNU +@comment ISO @deftypefunx {long double} nextdownl (long double @var{x}) @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{nextdown} function returns the next representable neighbor of @var{x} @@ -1738,7 +1737,7 @@ subnormal number in the type of @var{x} the function returns @code{+0}. If @math{@var{x} = @code{0}} the function returns the smallest negative subnormal number in the type of @var{x}. If @var{x} is NaN, NaN is returned. If @var{x} is @math{-@infinity{}}, @math{-@infinity{}} is returned. -@code{nextdown} is based on TS 18661 and currently enabled as a GNU extension. +@code{nextdown} is from TS 18661-1:2014. @code{nextdown} never raises an exception except for signaling NaNs. @end deftypefun diff --git a/manual/creature.texi b/manual/creature.texi index 3c68616..257f871 100644 --- a/manual/creature.texi +++ b/manual/creature.texi @@ -166,6 +166,32 @@ macro @code{_ISOC99_SOURCE} should be defined. @end defvr @comment (none) +@comment ISO +@defvr Macro __STDC_WANT_LIB_EXT2__ +If you define this macro to the value @code{1}, features from ISO/IEC +TR 24731-2:2010 (Dynamic Allocation Functions) are enabled. Only some +of the features from this TR are supported by @theglibc{}. +@end defvr + +@comment (none) +@comment ISO +@defvr Macro __STDC_WANT_IEC_60559_BFP_EXT__ +If you define this macro, features from ISO/IEC TS 18661-1:2014 +(Floating-point extensions for C: Binary floating-point arithmetic) +are enabled. Only some of the features from this TS are supported by +@theglibc{}. +@end defvr + +@comment (none) +@comment ISO +@defvr Macro __STDC_WANT_IEC_60559_FUNCS_EXT__ +If you define this macro, features from ISO/IEC TS 18661-4:2015 +(Floating-point extensions for C: Supplementary functions) are +enabled. Only some of the features from this TS are supported by +@theglibc{}. +@end defvr + +@comment (none) @comment GNU @defvr Macro _GNU_SOURCE If you define this macro, everything is included: @w{ISO C89}, @w{ISO diff --git a/manual/math.texi b/manual/math.texi index 5c9f7b9..d689820 100644 --- a/manual/math.texi +++ b/manual/math.texi @@ -480,13 +480,13 @@ Mathematically, @code{exp2 (x)} is the same as @code{exp (x * log (2))}. @end deftypefun @comment math.h -@comment GNU +@comment ISO @deftypefun double exp10 (double @var{x}) @comment math.h -@comment GNU +@comment ISO @deftypefunx float exp10f (float @var{x}) @comment math.h -@comment GNU +@comment ISO @deftypefunx {long double} exp10l (long double @var{x}) @comment math.h @comment GNU @@ -501,7 +501,8 @@ Mathematically, @code{exp2 (x)} is the same as @code{exp (x * log (2))}. These functions compute @code{10} raised to the power @var{x}. Mathematically, @code{exp10 (x)} is the same as @code{exp (x * log (10))}. -These functions are GNU extensions. The name @code{exp10} is +The @code{exp10} functions are from TS 18661-4:2015; the @code{pow10} +names are GNU extensions. The name @code{exp10} is preferred, since it is analogous to @code{exp} and @code{exp2}. @end deftypefun diff --git a/math/Makefile b/math/Makefile index 4f14181..1da1797 100644 --- a/math/Makefile +++ b/math/Makefile @@ -42,50 +42,81 @@ libm-support = s_lib_version s_matherr s_signgam \ ftestexcept fegetround fesetround fegetenv feholdexcpt \ fesetenv feupdateenv t_exp fedisblxcpt feenablxcpt \ fegetexcept -libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \ - e_hypot e_j0 e_j1 e_jn e_lgamma_r e_log e_log10 e_pow \ - e_rem_pio2 e_remainder e_scalb e_sinh e_sqrt e_gamma_r \ - e_ilogb \ - k_cos k_rem_pio2 k_sin k_tan s_asinh s_atan s_cbrt \ - s_ceil s_cos s_erf s_expm1 s_fabs \ - s_floor s_log1p w_log1p s_logb \ - s_nextafter s_nexttoward s_rint s_scalbln w_scalbln \ - s_significand s_sin s_tan s_tanh w_acos w_acosh w_asin \ - w_atan2 w_atanh w_cosh w_exp w_exp2 w_exp10 w_fmod \ - w_tgamma w_hypot w_j0 w_j1 w_jn w_lgamma w_lgamma_r \ - w_log w_log10 w_pow w_remainder w_scalb w_sinh w_sqrt \ - w_ilogb \ - s_fpclassify s_fmax s_fmin s_fdim s_nan s_trunc \ - s_remquo e_log2 e_exp2 s_round s_nearbyint s_sincos \ - conj cimag creal cabs carg s_cexp s_csinh s_ccosh s_clog \ - s_catan s_casin s_ccos s_csin s_ctan s_ctanh s_cacos \ - s_casinh s_cacosh s_catanh s_csqrt s_cpow s_cproj s_clog10 \ - s_fma s_lrint s_llrint s_lround s_llround e_exp10 w_log2 \ - s_issignaling $(calls:s_%=m_%) x2y2m1 k_casinh \ - gamma_product k_standard lgamma_neg lgamma_product \ - w_lgamma_compat s_nextup s_nextdown - -dbl-only-routines := branred doasin dosincos halfulp mpa mpatan2 \ - mpatan mpexp mplog mpsqrt mptan sincos32 slowexp \ - slowpow sincostab -libm-routines = $(strip $(libm-support) $(libm-calls) \ - $(patsubst %_rf,%f_r,$(libm-calls:=f)) \ - $(long-m-$(long-double-fcts))) \ - $(dbl-only-routines) -long-m-routines = $(patsubst %_rl,%l_r,$(libm-calls:=l)) -long-m-support = t_sincosl k_sincosl -long-m-yes = $(long-m-routines) $(long-m-support) + +libm-calls = \ + e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \ + e_hypotF e_j0F e_j1F e_jnF e_lgammaF_r e_logF e_log10F e_powF \ + e_rem_pio2F e_remainderF e_scalbF e_sinhF e_sqrtF e_gammaF_r \ + e_ilogbF \ + k_cosF k_rem_pio2F k_sinF k_tanF s_asinhF s_atanF s_cbrtF \ + s_ceilF s_cosF s_erfF s_expm1F s_fabsF \ + s_floorF s_log1pF w_log1pF s_logbF \ + s_nextafterF s_nexttowardF s_rintF s_scalblnF w_scalblnF \ + s_significandF s_sinF s_tanF s_tanhF w_acosF w_acoshF w_asinF \ + w_atan2F w_atanhF w_coshF w_expF w_exp2F w_exp10F w_fmodF \ + w_tgammaF w_hypotF w_j0F w_j1F w_jnF w_lgammaF w_lgammaF_r \ + w_logF w_log10F w_powF w_remainderF w_scalbF w_sinhF w_sqrtF \ + w_ilogbF \ + s_fpclassifyF s_fmaxF s_fminF s_fdimF s_nanF s_truncF \ + s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF \ + conjF cimagF crealF cabsF cargF s_cexpF s_csinhF s_ccoshF s_clogF \ + s_catanF s_casinF s_ccosF s_csinF s_ctanF s_ctanhF s_cacosF \ + s_casinhF s_cacoshF s_catanhF s_csqrtF s_cpowF s_cprojF s_clog10F \ + s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F w_log2F \ + s_issignalingF $(calls:s_%=m_%) x2y2m1F k_casinhF \ + gamma_productF lgamma_negF lgamma_productF \ + s_nextupF s_nextdownF + +libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl +libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \ + $(libm-compat-calls-ldouble-$(long-double-fcts)) + + +# Type specific routine support. +# +# The following three variables control what is included for each type: +# +# type-floatN-suffix = The suffix of the type +# type-floatN-routines = Type specific support objects +# type-floatN-yes = If the type is supported, evaluates to floatN +# +# Finally, note that types is an intentionally recursive variable. +# We only know the full set of supported types for the target machine +# after the Rules makefile has been parsed. +types = $(type-ldouble-$(long-double-fcts)) double float + +# long double support +type-ldouble-suffix := l +type-ldouble-routines := t_sincosl k_sincosl +type-ldouble-yes := ldouble + +# double support +type-double-suffix := +type-double-routines := branred doasin dosincos halfulp mpa mpatan2 \ + mpatan mpexp mplog mpsqrt mptan sincos32 slowexp \ + slowpow sincostab + +# float support +type-float-suffix := f +type-float-routines := + + +# Apply suffix to each type in arg 1 +type-foreach = $(foreach t,$(types),$(subst F,$(type-$(t)-suffix),$(1))) + +libm-routines = $(strip $(libm-support) $(libm-compat-calls) \ + $(call type-foreach, $(libm-calls)) \ + $(foreach t, $(types), $(type-$(t)-routines))) \ # These functions are in libc instead of libm because __printf_fp # calls them, so any program using printf will need them linked in, # and we don't want to have to link every program with -lm. # In libm-calls (above), list m_foo in place of s_foo for any # routine that should be compiled separately for its libc and libm versions. -calls = s_isinf s_isnan s_finite s_copysign s_modf s_scalbn s_frexp s_ldexp \ - s_signbit -generated += $(foreach s,.c .S l.c l.S f.c f.S,$(calls:s_%=m_%$s)) -routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts)) -long-c-yes = $(calls:=l) +calls = s_isinfF s_isnanF s_finiteF s_copysignF s_modfF s_scalbnF s_frexpF \ + s_ldexpF s_signbitF +generated += $(foreach s,.c .S,$(call type-foreach, $(calls:s_%=m_%$(s)))) +routines = $(call type-foreach, $(calls)) ifeq ($(build-mathvec),yes) # We need to install libm.so as linker script @@ -115,14 +146,11 @@ tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \ test-nearbyint-except-2 test-signgam-uchar test-signgam-uchar-init \ test-signgam-uint test-signgam-uint-init test-signgam-ullong \ test-signgam-ullong-init test-nan-overflow test-nan-payload \ - $(tests-static) + test-fexcept test-fexcept-traps $(tests-static) tests-static = test-fpucw-static test-fpucw-ieee-static \ test-signgam-uchar-static test-signgam-uchar-init-static \ test-signgam-uint-static test-signgam-uint-init-static \ test-signgam-ullong-static test-signgam-ullong-init-static -# We do the `long double' tests only if this data type is available and -# distinct from `double'. -test-longdouble-yes = test-ldouble test-ildoubl test-ldouble-finite ifneq (,$(CXX)) tests += test-math-isinff @@ -130,9 +158,10 @@ endif ifneq (no,$(PERL)) libm-vec-tests = $(addprefix test-,$(libmvec-tests)) -libm-tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \ - test-ifloat test-idouble test-float-finite test-double-finite \ - $(libm-vec-tests) + +libm-tests = $(foreach t,$(types),test-$(t) test-$(t)-finite test-i$(t)) \ + $(libm-vec-tests) + libm-tests.o = $(addsuffix .o,$(libm-tests)) tests += $(libm-tests) @@ -155,16 +184,6 @@ $(objpfx)libm-test.stmp: $(ulps-file) libm-test.inc gen-libm-test.pl \ $(PERL) gen-libm-test.pl -u $< -o "$(objpfx)" $(SHELL) gen-libm-have-vector-test.sh > $(objpfx)libm-have-vector-test.h @echo > $@ - -$(objpfx)test-float.o: $(objpfx)libm-test.stmp -$(objpfx)test-ifloat.o: $(objpfx)libm-test.stmp -$(objpfx)test-float-finite.o: $(objpfx)libm-test.stmp -$(objpfx)test-double.o: $(objpfx)libm-test.stmp -$(objpfx)test-idouble.o: $(objpfx)libm-test.stmp -$(objpfx)test-double-finite.o: $(objpfx)libm-test.stmp -$(objpfx)test-ldouble.o: $(objpfx)libm-test.stmp -$(objpfx)test-ildoubl.o: $(objpfx)libm-test.stmp -$(objpfx)test-ldouble-finite.o: $(objpfx)libm-test.stmp endif libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH @@ -216,7 +235,7 @@ CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES \ $(libm-test-fast-math-cflags) CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES \ $(libm-test-fast-math-cflags) -CPPFLAGS-test-ildoubl.c = -U__LIBC_INTERNAL_MATH_INLINES \ +CPPFLAGS-test-ildouble.c = -U__LIBC_INTERNAL_MATH_INLINES \ $(libm-test-fast-math-cflags) CFLAGS-test-signgam-finite.c = -ffinite-math-only @@ -247,7 +266,7 @@ include ../Rules ifneq (no,$(PERL)) # This must come after the inclusion of sysdeps Makefiles via Rules. -$(addprefix $(objpfx), $(addsuffix .o, $(libm-vec-tests))): $(objpfx)libm-test.stmp +$(addprefix $(objpfx), $(libm-tests.o)): $(objpfx)libm-test.stmp # Run the math programs to automatically generate ULPs files. .PHONY: regen-ulps diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index ffcc40a..51c152c 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -1144,6 +1144,7 @@ cos 0x4.7857dp+68 cos -0x1.02e34cp+0 cos 0xf.f0274p+4 cos 0x3.042d88p+0 +cos 0x1.8475e5afd4481p+0 cosh 0 cosh -0 @@ -3818,6 +3819,7 @@ sin min sin -min sin min_subnorm sin -min_subnorm +sin 0x1.8475e5afd4481p+0 sincos 0 sincos -0 @@ -3852,6 +3854,7 @@ sincos min sincos -min sincos min_subnorm sincos -min_subnorm +sincos 0x1.8475e5afd4481p+0 sinh 0 sinh -0 diff --git a/math/auto-libm-test-out b/math/auto-libm-test-out index c07978e..f727cf0 100644 --- a/math/auto-libm-test-out +++ b/math/auto-libm-test-out @@ -103416,6 +103416,75 @@ cos 0x3.042d88p+0 = cos tonearest ibm128 0x3.042d88p+0 : -0xf.dfe6f2169e24f276e8027d91bcp-4 : inexact-ok = cos towardzero ibm128 0x3.042d88p+0 : -0xf.dfe6f2169e24f276e8027d91b8p-4 : inexact-ok = cos upward ibm128 0x3.042d88p+0 : -0xf.dfe6f2169e24f276e8027d91b8p-4 : inexact-ok +cos 0x1.8475e5afd4481p+0 += cos downward binary32 0x1.8475e6p+0 : 0xd.a8263p-8 : inexact-ok += cos tonearest binary32 0x1.8475e6p+0 : 0xd.a8263p-8 : inexact-ok += cos towardzero binary32 0x1.8475e6p+0 : 0xd.a8263p-8 : inexact-ok += cos upward binary32 0x1.8475e6p+0 : 0xd.a8264p-8 : inexact-ok += cos downward binary64 0x1.8475e6p+0 : 0xd.a8263394be6dp-8 : inexact-ok += cos tonearest binary64 0x1.8475e6p+0 : 0xd.a8263394be6dp-8 : inexact-ok += cos towardzero binary64 0x1.8475e6p+0 : 0xd.a8263394be6dp-8 : inexact-ok += cos upward binary64 0x1.8475e6p+0 : 0xd.a8263394be6d8p-8 : inexact-ok += cos downward intel96 0x1.8475e6p+0 : 0xd.a8263394be6d0e5p-8 : inexact-ok += cos tonearest intel96 0x1.8475e6p+0 : 0xd.a8263394be6d0e6p-8 : inexact-ok += cos towardzero intel96 0x1.8475e6p+0 : 0xd.a8263394be6d0e5p-8 : inexact-ok += cos upward intel96 0x1.8475e6p+0 : 0xd.a8263394be6d0e6p-8 : inexact-ok += cos downward m68k96 0x1.8475e6p+0 : 0xd.a8263394be6d0e5p-8 : inexact-ok += cos tonearest m68k96 0x1.8475e6p+0 : 0xd.a8263394be6d0e6p-8 : inexact-ok += cos towardzero m68k96 0x1.8475e6p+0 : 0xd.a8263394be6d0e5p-8 : inexact-ok += cos upward m68k96 0x1.8475e6p+0 : 0xd.a8263394be6d0e6p-8 : inexact-ok += cos downward binary128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a3bap-8 : inexact-ok += cos tonearest binary128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a3bap-8 : inexact-ok += cos towardzero binary128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a3bap-8 : inexact-ok += cos upward binary128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a3ba8p-8 : inexact-ok += cos downward ibm128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a38p-8 : inexact-ok += cos tonearest ibm128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a3cp-8 : inexact-ok += cos towardzero ibm128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a38p-8 : inexact-ok += cos upward ibm128 0x1.8475e6p+0 : 0xd.a8263394be6d0e58c1c35a8a3cp-8 : inexact-ok += cos downward binary32 0x1.8475e4p+0 : 0xd.a8283p-8 : inexact-ok += cos tonearest binary32 0x1.8475e4p+0 : 0xd.a8283p-8 : inexact-ok += cos towardzero binary32 0x1.8475e4p+0 : 0xd.a8283p-8 : inexact-ok += cos upward binary32 0x1.8475e4p+0 : 0xd.a8284p-8 : inexact-ok += cos downward binary64 0x1.8475e4p+0 : 0xd.a82832da19f98p-8 : inexact-ok += cos tonearest binary64 0x1.8475e4p+0 : 0xd.a82832da19f98p-8 : inexact-ok += cos towardzero binary64 0x1.8475e4p+0 : 0xd.a82832da19f98p-8 : inexact-ok += cos upward binary64 0x1.8475e4p+0 : 0xd.a82832da19fap-8 : inexact-ok += cos downward intel96 0x1.8475e4p+0 : 0xd.a82832da19f9891p-8 : inexact-ok += cos tonearest intel96 0x1.8475e4p+0 : 0xd.a82832da19f9892p-8 : inexact-ok += cos towardzero intel96 0x1.8475e4p+0 : 0xd.a82832da19f9891p-8 : inexact-ok += cos upward intel96 0x1.8475e4p+0 : 0xd.a82832da19f9892p-8 : inexact-ok += cos downward m68k96 0x1.8475e4p+0 : 0xd.a82832da19f9891p-8 : inexact-ok += cos tonearest m68k96 0x1.8475e4p+0 : 0xd.a82832da19f9892p-8 : inexact-ok += cos towardzero m68k96 0x1.8475e4p+0 : 0xd.a82832da19f9891p-8 : inexact-ok += cos upward m68k96 0x1.8475e4p+0 : 0xd.a82832da19f9892p-8 : inexact-ok += cos downward binary128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa659ff8p-8 : inexact-ok += cos tonearest binary128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa659ff8p-8 : inexact-ok += cos towardzero binary128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa659ff8p-8 : inexact-ok += cos upward binary128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa65ap-8 : inexact-ok += cos downward ibm128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa659cp-8 : inexact-ok += cos tonearest ibm128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa65ap-8 : inexact-ok += cos towardzero ibm128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa659cp-8 : inexact-ok += cos upward ibm128 0x1.8475e4p+0 : 0xd.a82832da19f9891d9762fa65ap-8 : inexact-ok += cos downward binary64 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbe8p-8 : inexact-ok += cos tonearest binary64 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbe8p-8 : inexact-ok += cos towardzero binary64 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbe8p-8 : inexact-ok += cos upward binary64 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbfp-8 : inexact-ok += cos downward intel96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebffp-8 : inexact-ok += cos tonearest intel96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbecp-8 : inexact-ok += cos towardzero intel96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebffp-8 : inexact-ok += cos upward intel96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbecp-8 : inexact-ok += cos downward m68k96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebffp-8 : inexact-ok += cos tonearest m68k96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbecp-8 : inexact-ok += cos towardzero m68k96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebffp-8 : inexact-ok += cos upward m68k96 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbecp-8 : inexact-ok += cos downward binary128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa2966878p-8 : inexact-ok += cos tonearest binary128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa2966878p-8 : inexact-ok += cos towardzero binary128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa2966878p-8 : inexact-ok += cos upward binary128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa296688p-8 : inexact-ok += cos downward ibm128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa29668p-8 : inexact-ok += cos tonearest ibm128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa29668p-8 : inexact-ok += cos towardzero ibm128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa29668p-8 : inexact-ok += cos upward ibm128 0x1.8475e5afd4481p+0 : 0xd.a82683a33cbebfffffffa2966cp-8 : inexact-ok cosh 0 = cosh downward binary32 0x0p+0 : 0x1p+0 : inexact-ok = cosh tonearest binary32 0x0p+0 : 0x1p+0 : inexact-ok @@ -264628,6 +264697,75 @@ sin -min_subnorm = sin tonearest binary128 -0x4p-16496 : -0x4p-16496 : inexact-ok underflow errno-erange-ok = sin towardzero binary128 -0x4p-16496 : -0x0p+0 : inexact-ok underflow errno-erange-ok = sin upward binary128 -0x4p-16496 : -0x0p+0 : inexact-ok underflow errno-erange-ok +sin 0x1.8475e5afd4481p+0 += sin downward binary32 0x1.8475e6p+0 : 0xf.fa2adp-4 : inexact-ok += sin tonearest binary32 0x1.8475e6p+0 : 0xf.fa2aep-4 : inexact-ok += sin towardzero binary32 0x1.8475e6p+0 : 0xf.fa2adp-4 : inexact-ok += sin upward binary32 0x1.8475e6p+0 : 0xf.fa2aep-4 : inexact-ok += sin downward binary64 0x1.8475e6p+0 : 0xf.fa2add3e58948p-4 : inexact-ok += sin tonearest binary64 0x1.8475e6p+0 : 0xf.fa2add3e58948p-4 : inexact-ok += sin towardzero binary64 0x1.8475e6p+0 : 0xf.fa2add3e58948p-4 : inexact-ok += sin upward binary64 0x1.8475e6p+0 : 0xf.fa2add3e5895p-4 : inexact-ok += sin downward intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 : inexact-ok += sin tonearest intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 : inexact-ok += sin towardzero intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 : inexact-ok += sin upward intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d2p-4 : inexact-ok += sin downward m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 : inexact-ok += sin tonearest m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 : inexact-ok += sin towardzero m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 : inexact-ok += sin upward m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d2p-4 : inexact-ok += sin downward binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b5618p-4 : inexact-ok += sin tonearest binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b562p-4 : inexact-ok += sin towardzero binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b5618p-4 : inexact-ok += sin upward binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b562p-4 : inexact-ok += sin downward ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b54p-4 : inexact-ok += sin tonearest ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b58p-4 : inexact-ok += sin towardzero ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b54p-4 : inexact-ok += sin upward ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b58p-4 : inexact-ok += sin downward binary32 0x1.8475e4p+0 : 0xf.fa2adp-4 : inexact-ok += sin tonearest binary32 0x1.8475e4p+0 : 0xf.fa2aep-4 : inexact-ok += sin towardzero binary32 0x1.8475e4p+0 : 0xf.fa2adp-4 : inexact-ok += sin upward binary32 0x1.8475e4p+0 : 0xf.fa2aep-4 : inexact-ok += sin downward binary64 0x1.8475e4p+0 : 0xf.fa2adb8953aep-4 : inexact-ok += sin tonearest binary64 0x1.8475e4p+0 : 0xf.fa2adb8953aep-4 : inexact-ok += sin towardzero binary64 0x1.8475e4p+0 : 0xf.fa2adb8953aep-4 : inexact-ok += sin upward binary64 0x1.8475e4p+0 : 0xf.fa2adb8953ae8p-4 : inexact-ok += sin downward intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 : inexact-ok += sin tonearest intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 : inexact-ok += sin towardzero intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 : inexact-ok += sin upward intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae263p-4 : inexact-ok += sin downward m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 : inexact-ok += sin tonearest m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 : inexact-ok += sin towardzero m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 : inexact-ok += sin upward m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae263p-4 : inexact-ok += sin downward binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6b8p-4 : inexact-ok += sin tonearest binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6cp-4 : inexact-ok += sin towardzero binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6b8p-4 : inexact-ok += sin upward binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6cp-4 : inexact-ok += sin downward ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f4p-4 : inexact-ok += sin tonearest ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f8p-4 : inexact-ok += sin towardzero ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f4p-4 : inexact-ok += sin upward ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f8p-4 : inexact-ok += sin downward binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea838p-4 : inexact-ok += sin tonearest binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea84p-4 : inexact-ok += sin towardzero binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea838p-4 : inexact-ok += sin upward binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea84p-4 : inexact-ok += sin downward intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 : inexact-ok += sin tonearest intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 : inexact-ok += sin towardzero intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 : inexact-ok += sin upward intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 : inexact-ok += sin downward m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 : inexact-ok += sin tonearest m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 : inexact-ok += sin towardzero m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 : inexact-ok += sin upward m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 : inexact-ok += sin downward binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea68p-4 : inexact-ok += sin tonearest binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea7p-4 : inexact-ok += sin towardzero binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea68p-4 : inexact-ok += sin upward binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea7p-4 : inexact-ok += sin downward ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455e8p-4 : inexact-ok += sin tonearest ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ecp-4 : inexact-ok += sin towardzero ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455e8p-4 : inexact-ok += sin upward ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ecp-4 : inexact-ok sincos 0 = sincos downward binary32 0x0p+0 : 0x0p+0 0x1p+0 : inexact-ok = sincos tonearest binary32 0x0p+0 : 0x0p+0 0x1p+0 : inexact-ok @@ -266725,6 +266863,75 @@ sincos -min_subnorm = sincos tonearest binary128 -0x4p-16496 : -0x4p-16496 0x1p+0 : inexact-ok underflow errno-erange-ok = sincos towardzero binary128 -0x4p-16496 : -0x0p+0 0xf.fffffffffffffffffffffffffff8p-4 : inexact-ok underflow errno-erange-ok = sincos upward binary128 -0x4p-16496 : -0x0p+0 0x1p+0 : inexact-ok underflow errno-erange-ok +sincos 0x1.8475e5afd4481p+0 += sincos downward binary32 0x1.8475e6p+0 : 0xf.fa2adp-4 0xd.a8263p-8 : inexact-ok += sincos tonearest binary32 0x1.8475e6p+0 : 0xf.fa2aep-4 0xd.a8263p-8 : inexact-ok += sincos towardzero binary32 0x1.8475e6p+0 : 0xf.fa2adp-4 0xd.a8263p-8 : inexact-ok += sincos upward binary32 0x1.8475e6p+0 : 0xf.fa2aep-4 0xd.a8264p-8 : inexact-ok += sincos downward binary64 0x1.8475e6p+0 : 0xf.fa2add3e58948p-4 0xd.a8263394be6dp-8 : inexact-ok += sincos tonearest binary64 0x1.8475e6p+0 : 0xf.fa2add3e58948p-4 0xd.a8263394be6dp-8 : inexact-ok += sincos towardzero binary64 0x1.8475e6p+0 : 0xf.fa2add3e58948p-4 0xd.a8263394be6dp-8 : inexact-ok += sincos upward binary64 0x1.8475e6p+0 : 0xf.fa2add3e5895p-4 0xd.a8263394be6d8p-8 : inexact-ok += sincos downward intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 0xd.a8263394be6d0e5p-8 : inexact-ok += sincos tonearest intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 0xd.a8263394be6d0e6p-8 : inexact-ok += sincos towardzero intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 0xd.a8263394be6d0e5p-8 : inexact-ok += sincos upward intel96 0x1.8475e6p+0 : 0xf.fa2add3e58948d2p-4 0xd.a8263394be6d0e6p-8 : inexact-ok += sincos downward m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 0xd.a8263394be6d0e5p-8 : inexact-ok += sincos tonearest m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 0xd.a8263394be6d0e6p-8 : inexact-ok += sincos towardzero m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d1p-4 0xd.a8263394be6d0e5p-8 : inexact-ok += sincos upward m68k96 0x1.8475e6p+0 : 0xf.fa2add3e58948d2p-4 0xd.a8263394be6d0e6p-8 : inexact-ok += sincos downward binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b5618p-4 0xd.a8263394be6d0e58c1c35a8a3bap-8 : inexact-ok += sincos tonearest binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b562p-4 0xd.a8263394be6d0e58c1c35a8a3bap-8 : inexact-ok += sincos towardzero binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b5618p-4 0xd.a8263394be6d0e58c1c35a8a3bap-8 : inexact-ok += sincos upward binary128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b562p-4 0xd.a8263394be6d0e58c1c35a8a3ba8p-8 : inexact-ok += sincos downward ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b54p-4 0xd.a8263394be6d0e58c1c35a8a38p-8 : inexact-ok += sincos tonearest ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b58p-4 0xd.a8263394be6d0e58c1c35a8a3cp-8 : inexact-ok += sincos towardzero ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b54p-4 0xd.a8263394be6d0e58c1c35a8a38p-8 : inexact-ok += sincos upward ibm128 0x1.8475e6p+0 : 0xf.fa2add3e58948d10238cc27b58p-4 0xd.a8263394be6d0e58c1c35a8a3cp-8 : inexact-ok += sincos downward binary32 0x1.8475e4p+0 : 0xf.fa2adp-4 0xd.a8283p-8 : inexact-ok += sincos tonearest binary32 0x1.8475e4p+0 : 0xf.fa2aep-4 0xd.a8283p-8 : inexact-ok += sincos towardzero binary32 0x1.8475e4p+0 : 0xf.fa2adp-4 0xd.a8283p-8 : inexact-ok += sincos upward binary32 0x1.8475e4p+0 : 0xf.fa2aep-4 0xd.a8284p-8 : inexact-ok += sincos downward binary64 0x1.8475e4p+0 : 0xf.fa2adb8953aep-4 0xd.a82832da19f98p-8 : inexact-ok += sincos tonearest binary64 0x1.8475e4p+0 : 0xf.fa2adb8953aep-4 0xd.a82832da19f98p-8 : inexact-ok += sincos towardzero binary64 0x1.8475e4p+0 : 0xf.fa2adb8953aep-4 0xd.a82832da19f98p-8 : inexact-ok += sincos upward binary64 0x1.8475e4p+0 : 0xf.fa2adb8953ae8p-4 0xd.a82832da19fap-8 : inexact-ok += sincos downward intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 0xd.a82832da19f9891p-8 : inexact-ok += sincos tonearest intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 0xd.a82832da19f9892p-8 : inexact-ok += sincos towardzero intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 0xd.a82832da19f9891p-8 : inexact-ok += sincos upward intel96 0x1.8475e4p+0 : 0xf.fa2adb8953ae263p-4 0xd.a82832da19f9892p-8 : inexact-ok += sincos downward m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 0xd.a82832da19f9891p-8 : inexact-ok += sincos tonearest m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 0xd.a82832da19f9892p-8 : inexact-ok += sincos towardzero m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae262p-4 0xd.a82832da19f9891p-8 : inexact-ok += sincos upward m68k96 0x1.8475e4p+0 : 0xf.fa2adb8953ae263p-4 0xd.a82832da19f9892p-8 : inexact-ok += sincos downward binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6b8p-4 0xd.a82832da19f9891d9762fa659ff8p-8 : inexact-ok += sincos tonearest binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6cp-4 0xd.a82832da19f9891d9762fa659ff8p-8 : inexact-ok += sincos towardzero binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6b8p-4 0xd.a82832da19f9891d9762fa659ff8p-8 : inexact-ok += sincos upward binary128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f6cp-4 0xd.a82832da19f9891d9762fa65ap-8 : inexact-ok += sincos downward ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f4p-4 0xd.a82832da19f9891d9762fa659cp-8 : inexact-ok += sincos tonearest ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f8p-4 0xd.a82832da19f9891d9762fa65ap-8 : inexact-ok += sincos towardzero ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f4p-4 0xd.a82832da19f9891d9762fa659cp-8 : inexact-ok += sincos upward ibm128 0x1.8475e4p+0 : 0xf.fa2adb8953ae26229c919ec8f8p-4 0xd.a82832da19f9891d9762fa65ap-8 : inexact-ok += sincos downward binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea838p-4 0xd.a82683a33cbe8p-8 : inexact-ok += sincos tonearest binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea84p-4 0xd.a82683a33cbe8p-8 : inexact-ok += sincos towardzero binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea838p-4 0xd.a82683a33cbe8p-8 : inexact-ok += sincos upward binary64 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea84p-4 0xd.a82683a33cbfp-8 : inexact-ok += sincos downward intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 0xd.a82683a33cbebffp-8 : inexact-ok += sincos tonearest intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 0xd.a82683a33cbecp-8 : inexact-ok += sincos towardzero intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 0xd.a82683a33cbebffp-8 : inexact-ok += sincos upward intel96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 0xd.a82683a33cbecp-8 : inexact-ok += sincos downward m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 0xd.a82683a33cbebffp-8 : inexact-ok += sincos tonearest m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 0xd.a82683a33cbecp-8 : inexact-ok += sincos towardzero m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdp-4 0xd.a82683a33cbebffp-8 : inexact-ok += sincos upward m68k96 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbep-4 0xd.a82683a33cbecp-8 : inexact-ok += sincos downward binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea68p-4 0xd.a82683a33cbebfffffffa2966878p-8 : inexact-ok += sincos tonearest binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea7p-4 0xd.a82683a33cbebfffffffa2966878p-8 : inexact-ok += sincos towardzero binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea68p-4 0xd.a82683a33cbebfffffffa2966878p-8 : inexact-ok += sincos upward binary128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ea7p-4 0xd.a82683a33cbebfffffffa296688p-8 : inexact-ok += sincos downward ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455e8p-4 0xd.a82683a33cbebfffffffa29668p-8 : inexact-ok += sincos tonearest ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ecp-4 0xd.a82683a33cbebfffffffa29668p-8 : inexact-ok += sincos towardzero ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455e8p-4 0xd.a82683a33cbebfffffffa29668p-8 : inexact-ok += sincos upward ibm128 0x1.8475e5afd4481p+0 : 0xf.fa2adcf9ea83dbdd053ee455ecp-4 0xd.a82683a33cbebfffffffa2966cp-8 : inexact-ok sinh 0 = sinh downward binary32 0x0p+0 : 0x0p+0 : inexact-ok = sinh tonearest binary32 0x0p+0 : 0x0p+0 : inexact-ok diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index e2cf49f..951a3d0 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -115,9 +115,11 @@ __MATHCALL (log10,, (_Mdouble_ __x)); __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); _Mdouble_END_NAMESPACE -#ifdef __USE_GNU -/* A function missing in all standards: compute exponent to base ten. */ +#if __GLIBC_USE (IEC_60559_FUNCS_EXT) +/* Compute exponent to base ten. */ __MATHCALL (exp10,, (_Mdouble_ __x)); +#endif +#ifdef __USE_GNU /* Another name occasionally used. */ __MATHCALL (pow10,, (_Mdouble_ __x)); #endif @@ -294,7 +296,7 @@ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif -#ifdef __USE_GNU +#if __GLIBC_USE (IEC_60559_BFP_EXT) /* Return X - epsilon. */ __MATHCALL (nextdown,, (_Mdouble_ __x)); /* Return X + epsilon. */ @@ -377,7 +379,7 @@ __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); __END_NAMESPACE_C99 #endif -#ifdef __USE_GNU +#if __GLIBC_USE (IEC_60559_BFP_EXT) /* Test for signaling NaN. */ __MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) __attribute__ ((__const__)); diff --git a/math/e_scalb.c b/math/e_scalb.c index 7f61ce0..692f105 100644 --- a/math/e_scalb.c +++ b/math/e_scalb.c @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <fenv.h> #include <math.h> #include <math_private.h> @@ -26,10 +25,7 @@ __attribute__ ((noinline)) invalid_fn (double x, double fn) { if (__rint (fn) != fn) - { - __feraiseexcept (FE_INVALID); - return __nan (""); - } + return (fn - fn) / (fn - fn); else if (fn > 65000.0) return __scalbn (x, 65000); else diff --git a/math/e_scalbf.c b/math/e_scalbf.c index 7377f6e..8df86f4 100644 --- a/math/e_scalbf.c +++ b/math/e_scalbf.c @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <fenv.h> #include <math.h> #include <math_private.h> @@ -26,10 +25,7 @@ __attribute__ ((noinline)) invalid_fn (float x, float fn) { if (__rintf (fn) != fn) - { - feraiseexcept (FE_INVALID); - return __nan (""); - } + return (fn - fn) / (fn - fn); else if (fn > 65000.0f) return __scalbnf (x, 65000); else diff --git a/math/e_scalbl.c b/math/e_scalbl.c index 53e9ca2..02956ac 100644 --- a/math/e_scalbl.c +++ b/math/e_scalbl.c @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <fenv.h> #include <math.h> #include <math_private.h> @@ -26,10 +25,7 @@ __attribute__ ((noinline)) invalid_fn (long double x, long double fn) { if (__rintl (fn) != fn) - { - feraiseexcept (FE_INVALID); - return __nan (""); - } + return (fn - fn) / (fn - fn); else if (fn > 65000.0L) return __scalbnl (x, 65000); else diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl index aa66e76..577964c 100755 --- a/math/gen-libm-test.pl +++ b/math/gen-libm-test.pl @@ -163,7 +163,7 @@ sub show_exceptions { # Apply the LIT(x) macro to a literal floating point constant # and strip any existing suffix. -sub apply_lit { +sub _apply_lit { my ($lit) = @_; my $exp_re = "([+-])?[[:digit:]]+"; # Don't wrap something that does not look like a: @@ -180,6 +180,21 @@ sub apply_lit { return "LIT (${lit})"; } +# Apply LIT macro to individual tokens within an expression. +# +# This function assumes the C expression follows GNU coding +# standards. Specifically, a space separates each lexical +# token. Otherwise, this post-processing may apply LIT +# incorrectly, or around an entire expression. +sub apply_lit { + my ($lit) = @_; + my @toks = split (/ /, $lit); + foreach (@toks) { + $_ = _apply_lit ($_); + } + return join (' ', @toks); +} + # Parse the arguments to TEST_x_y sub parse_args { my ($file, $descr, $args) = @_; diff --git a/math/libm-test.inc b/math/libm-test.inc index 4ac7a0c..e4fcb5a 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -179,6 +179,7 @@ #define IGNORE_RESULT 0x20000 #define NON_FINITE 0x40000 #define TEST_SNAN 0x80000 +#define NO_TEST_MATHVEC 0x100000 #define __CONCATX(a,b) __CONCAT(a,b) @@ -1056,6 +1057,9 @@ enable_test (int exceptions) return 0; if (!SNAN_TESTS (FLOAT) && (exceptions & TEST_SNAN) != 0) return 0; + if (TEST_MATHVEC && (exceptions & NO_TEST_MATHVEC) != 0) + return 0; + return 1; } @@ -7210,7 +7214,7 @@ static const struct test_ff_f_data fdim_test_data[] = #endif TEST_ff_f (fdim, min_subnorm_value, min_subnorm_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_ff_f (fdim, -min_subnorm_value, -min_subnorm_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_ff_f (fdim, min_subnorm_value, -min_subnorm_value, 2*min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_ff_f (fdim, min_subnorm_value, -min_subnorm_value, 2 * min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_ff_f (fdim, min_value, min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_ff_f (fdim, -min_value, -min_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_ff_f (fdim, max_value, max_value, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -7994,12 +7998,12 @@ static const struct test_f_f1_data frexp_test_data[] = #endif #if MANT_DIG >= 106 - TEST_fI_f1 (frexp, 1.0L-0x1p-106L, 1.0L-0x1p-106L, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fI_f1 (frexp, 1.0L - 0x1p-106L, 1.0L - 0x1p-106L, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fI_f1 (frexp, 1.0L, 0.5L, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fI_f1 (frexp, 1.0L+0x1p-105L, 0.5L+0x1p-106L, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fI_f1 (frexp, -1.0L+0x1p-106L, -1.0L+0x1p-106L, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fI_f1 (frexp, 1.0L + 0x1p-105L, 0.5L + 0x1p-106L, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fI_f1 (frexp, -1.0L + 0x1p-106L, -1.0L + 0x1p-106L, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fI_f1 (frexp, -1.0L, -0.5L, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fI_f1 (frexp, -1.0L-0x1p-105L, -0.5L-0x1p-106L, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fI_f1 (frexp, -1.0L - 0x1p-105L, -0.5L - 0x1p-106L, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), #endif }; @@ -8971,7 +8975,7 @@ static const struct test_f_l_data lrint_test_data[] = /* Test boundary conditions. */ /* 0x1FFFFF */ - TEST_f_l (lrint, 2097151.0,2097151LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_l (lrint, 2097151.0, 2097151LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), /* 0x800000 */ TEST_f_l (lrint, 8388608.0, 8388608LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), /* 0x1000000 */ @@ -9208,7 +9212,7 @@ static const struct test_f_L_data llrint_test_data[] = /* Test boundary conditions. */ /* 0x1FFFFF */ - TEST_f_L (llrint, 2097151.0,2097151LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_L (llrint, 2097151.0, 2097151LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), /* 0x800000 */ TEST_f_L (llrint, 8388608.0, 8388608LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), /* 0x1000000 */ @@ -9709,8 +9713,8 @@ static const struct test_f_l_data lround_test_data[] = * numbers between +-(2^52+1 and 2^53-1) are affected since they have the * rightmost bit set. */ /* +-(2^52+1) */ - TEST_f_l (lround, 0x1.0000000000001p+52,4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_l (lround, -0x1.0000000000001p+52,-4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_l (lround, 0x1.0000000000001p+52, 4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_l (lround, -0x1.0000000000001p+52, -4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), /* +-(2^53-1): Input is the last (positive and negative) incrementally * representable whole-number in the 'double' range that might round * erroneously. */ @@ -9729,8 +9733,8 @@ static const struct test_f_l_data lround_test_data[] = /* As above, on PowerPC an exponent of '23' is the largest incrementally * representable sequence of whole-numbers in the 'float' range. * Likewise, numbers between +-(2^23+1 and 2^24-1) are affected. */ - TEST_f_l (lround, 0x1.000002p+23,8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_l (lround, -0x1.000002p+23,-8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_l (lround, 0x1.000002p+23, 8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_l (lround, -0x1.000002p+23, -8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_l (lround, 0x1.fffffep+23, 16777215, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_l (lround, -0x1.fffffep+23, -16777215, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -9982,8 +9986,8 @@ static const struct test_f_L_data llround_test_data[] = * numbers between +-(2^52+1 and 2^53-1) are affected since they have the * rightmost bit set. */ /* +-(2^52+1) */ - TEST_f_L (llround, 0x1.0000000000001p+52,4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_L (llround, -0x1.0000000000001p+52,-4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_L (llround, 0x1.0000000000001p+52, 4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_L (llround, -0x1.0000000000001p+52, -4503599627370497LL, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), /* +-(2^53-1): Input is the last (positive and negative) incrementally * representable whole-number in the 'double' range that might round * erroneously. */ @@ -10001,8 +10005,8 @@ static const struct test_f_L_data llround_test_data[] = /* As above, on PowerPC an exponent of '23' is the largest incrementally * representable sequence of whole-numbers in the 'float' range. * Likewise, numbers between +-(2^23+1 and 2^24-1) are affected. */ - TEST_f_L (llround, 0x1.000002p+23,8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_L (llround, -0x1.000002p+23,-8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_L (llround, 0x1.000002p+23, 8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_L (llround, -0x1.000002p+23, -8388609, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_L (llround, 0x1.fffffep+23, 16777215, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_L (llround, -0x1.fffffep+23, -16777215, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -10368,12 +10372,12 @@ static const struct test_ff_f_data nextafter_test_data[] = TEST_ff_f (nextafter, -0x0.fffffffep-16383L, 0.0L, -0x0.fffffffdfffffffep-16383L, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_ERANGE), #endif #if TEST_COND_ibm128 - TEST_ff_f (nextafter, 1.0L, -10.0L, 1.0L-0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_ff_f (nextafter, 1.0L, 10.0L, 1.0L+0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_ff_f (nextafter, 1.0L-0x1p-106L, 10.0L, 1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_ff_f (nextafter, -1.0L, -10.0L, -1.0L-0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_ff_f (nextafter, -1.0L, 10.0L, -1.0L+0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_ff_f (nextafter, -1.0L+0x1p-106L, -10.0L, -1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_ff_f (nextafter, 1.0L, -10.0L, 1.0L - 0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_ff_f (nextafter, 1.0L, 10.0L, 1.0L + 0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_ff_f (nextafter, 1.0L - 0x1p-106L, 10.0L, 1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_ff_f (nextafter, -1.0L, -10.0L, -1.0L - 0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_ff_f (nextafter, -1.0L, 10.0L, -1.0L + 0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_ff_f (nextafter, -1.0L + 0x1p-106L, -10.0L, -1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), #endif #if TEST_COND_binary128 TEST_ff_f (nextafter, 1.0L, 10.0L, 0x1.0000000000000000000000000001p0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -10423,9 +10427,9 @@ static const struct test_f_f_data nextup_test_data[] = TEST_f_f (nextup, -0x0.fffffffep-16383L, -0x0.fffffffdfffffffep-16383L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), #endif #if TEST_COND_ibm128 - TEST_f_f (nextup, 1.0L, 1.0L+0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_f (nextup, -1.0L-0x1p-105L, -1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_f (nextup, -1.0L, -1.0L+0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (nextup, 1.0L, 1.0L + 0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (nextup, -1.0L - 0x1p-105L, -1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (nextup, -1.0L, -1.0L + 0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), #endif #if TEST_COND_binary128 TEST_f_f (nextup, 1.0L, 0x1.0000000000000000000000000001p0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -10470,9 +10474,9 @@ static const struct test_f_f_data nextdown_test_data[] = TEST_f_f (nextdown, -0x0.fffffffdfffffffep-16383L, -0x0.fffffffep-16383L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), #endif #if TEST_COND_ibm128 - TEST_f_f (nextdown, -1.0L, -1.0L-0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_f (nextdown, 1.0L+0x1p-105L, 1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_f (nextdown, 1.0L, 1.0L-0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (nextdown, -1.0L, -1.0L - 0x1p-105L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (nextdown, 1.0L + 0x1p-105L, 1.0L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (nextdown, 1.0L, 1.0L - 0x1p-106L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), #endif #if TEST_COND_binary128 TEST_f_f (nextdown, 1.0L, 0x1.ffffffffffffffffffffffffffffp-1L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), @@ -10631,10 +10635,10 @@ nexttoward_test (void) static const struct test_ff_f_data pow_test_data[] = { - TEST_ff_f (pow, qnan_value, 0, 1, ERRNO_UNCHANGED), - TEST_ff_f (pow, -qnan_value, 0, 1, ERRNO_UNCHANGED), - TEST_ff_f (pow, qnan_value, minus_zero, 1, ERRNO_UNCHANGED), - TEST_ff_f (pow, -qnan_value, minus_zero, 1, ERRNO_UNCHANGED), + TEST_ff_f (pow, qnan_value, 0, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC), + TEST_ff_f (pow, -qnan_value, 0, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC), + TEST_ff_f (pow, qnan_value, minus_zero, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC), + TEST_ff_f (pow, -qnan_value, minus_zero, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC), TEST_ff_f (pow, 1.1L, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), TEST_ff_f (pow, plus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE), @@ -11744,27 +11748,27 @@ static const struct test_fi_f_data scalbn_test_data[] = TEST_fi_f (scalbn, -min_value * 0x0.ffffp0, 0, -min_value * 0x0.ffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fi_f (scalbn, min_subnorm_value, 0, min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fi_f (scalbn, -min_subnorm_value, 0, -min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fi_f (scalbn, min_subnorm_value, MANT_DIG-1, min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fi_f (scalbn, -min_subnorm_value, MANT_DIG-1, -min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fi_f (scalbn, min_subnorm_value, MANT_DIG - 1, min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fi_f (scalbn, -min_subnorm_value, MANT_DIG - 1, -min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fi_f (scalbn, min_value, -MANT_DIG+1, min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fi_f (scalbn, -min_value, -MANT_DIG+1, -min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fi_f (scalbn, min_value, -MANT_DIG + 1, min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fi_f (scalbn, -min_value, -MANT_DIG + 1, -min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fi_f (scalbn, min_value, -MANT_DIG, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), TEST_fi_f (scalbn, -min_value, -MANT_DIG, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), - TEST_fi_f (scalbn, min_value, -MANT_DIG-1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), - TEST_fi_f (scalbn, -min_value, -MANT_DIG-1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), - TEST_fi_f (scalbn, min_value * 1.5, -MANT_DIG+1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fi_f (scalbn, -min_value * 1.5, -MANT_DIG+1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fi_f (scalbn, min_value, -MANT_DIG - 1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), + TEST_fi_f (scalbn, -min_value, -MANT_DIG - 1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), + TEST_fi_f (scalbn, min_value * 1.5, -MANT_DIG + 1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fi_f (scalbn, -min_value * 1.5, -MANT_DIG + 1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fi_f (scalbn, min_value * 1.5, -MANT_DIG, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fi_f (scalbn, -min_value * 1.5, -MANT_DIG, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fi_f (scalbn, min_value * 1.5, -MANT_DIG-1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), - TEST_fi_f (scalbn, -min_value * 1.5, -MANT_DIG-1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), - TEST_fi_f (scalbn, min_value * 1.25, -MANT_DIG+1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fi_f (scalbn, -min_value * 1.25, -MANT_DIG+1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fi_f (scalbn, min_value * 1.5, -MANT_DIG - 1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), + TEST_fi_f (scalbn, -min_value * 1.5, -MANT_DIG - 1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), + TEST_fi_f (scalbn, min_value * 1.25, -MANT_DIG + 1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fi_f (scalbn, -min_value * 1.25, -MANT_DIG + 1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fi_f (scalbn, min_value * 1.25, -MANT_DIG, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fi_f (scalbn, -min_value * 1.25, -MANT_DIG, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fi_f (scalbn, min_value * 1.25, -MANT_DIG-1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), - TEST_fi_f (scalbn, -min_value * 1.25, -MANT_DIG-1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), + TEST_fi_f (scalbn, min_value * 1.25, -MANT_DIG - 1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), + TEST_fi_f (scalbn, -min_value * 1.25, -MANT_DIG - 1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), TEST_fi_f (scalbn, 1, INT_MAX, plus_oflow, INEXACT_EXCEPTION|OVERFLOW_EXCEPTION|ERRNO_PLUS_OFLOW), TEST_fi_f (scalbn, 1, INT_MIN, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), @@ -11828,27 +11832,27 @@ static const struct test_fl_f_data scalbln_test_data[] = TEST_fl_f (scalbln, -min_value * 0x0.ffffp0, 0, -min_value * 0x0.ffffp0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fl_f (scalbln, min_subnorm_value, 0, min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fl_f (scalbln, -min_subnorm_value, 0, -min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fl_f (scalbln, min_subnorm_value, MANT_DIG-1, min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fl_f (scalbln, -min_subnorm_value, MANT_DIG-1, -min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fl_f (scalbln, min_subnorm_value, MANT_DIG - 1, min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fl_f (scalbln, -min_subnorm_value, MANT_DIG - 1, -min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fl_f (scalbln, min_value, -MANT_DIG+1, min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_fl_f (scalbln, -min_value, -MANT_DIG+1, -min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fl_f (scalbln, min_value, -MANT_DIG + 1, min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_fl_f (scalbln, -min_value, -MANT_DIG + 1, -min_subnorm_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_fl_f (scalbln, min_value, -MANT_DIG, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), TEST_fl_f (scalbln, -min_value, -MANT_DIG, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), - TEST_fl_f (scalbln, min_value, -MANT_DIG-1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), - TEST_fl_f (scalbln, -min_value, -MANT_DIG-1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), - TEST_fl_f (scalbln, min_value * 1.5, -MANT_DIG+1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fl_f (scalbln, -min_value * 1.5, -MANT_DIG+1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fl_f (scalbln, min_value, -MANT_DIG - 1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), + TEST_fl_f (scalbln, -min_value, -MANT_DIG - 1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), + TEST_fl_f (scalbln, min_value * 1.5, -MANT_DIG + 1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fl_f (scalbln, -min_value * 1.5, -MANT_DIG + 1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fl_f (scalbln, min_value * 1.5, -MANT_DIG, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fl_f (scalbln, -min_value * 1.5, -MANT_DIG, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fl_f (scalbln, min_value * 1.5, -MANT_DIG-1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), - TEST_fl_f (scalbln, -min_value * 1.5, -MANT_DIG-1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), - TEST_fl_f (scalbln, min_value * 1.25, -MANT_DIG+1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fl_f (scalbln, -min_value * 1.25, -MANT_DIG+1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fl_f (scalbln, min_value * 1.5, -MANT_DIG - 1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), + TEST_fl_f (scalbln, -min_value * 1.5, -MANT_DIG - 1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), + TEST_fl_f (scalbln, min_value * 1.25, -MANT_DIG + 1, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), + TEST_fl_f (scalbln, -min_value * 1.25, -MANT_DIG + 1, -min_subnorm_value * 2, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fl_f (scalbln, min_value * 1.25, -MANT_DIG, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, plus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), TEST_fl_f (scalbln, -min_value * 1.25, -MANT_DIG, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, -min_subnorm_value, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION, minus_zero, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION), - TEST_fl_f (scalbln, min_value * 1.25, -MANT_DIG-1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), - TEST_fl_f (scalbln, -min_value * 1.25, -MANT_DIG-1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), + TEST_fl_f (scalbln, min_value * 1.25, -MANT_DIG - 1, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), + TEST_fl_f (scalbln, -min_value * 1.25, -MANT_DIG - 1, minus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_MINUS_UFLOW), TEST_fl_f (scalbln, 1, INT_MAX, plus_oflow, INEXACT_EXCEPTION|OVERFLOW_EXCEPTION|ERRNO_PLUS_OFLOW), TEST_fl_f (scalbln, 1, INT_MIN, plus_uflow, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_PLUS_UFLOW), diff --git a/math/math.h b/math/math.h index 4724b10..2f77dee 100644 --- a/math/math.h +++ b/math/math.h @@ -23,7 +23,8 @@ #ifndef _MATH_H #define _MATH_H 1 -#include <features.h> +#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +#include <bits/libc-header-start.h> __BEGIN_DECLS @@ -44,7 +45,27 @@ __BEGIN_DECLS # include <bits/nan.h> #endif /* __USE_ISOC99 */ -/* Get general and ISO C99 specific information. */ +/* Get the architecture specific values describing the floating-point + evaluation. The following symbols will get defined: + + float_t floating-point type at least as wide as `float' used + to evaluate `float' expressions + double_t floating-point type at least as wide as `double' used + to evaluate `double' expressions + + FP_FAST_FMA + FP_FAST_FMAF + FP_FAST_FMAL + If defined it indicates that the `fma' function + generally executes about as fast as a multiply and an add. + This macro is defined only iff the `fma' function is + implemented directly with a hardware multiply-add instructions. + + FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'. + FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'. + +*/ + #include <bits/mathdef.h> /* The file <bits/mathcalls.h> contains the prototypes for all the @@ -172,39 +193,6 @@ extern int signgam; /* ISO C99 defines some generic macros which work on any data type. */ #ifdef __USE_ISOC99 -/* Get the architecture specific values describing the floating-point - evaluation. The following symbols will get defined: - - float_t floating-point type at least as wide as `float' used - to evaluate `float' expressions - double_t floating-point type at least as wide as `double' used - to evaluate `double' expressions - - FLT_EVAL_METHOD - Defined to - 0 if `float_t' is `float' and `double_t' is `double' - 1 if `float_t' and `double_t' are `double' - 2 if `float_t' and `double_t' are `long double' - else `float_t' and `double_t' are unspecified - - INFINITY representation of the infinity value of type `float' - - FP_FAST_FMA - FP_FAST_FMAF - FP_FAST_FMAL - If defined it indicates that the `fma' function - generally executes about as fast as a multiply and an add. - This macro is defined only iff the `fma' function is - implemented directly with a hardware multiply-add instructions. - - FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'. - FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'. - - DECIMAL_DIG Number of decimal digits supported by conversion between - decimal and all internal floating-point formats. - -*/ - /* All floating-point numbers can be put in one of these categories. */ enum { @@ -328,7 +316,7 @@ enum #endif /* Use ISO C99. */ -#ifdef __USE_GNU +#if __GLIBC_USE (IEC_60559_BFP_EXT) /* Return nonzero value if X is a signaling NaN. */ # ifdef __NO_LONG_DOUBLE_MATH # define issignaling(x) \ @@ -340,7 +328,7 @@ enum : sizeof (x) == sizeof (double) \ ? __issignaling (x) : __issignalingl (x)) # endif -#endif /* Use GNU. */ +#endif /* Use IEC_60559_BFP_EXT. */ #ifdef __USE_MISC /* Support for various different standard error handling behaviors. */ diff --git a/math/s_ccoshf.c b/math/s_ccoshf.c index 610a749..d572b76 100644 --- a/math/s_ccoshf.c +++ b/math/s_ccoshf.c @@ -94,7 +94,7 @@ __ccoshf (__complex__ float x) feraiseexcept (FE_INVALID); } } - else if (__glibc_likely (rcls == FP_INFINITE)) + else if (rcls == FP_INFINITE) { /* Real part is infinite. */ if (__glibc_likely (icls > FP_ZERO)) @@ -128,10 +128,8 @@ __ccoshf (__complex__ float x) __real__ retval = HUGE_VALF; __imag__ retval = __nanf ("") + __nanf (""); -#ifdef FE_INVALID if (icls == FP_INFINITE) feraiseexcept (FE_INVALID); -#endif } } else diff --git a/math/s_ccoshl.c b/math/s_ccoshl.c index 680da3a..d38f0aa 100644 --- a/math/s_ccoshl.c +++ b/math/s_ccoshl.c @@ -94,7 +94,7 @@ __ccoshl (__complex__ long double x) feraiseexcept (FE_INVALID); } } - else if (__glibc_likely (rcls == FP_INFINITE)) + else if (rcls == FP_INFINITE) { /* Real part is infinite. */ if (__glibc_likely (icls > FP_ZERO)) diff --git a/math/s_csinhf.c b/math/s_csinhf.c index a0458cf..36b42ca 100644 --- a/math/s_csinhf.c +++ b/math/s_csinhf.c @@ -111,7 +111,7 @@ __csinhf (__complex__ float x) } } } - else if (__glibc_likely (rcls == FP_INFINITE)) + else if (rcls == FP_INFINITE) { /* Real part is infinite. */ if (__glibc_likely (icls > FP_ZERO)) @@ -147,10 +147,8 @@ __csinhf (__complex__ float x) __real__ retval = HUGE_VALF; __imag__ retval = __nanf ("") + __nanf (""); -#ifdef FE_INVALID if (icls == FP_INFINITE) feraiseexcept (FE_INVALID); -#endif } } else diff --git a/math/s_csinhl.c b/math/s_csinhl.c index d7f03fa..c231d7b 100644 --- a/math/s_csinhl.c +++ b/math/s_csinhl.c @@ -111,7 +111,7 @@ __csinhl (__complex__ long double x) } } } - else if (__glibc_likely (rcls == FP_INFINITE)) + else if (rcls == FP_INFINITE) { /* Real part is infinite. */ if (__glibc_likely (icls > FP_ZERO)) @@ -147,10 +147,8 @@ __csinhl (__complex__ long double x) __real__ retval = HUGE_VALL; __imag__ retval = __nanl ("") + __nanl (""); -#ifdef FE_INVALID if (icls == FP_INFINITE) feraiseexcept (FE_INVALID); -#endif } } else diff --git a/math/s_fdim.c b/math/s_fdim.c index a051ed8..1786521 100644 --- a/math/s_fdim.c +++ b/math/s_fdim.c @@ -33,8 +33,10 @@ __fdim (double x, double y) return r; } +#ifndef __fdim weak_alias (__fdim, fdim) -#ifdef NO_LONG_DOUBLE +# ifdef NO_LONG_DOUBLE strong_alias (__fdim, __fdiml) weak_alias (__fdim, fdiml) +# endif #endif diff --git a/math/s_fdimf.c b/math/s_fdimf.c index 8aed61d..e457f9d 100644 --- a/math/s_fdimf.c +++ b/math/s_fdimf.c @@ -33,4 +33,6 @@ __fdimf (float x, float y) return r; } +#ifndef __fdimf weak_alias (__fdimf, fdimf) +#endif diff --git a/math/test-fexcept-traps.c b/math/test-fexcept-traps.c new file mode 100644 index 0000000..428a444 --- /dev/null +++ b/math/test-fexcept-traps.c @@ -0,0 +1,84 @@ +/* Test fegetexceptflag and fesetexceptflag: exception traps enabled. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <stdio.h> +#include <math-tests.h> + +static int +do_test (void) +{ + int result = 0; + + fedisableexcept (FE_ALL_EXCEPT); + int ret = feraiseexcept (FE_ALL_EXCEPT); + if (ret != 0) + { + if (EXCEPTION_TESTS (float)) + { + puts ("feraiseexcept (FE_ALL_EXCEPT) failed"); + result = 1; + return result; + } + else + { + puts ("feraiseexcept (FE_ALL_EXCEPT) unsupported, cannot test"); + return 77; + } + } + fexcept_t saved; + ret = fegetexceptflag (&saved, FE_ALL_EXCEPT); + if (ret != 0) + { + puts ("fegetexceptflag failed"); + result = 1; + return result; + } + feclearexcept (FE_ALL_EXCEPT); + + ret = feenableexcept (FE_ALL_EXCEPT); + if (!EXCEPTION_ENABLE_SUPPORTED (FE_ALL_EXCEPT) && (ret == -1)) + { + puts ("feenableexcept (FE_ALL_EXCEPT) not supported, cannot test"); + return 77; + } + else if (ret != 0) + { + puts ("feenableexcept (FE_ALL_EXCEPT) failed"); + result = 1; + } + + if (EXCEPTION_SET_FORCES_TRAP) + { + puts ("setting exceptions traps, cannot test on this architecture"); + return 77; + } + /* The test is that this does not cause exception traps. */ + ret = fesetexceptflag (&saved, FE_ALL_EXCEPT); + if (ret != 0) + { + puts ("fesetexceptflag failed"); + result = 1; + } + feclearexcept (FE_ALL_EXCEPT); + + return result; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/math/test-fexcept.c b/math/test-fexcept.c new file mode 100644 index 0000000..5e181a1 --- /dev/null +++ b/math/test-fexcept.c @@ -0,0 +1,171 @@ +/* Test fegetexceptflag and fesetexceptflag. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <fenv.h> +#include <stdio.h> +#include <math-tests.h> + +static int +test_set (int initial, const fexcept_t *saved, int mask, int expected) +{ + int result = 0; + feclearexcept (FE_ALL_EXCEPT); + printf ("Testing set: initial exceptions %x, mask %x, expected %x\n", + (unsigned int) initial, (unsigned int) mask, + (unsigned int) expected); + int ret = feraiseexcept (initial); + if (ret != 0) + { + puts ("feraiseexcept failed"); + result = 1; + return result; + } + ret = fesetexceptflag (saved, mask); + if (ret != 0) + { + puts ("fesetexceptflag failed"); + result = 1; + } + else + puts ("fesetexceptflag succeeded"); + ret = fetestexcept (FE_ALL_EXCEPT); + if (ret != expected) + { + printf ("raised exceptions %x, expected %x\n", + (unsigned int) ret, (unsigned int) expected); + result = 1; + } + return result; +} + +static int +test_except (int exc, const char *exc_name) +{ + int result = 0; + + printf ("Testing %s\n", exc_name); + feclearexcept (FE_ALL_EXCEPT); + + fexcept_t clear_saved_exc, clear_saved_all; + int ret = fegetexceptflag (&clear_saved_exc, exc); + if (ret == 0) + printf ("fegetexceptflag (%s) succeeded\n", exc_name); + else + { + printf ("fegetexceptflag (%s) failed\n", exc_name); + result = 1; + return result; + } + ret = fegetexceptflag (&clear_saved_all, FE_ALL_EXCEPT); + if (ret == 0) + puts ("fegetexceptflag (FE_ALL_EXCEPT) succeeded"); + else + { + puts ("fegetexceptflag (FE_ALL_EXCEPT) failed"); + result = 1; + return result; + } + + ret = feraiseexcept (exc); + if (ret == 0) + printf ("feraiseexcept (%s) succeeded\n", exc_name); + else + { + printf ("feraiseexcept (%s) failed\n", exc_name); + if (exc == 0 || EXCEPTION_TESTS (float)) + { + puts ("failure of feraiseexcept was unexpected"); + result = 1; + } + else + puts ("failure of feraiseexcept OK, skipping further tests"); + return result; + } + + fexcept_t set_saved_exc, set_saved_all; + ret = fegetexceptflag (&set_saved_exc, exc); + if (ret == 0) + printf ("fegetexceptflag (%s) succeeded\n", exc_name); + else + { + printf ("fegetexceptflag (%s) failed\n", exc_name); + result = 1; + return result; + } + ret = fegetexceptflag (&set_saved_all, FE_ALL_EXCEPT); + if (ret == 0) + puts ("fegetexceptflag (FE_ALL_EXCEPT) succeeded"); + else + { + puts ("fegetexceptflag (FE_ALL_EXCEPT) failed"); + result = 1; + return result; + } + + result |= test_set (0, &set_saved_exc, exc, exc); + result |= test_set (0, &set_saved_all, exc, exc); + result |= test_set (0, &set_saved_all, FE_ALL_EXCEPT, exc); + result |= test_set (0, &clear_saved_exc, exc, 0); + result |= test_set (0, &clear_saved_all, exc, 0); + result |= test_set (0, &clear_saved_all, FE_ALL_EXCEPT, 0); + result |= test_set (exc, &set_saved_exc, exc, exc); + result |= test_set (exc, &set_saved_all, exc, exc); + result |= test_set (exc, &set_saved_all, FE_ALL_EXCEPT, exc); + result |= test_set (exc, &clear_saved_exc, exc, 0); + result |= test_set (exc, &clear_saved_all, exc, 0); + result |= test_set (exc, &clear_saved_all, FE_ALL_EXCEPT, 0); + result |= test_set (FE_ALL_EXCEPT, &set_saved_exc, exc, FE_ALL_EXCEPT); + result |= test_set (FE_ALL_EXCEPT, &set_saved_all, exc, FE_ALL_EXCEPT); + result |= test_set (FE_ALL_EXCEPT, &set_saved_all, FE_ALL_EXCEPT, exc); + result |= test_set (FE_ALL_EXCEPT, &clear_saved_exc, exc, + FE_ALL_EXCEPT & ~exc); + result |= test_set (FE_ALL_EXCEPT, &clear_saved_all, exc, + FE_ALL_EXCEPT & ~exc); + result |= test_set (FE_ALL_EXCEPT, &clear_saved_all, FE_ALL_EXCEPT, 0); + + return result; +} + +static int +do_test (void) +{ + int result = 0; + + result |= test_except (0, "0"); + result |= test_except (FE_ALL_EXCEPT, "FE_ALL_EXCEPT"); +#ifdef FE_DIVBYZERO + result |= test_except (FE_DIVBYZERO, "FE_DIVBYZERO"); +#endif +#ifdef FE_INEXACT + result |= test_except (FE_INEXACT, "FE_INEXACT"); +#endif +#ifdef FE_INVALID + result |= test_except (FE_INVALID, "FE_INVALID"); +#endif +#ifdef FE_OVERFLOW + result |= test_except (FE_OVERFLOW, "FE_OVERFLOW"); +#endif +#ifdef FE_UNDERFLOW + result |= test_except (FE_UNDERFLOW, "FE_UNDERFLOW"); +#endif + + return result; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/math/test-ildoubl.c b/math/test-ildouble.c index dc0efaa..dc0efaa 100644 --- a/math/test-ildoubl.c +++ b/math/test-ildouble.c diff --git a/math/tgmath.h b/math/tgmath.h index 8916fbe..de1eb98 100644 --- a/math/tgmath.h +++ b/math/tgmath.h @@ -392,7 +392,7 @@ prevailing rounding mode. */ #define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint) -#ifdef __USE_GNU +#if __GLIBC_USE (IEC_60559_BFP_EXT) /* Return X - epsilon. */ # define nextdown(Val) __TGMATH_UNARY_REAL_ONLY (Val, nextdown) /* Return X + epsilon. */ diff --git a/misc/Makefile b/misc/Makefile index 56e20ce..3d2ebb8 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -34,7 +34,8 @@ headers := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \ regexp.h bits/select.h bits/mman.h sys/xattr.h \ syslog.h sys/syslog.h \ bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \ - bits/select2.h bits/hwcap.h sys/auxv.h + bits/select2.h bits/hwcap.h sys/auxv.h \ + sys/sysmacros.h bits/sysmacros.h routines := brk sbrk sstk ioctl \ readv writev preadv preadv64 pwritev pwritev64 \ @@ -67,7 +68,7 @@ routines := brk sbrk sstk ioctl \ getloadavg getclktck \ fgetxattr flistxattr fremovexattr fsetxattr getxattr \ listxattr lgetxattr llistxattr lremovexattr lsetxattr \ - removexattr setxattr getauxval ifunc-impl-list + removexattr setxattr getauxval ifunc-impl-list makedev generated += tst-error1.mtrace tst-error1-mem.out @@ -78,7 +79,7 @@ gpl2lgpl := error.c error.h tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \ tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 \ tst-mntent-blank-corrupt tst-mntent-blank-passno bug18240 \ - tst-preadvwritev tst-preadvwritev64 + tst-preadvwritev tst-preadvwritev64 tst-makedev ifeq ($(run-built-tests),yes) tests-special += $(objpfx)tst-error1-mem.out endif diff --git a/misc/Versions b/misc/Versions index 671f487..f2c90ff 100644 --- a/misc/Versions +++ b/misc/Versions @@ -152,6 +152,9 @@ libc { GLIBC_2.23 { # SHLIB_COMPAT(GLIBC_2_0, GLIBC_2_23) used in regexp.c } + GLIBC_2.25 { + gnu_dev_major; gnu_dev_minor; gnu_dev_makedev; + } GLIBC_PRIVATE { __madvise; __mktemp; diff --git a/sysdeps/unix/sysv/linux/makedev.c b/misc/makedev.c index 68c18ca..7303fb6 100644 --- a/sysdeps/unix/sysv/linux/makedev.c +++ b/misc/makedev.c @@ -16,25 +16,15 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <endian.h> -#include <sys/sysmacros.h> +#include <features.h> -unsigned int -gnu_dev_major (unsigned long long int dev) -{ - return ((dev >> 8) & 0xfff) | ((unsigned int) (dev >> 32) & ~0xfff); -} +#undef __USE_EXTERN_INLINES +#define __SYSMACROS_NEED_IMPLEMENTATION +#include <sys/sysmacros.h> -unsigned int -gnu_dev_minor (unsigned long long int dev) -{ - return (dev & 0xff) | ((unsigned int) (dev >> 12) & ~0xff); -} +#define OUT_OF_LINE_IMPL_TEMPL(rtype, name, proto) \ + rtype gnu_dev_##name proto -unsigned long long int -gnu_dev_makedev (unsigned int major, unsigned int minor) -{ - return ((minor & 0xff) | ((major & 0xfff) << 8) - | (((unsigned long long int) (minor & ~0xff)) << 12) - | (((unsigned long long int) (major & ~0xfff)) << 32)); -} +__SYSMACROS_DEFINE_MAJOR(OUT_OF_LINE_IMPL_TEMPL) +__SYSMACROS_DEFINE_MINOR(OUT_OF_LINE_IMPL_TEMPL) +__SYSMACROS_DEFINE_MAKEDEV(OUT_OF_LINE_IMPL_TEMPL) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index a3c2429..6e9b840 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -77,6 +77,15 @@ #endif /* GCC. */ +/* Compilers that are not clang may object to + #if defined __clang__ && __has_extension(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_extension +# define __glibc_clang_has_extension(ext) __has_extension (ext) +#else +# define __glibc_clang_has_extension(ext) 0 +#endif + /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ #define __P(args) args @@ -249,13 +258,24 @@ # define __attribute_noinline__ /* Ignore */ #endif -/* gcc allows marking deprecated functions. */ +/* Since version 3.2, gcc allows marking deprecated functions. */ #if __GNUC_PREREQ (3,2) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # define __attribute_deprecated__ /* Ignore */ #endif +/* Since version 4.5, gcc also allows one to specify the message printed + when a deprecated function is used. clang claims to be gcc 4.2, but + may also support this feature. */ +#if __GNUC_PREREQ (4,5) || \ + __glibc_clang_has_extension (__attribute_deprecated_with_message__) +# define __attribute_deprecated_msg__(msg) \ + __attribute__ ((__deprecated__ (msg))) +#else +# define __attribute_deprecated_msg__(msg) __attribute_deprecated__ +#endif + /* At some point during the gcc 2.8 development the `format_arg' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. diff --git a/misc/sys/sysmacros.h b/misc/sys/sysmacros.h new file mode 100644 index 0000000..086e9af --- /dev/null +++ b/misc/sys/sysmacros.h @@ -0,0 +1,120 @@ +/* Definitions of macros to access `dev_t' values. + Copyright (C) 1996-2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SYSMACROS_H_OUTER + +#ifndef __SYSMACROS_DEPRECATED_INCLUSION +# define _SYS_SYSMACROS_H_OUTER 1 +#endif + +/* If <sys/sysmacros.h> is included after <sys/types.h>, these macros + will already be defined, and we need to redefine them without the + deprecation warnings. (If they are included in the opposite order, + the outer #ifndef will suppress this entire file and the macros + will be usable without warnings.) */ +#undef major +#undef minor +#undef makedev + +/* This is the macro that must be defined to satisfy the misuse check + in bits/sysmacros.h. */ +#ifndef _SYS_SYSMACROS_H +#define _SYS_SYSMACROS_H 1 + +#include <features.h> +#include <bits/types.h> +#include <bits/sysmacros.h> + +/* The extra "\n " moves gcc's [-Wdeprecated-declarations] annotation + onto the next line. */ +#define __SYSMACROS_DEPRECATION_MSG(symbol) \ + "\n In the GNU C Library, `" #symbol "' is defined by <sys/sysmacros.h>." \ + "\n For historical compatibility, it is currently defined by" \ + "\n <sys/types.h> as well, but we plan to remove this soon." \ + "\n To use `" #symbol "', include <sys/sysmacros.h> directly." \ + "\n If you did not intend to use a system-defined macro `" #symbol "'," \ + "\n you should #undef it after including <sys/types.h>." \ + "\n " + +#define __SYSMACROS_DECL_TEMPL(rtype, name, proto) \ + extern rtype gnu_dev_##name proto __THROW __attribute_const__; + +#define __SYSMACROS_FST_DECL_TEMPL(rtype, name, proto) \ + extern rtype __REDIRECT_NTH (__##name##_from_sys_types, proto, \ + gnu_dev_##name) \ + __attribute_const__ \ + __attribute_deprecated_msg__ (__SYSMACROS_DEPRECATION_MSG (name)); + +#define __SYSMACROS_IMPL_TEMPL(rtype, name, proto) \ + __extension__ __extern_inline __attribute_const__ rtype \ + __NTH (gnu_dev_##name proto) + +#define __SYSMACROS_FST_IMPL_TEMPL(rtype, name, proto) \ + __extension__ __extern_inline __attribute_const__ rtype \ + __NTH (__##name##_from_sys_types proto) + +__BEGIN_DECLS + +__SYSMACROS_DECLARE_MAJOR (__SYSMACROS_DECL_TEMPL) +__SYSMACROS_DECLARE_MINOR (__SYSMACROS_DECL_TEMPL) +__SYSMACROS_DECLARE_MAKEDEV (__SYSMACROS_DECL_TEMPL) + +__SYSMACROS_DECLARE_MAJOR (__SYSMACROS_FST_DECL_TEMPL) +__SYSMACROS_DECLARE_MINOR (__SYSMACROS_FST_DECL_TEMPL) +__SYSMACROS_DECLARE_MAKEDEV (__SYSMACROS_FST_DECL_TEMPL) + +#ifdef __USE_EXTERN_INLINES + +__SYSMACROS_DEFINE_MAJOR (__SYSMACROS_IMPL_TEMPL) +__SYSMACROS_DEFINE_MINOR (__SYSMACROS_IMPL_TEMPL) +__SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_IMPL_TEMPL) + +__SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL) +__SYSMACROS_DEFINE_MINOR (__SYSMACROS_FST_IMPL_TEMPL) +__SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_FST_IMPL_TEMPL) + +#endif + +__END_DECLS + +#endif /* _SYS_SYSMACROS_H */ + +#ifndef __SYSMACROS_NEED_IMPLEMENTATION +# undef __SYSMACROS_DECL_TEMPL +# undef __SYSMACROS_FST_DECL_TEMPL +# undef __SYSMACROS_IMPL_TEMPL +# undef __SYSMACROS_FST_IMPL_TEMPL +# undef __SYSMACROS_DECLARE_MAJOR +# undef __SYSMACROS_DECLARE_MINOR +# undef __SYSMACROS_DECLARE_MAKEDEV +# undef __SYSMACROS_DEFINE_MAJOR +# undef __SYSMACROS_DEFINE_MINOR +# undef __SYSMACROS_DEFINE_MAKEDEV +#endif + +#ifdef __SYSMACROS_DEPRECATED_INCLUSION +# define major(dev) __major_from_sys_types (dev) +# define minor(dev) __minor_from_sys_types (dev) +# define makedev(maj, min) __makedev_from_sys_types (maj, min) +#else +# define major(dev) gnu_dev_major (dev) +# define minor(dev) gnu_dev_minor (dev) +# define makedev(maj, min) gnu_dev_makedev (maj, min) +#endif + +#endif /* sys/sysmacros.h */ diff --git a/misc/tst-makedev.c b/misc/tst-makedev.c new file mode 100644 index 0000000..b330b5a --- /dev/null +++ b/misc/tst-makedev.c @@ -0,0 +1,104 @@ +/* Tests of functions to access `dev_t' values. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/types.h> +#include <sys/sysmacros.h> +#include <stdio.h> +#include <inttypes.h> + +/* Confirm that makedev (major (d), minor (d)) == d. */ +static int +do_test_split_combine (dev_t d1) +{ + unsigned int maj = major (d1); + unsigned int min = minor (d1); + dev_t d2 = makedev (maj, min); + if (d1 != d2) + { + printf ("FAIL: %016" PRIx64 " != %016" PRIx64 " (maj %08x min %08x)\n", + (uint64_t)d2, (uint64_t)d1, maj, min); + return 1; + } + else + return 0; +} + +/* Confirm that major (makedev (maj, min)) == maj and + minor (makedev (maj, min)) == min. */ +static int +do_test_combine_split (unsigned int maj1, unsigned int min1) +{ + dev_t d = makedev (maj1, min1); + unsigned int maj2 = major (d); + unsigned int min2 = minor (d); + if (maj1 != maj2 && min1 != min2) + { + printf ("FAIL: %08x != %08x, %08x != %08x (dev %016" PRIx64 ")\n", + maj2, maj1, min2, min1, (uint64_t)d); + return 1; + } + else if (maj1 != maj2) + { + printf ("FAIL: %08x != %08x, %08x == %08x (dev %016" PRIx64 ")\n", + maj2, maj1, min2, min1, (uint64_t)d); + return 1; + } + else if (min1 != min2) + { + printf ("FAIL: %08x == %08x, %08x != %08x (dev %016" PRIx64 ")\n", + maj2, maj1, min2, min1, (uint64_t)d); + return 1; + } + else + return 0; +} + +static int +do_test (void) +{ + dev_t d; + unsigned int maj, min; + int status = 0; + + /* Test the traditional range (16-bit dev_t, 8-bit each maj/min) + exhaustively. */ + for (d = 0; d <= 0xFFFF; d++) + status |= do_test_split_combine (d); + + for (maj = 0; maj <= 0xFF; maj++) + for (min = 0; min <= 0xFF; min++) + status |= do_test_combine_split (maj, min); + + /* Test glibc's expanded range (64-bit dev_t, 32-bit each maj/min). + Exhaustive testing would take much too long, instead we shift a + pair of 1-bits over each range. */ + { + unsigned int a, b; + for (a = 0; a <= 63; a++) + do_test_split_combine (((dev_t) 0x03) << a); + + for (a = 0; a < 31; a++) + for (b = 0; b <= 31; b++) + do_test_combine_split (0x03u << a, 0x03u << b); + } + + return status; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/misc/tst-preadvwritev-common.c b/misc/tst-preadvwritev-common.c new file mode 100644 index 0000000..2b1e36f --- /dev/null +++ b/misc/tst-preadvwritev-common.c @@ -0,0 +1,111 @@ +/* Common definitions for preadv and pwritev. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <sys/uio.h> + +static void do_prepare (void); +#define PREPARE(argc, argv) do_prepare () +static int do_test (void); +#define TEST_FUNCTION do_test () +#include "test-skeleton.c" + +static char *temp_filename; +static int temp_fd; + +static void +do_prepare (void) +{ + temp_fd = create_temp_file ("tst-preadvwritev.", &temp_filename); + if (temp_fd == -1) + { + printf ("cannot create temporary file: %m\n"); + exit (1); + } +} + +#define FAIL(str) \ + do { printf ("error: %s (line %d)\n", str, __LINE__); return 1; } while (0) + +static int +do_test_with_offset (off_t offset) +{ + struct iovec iov[2]; + ssize_t ret; + + char buf1[32]; + char buf2[64]; + + memset (buf1, 0xf0, sizeof buf1); + memset (buf2, 0x0f, sizeof buf2); + + /* Write two buffer with 32 and 64 bytes respectively. */ + memset (iov, 0, sizeof iov); + iov[0].iov_base = buf1; + iov[0].iov_len = sizeof buf1; + iov[1].iov_base = buf2; + iov[1].iov_len = sizeof buf2; + + ret = pwritev (temp_fd, iov, 2, offset); + if (ret == -1) + FAIL ("first pwritev returned -1"); + if (ret != (sizeof buf1 + sizeof buf2)) + FAIL ("first pwritev returned an unexpected value"); + + ret = pwritev (temp_fd, iov, 2, sizeof buf1 + sizeof buf2 + offset); + if (ret == -1) + FAIL ("second pwritev returned -1"); + if (ret != (sizeof buf1 + sizeof buf2)) + FAIL ("second pwritev returned an unexpected value"); + + char buf3[32]; + char buf4[64]; + + memset (buf3, 0x0f, sizeof buf3); + memset (buf4, 0xf0, sizeof buf4); + + iov[0].iov_base = buf3; + iov[0].iov_len = sizeof buf3; + iov[1].iov_base = buf4; + iov[1].iov_len = sizeof buf4; + + /* Now read two buffer with 32 and 64 bytes respectively. */ + ret = preadv (temp_fd, iov, 2, offset); + if (ret == -1) + FAIL ("first preadv returned -1"); + if (ret != (sizeof buf3 + sizeof buf4)) + FAIL ("first preadv returned an unexpected value"); + + if (memcmp (buf1, buf3, sizeof buf1) != 0) + FAIL ("first buffer from first preadv different than expected"); + if (memcmp (buf2, buf4, sizeof buf2) != 0) + FAIL ("second buffer from first preadv different than expected"); + + ret = preadv (temp_fd, iov, 2, sizeof buf3 + sizeof buf4 + offset); + if (ret == -1) + FAIL ("second preadv returned -1"); + if (ret != (sizeof buf3 + sizeof buf4)) + FAIL ("second preadv returned an unexpected value"); + + /* And compare the buffers read and written to check if there are equal. */ + if (memcmp (buf1, buf3, sizeof buf1) != 0) + FAIL ("first buffer from second preadv different than expected"); + if (memcmp (buf2, buf4, sizeof buf2) != 0) + FAIL ("second buffer from second preadv different than expected"); + + return 0; +} diff --git a/misc/tst-preadvwritev.c b/misc/tst-preadvwritev.c index 08deecc..fb3f129 100644 --- a/misc/tst-preadvwritev.c +++ b/misc/tst-preadvwritev.c @@ -16,99 +16,10 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sys/uio.h> +#include "tst-preadvwritev-common.c" -/* Allow testing of the 64-bit versions as well. */ -#ifndef PREADV -# define PREADV preadv -# define PWRITEV pwritev -#endif - -static void do_prepare (void); -static int do_test (void); -#define PREPARE(argc, argv) do_prepare () -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" - -static char *temp_filename; -static int temp_fd; - -void -do_prepare (void) -{ - temp_fd = create_temp_file ("tst-PREADVwritev.", &temp_filename); - if (temp_fd == -1) - { - printf ("cannot create temporary file: %m\n"); - exit (1); - } -} - -#define FAIL(str) \ - do { printf ("error: %s (line %d)\n", str, __LINE__); return 1; } while (0) - -int +static int do_test (void) { - struct iovec iov[2]; - ssize_t ret; - - char buf1[32]; - char buf2[64]; - - memset (buf1, 0xf0, sizeof buf1); - memset (buf2, 0x0f, sizeof buf2); - - memset (iov, 0, sizeof iov); - iov[0].iov_base = buf1; - iov[0].iov_len = sizeof buf1; - iov[1].iov_base = buf2; - iov[1].iov_len = sizeof buf2; - - ret = PWRITEV (temp_fd, iov, 2, 0); - if (ret == -1) - FAIL ("first PWRITEV returned -1"); - if (ret != (sizeof buf1 + sizeof buf2)) - FAIL ("first PWRITEV returned an unexpected value"); - - ret = PWRITEV (temp_fd, iov, 2, sizeof buf1 + sizeof buf2); - if (ret == -1) - FAIL ("second PWRITEV returned -1"); - if (ret != (sizeof buf1 + sizeof buf2)) - FAIL ("second PWRITEV returned an unexpected value"); - - char buf3[32]; - char buf4[64]; - - memset (buf3, 0x0f, sizeof buf3); - memset (buf4, 0xf0, sizeof buf4); - - iov[0].iov_base = buf3; - iov[0].iov_len = sizeof buf3; - iov[1].iov_base = buf4; - iov[1].iov_len = sizeof buf4; - - ret = PREADV (temp_fd, iov, 2, 0); - if (ret == -1) - FAIL ("first PREADV returned -1"); - if (ret != (sizeof buf3 + sizeof buf4)) - FAIL ("first PREADV returned an unexpected value"); - - if (memcmp (buf1, buf3, sizeof buf1) != 0) - FAIL ("first buffer from first PREADV different than expected"); - if (memcmp (buf2, buf4, sizeof buf2) != 0) - FAIL ("second buffer from first PREADV different than expected"); - - ret = PREADV (temp_fd, iov, 2, sizeof buf3 + sizeof buf4); - if (ret == -1) - FAIL ("second PREADV returned -1"); - if (ret != (sizeof buf3 + sizeof buf4)) - FAIL ("second PREADV returned an unexpected value"); - - if (memcmp (buf1, buf3, sizeof buf1) != 0) - FAIL ("first buffer from second PREADV different than expected"); - if (memcmp (buf2, buf4, sizeof buf2) != 0) - FAIL ("second buffer from second PREADV different than expected"); - - return 0; + return do_test_with_offset (0); } diff --git a/misc/tst-preadvwritev64.c b/misc/tst-preadvwritev64.c index ff6e134..53e153e 100644 --- a/misc/tst-preadvwritev64.c +++ b/misc/tst-preadvwritev64.c @@ -16,7 +16,36 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#define PREADV preadv64 -#define PWRITEV pwritev64 +#define _FILE_OFFSET_BITS 64 +#include "tst-preadvwritev-common.c" -#include "tst-preadvwritev.c" +static int +do_test (void) +{ + int ret; + + ret = do_test_with_offset (0); + + /* Create a sparse file larger than 4GB to check if offset is handled + correctly in p{write,read}v64. */ + off_t base_offset = UINT32_MAX + 2048LL; + ret += do_test_with_offset (base_offset); + + struct stat st; + if (fstat (temp_fd, &st) == -1) + { + printf ("error: fstat on temporary file failed: %m"); + return 1; + } + + /* The total size should base_offset plus 2 * 96. */ + off_t expected_value = base_offset + (2 * (96LL)); + if (st.st_size != expected_value) + { + printf ("error: file size different than expected (%jd != %jd)\n", + (intmax_t) expected_value, (intmax_t) st.st_size); + return 1; + } + + return ret; +} diff --git a/nptl/Makefile b/nptl/Makefile index 6322107..2ddcd2b 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -290,7 +290,7 @@ tests = tst-typesizes \ tst-initializers1 $(addprefix tst-initializers1-,\ c89 gnu89 c99 gnu99 c11 gnu11) \ tst-bad-schedattr \ - tst-thread_local1 tst-mutex-errorcheck + tst-thread_local1 tst-mutex-errorcheck tst-robust10 xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \ tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 test-srcs = tst-oddstacklimit @@ -321,8 +321,8 @@ tests += tst-cancelx2 tst-cancelx3 tst-cancelx4 tst-cancelx5 \ tst-cleanupx0 tst-cleanupx1 tst-cleanupx2 tst-cleanupx3 tst-cleanupx4 \ tst-oncex3 tst-oncex4 ifeq ($(build-shared),yes) -tests += tst-atfork2 tst-tls3 tst-tls4 tst-tls5 tst-_res1 tst-fini1 \ - tst-stackguard1 +tests += tst-atfork2 tst-tls3 tst-tls3-malloc tst-tls4 tst-tls5 tst-_res1 \ + tst-fini1 tst-stackguard1 tests-nolibpthread += tst-fini1 ifeq ($(have-z-execstack),yes) tests += tst-execstack @@ -529,6 +529,10 @@ LDFLAGS-tst-tls3 = -rdynamic $(objpfx)tst-tls3.out: $(objpfx)tst-tls3mod.so $(objpfx)tst-tls3mod.so: $(shared-thread-library) +$(objpfx)tst-tls3-malloc: $(libdl) $(shared-thread-library) +LDFLAGS-tst-tls3-malloc = -rdynamic +$(objpfx)tst-tls3-malloc.out: $(objpfx)tst-tls3mod.so + $(objpfx)tst-tls4: $(libdl) $(shared-thread-library) $(objpfx)tst-tls4.out: $(objpfx)tst-tls4moda.so $(objpfx)tst-tls4modb.so diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 6b42b11..60b34dc 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -245,9 +245,7 @@ get_cached_stack (size_t *sizep, void **memp) /* Clear the DTV. */ dtv_t *dtv = GET_DTV (TLS_TPADJ (result)); for (size_t cnt = 0; cnt < dtv[-1].counter; ++cnt) - if (! dtv[1 + cnt].pointer.is_static - && dtv[1 + cnt].pointer.val != TLS_DTV_UNALLOCATED) - free (dtv[1 + cnt].pointer.val); + free (dtv[1 + cnt].pointer.to_free); memset (dtv, '\0', (dtv[-1].counter + 1) * sizeof (dtv_t)); /* Re-initialize the TLS. */ diff --git a/nptl/lowlevelrobustlock.c b/nptl/lowlevelrobustlock.c index 3b988b2..efe307e 100644 --- a/nptl/lowlevelrobustlock.c +++ b/nptl/lowlevelrobustlock.c @@ -118,8 +118,11 @@ __lll_robust_timedlock_wait (int *futex, const struct timespec *abstime, || !defined lll_futex_timed_wait_bitset) lll_futex_timed_wait (futex, newval, &rt, private); #else - lll_futex_timed_wait_bitset (futex, newval, abstime, - FUTEX_CLOCK_REALTIME, private); + int err = lll_futex_timed_wait_bitset (futex, newval, abstime, + FUTEX_CLOCK_REALTIME, private); + /* The futex call timed out. */ + if (err == -ETIMEDOUT) + return -err; #endif try: diff --git a/nptl/tst-cancel4-common.c b/nptl/tst-cancel4-common.c index f235d53..7cb5411 100644 --- a/nptl/tst-cancel4-common.c +++ b/nptl/tst-cancel4-common.c @@ -44,6 +44,12 @@ do_test (void) } setsockopt (fds[1], SOL_SOCKET, SO_SNDBUF, &val, sizeof(val)); + if (mktemp (fifoname) == NULL) + { + printf ("%s: cannot generate temp file name: %m\n", __func__); + exit (1); + } + int result = 0; size_t cnt; for (cnt = 0; cnt < ntest_tf; ++cnt) @@ -71,7 +77,7 @@ do_test (void) int r = pthread_barrier_wait (&b2); if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) { - printf ("%s: barrier_wait failed\n", __FUNCTION__); + printf ("%s: barrier_wait failed\n", __func__); result = 1; continue; } @@ -169,7 +175,7 @@ do_test (void) int r = pthread_barrier_wait (&b2); if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) { - printf ("%s: barrier_wait failed\n", __FUNCTION__); + printf ("%s: barrier_wait failed\n", __func__); result = 1; continue; } @@ -184,7 +190,7 @@ do_test (void) r = pthread_barrier_wait (&b2); if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) { - printf ("%s: barrier_wait failed\n", __FUNCTION__); + printf ("%s: barrier_wait failed\n", __func__); result = 1; continue; } diff --git a/nptl/tst-cancel4-common.h b/nptl/tst-cancel4-common.h index e1683c4..06ed0dc 100644 --- a/nptl/tst-cancel4-common.h +++ b/nptl/tst-cancel4-common.h @@ -67,6 +67,22 @@ cl (void *arg) ++cl_called; } +/* Named pipe used to check for blocking open. It should be closed + after the cancellation handling. */ +static char fifoname[] = "/tmp/tst-cancel4-fifo-XXXXXX"; +static int fifofd; + +static void +__attribute__ ((used)) +cl_fifo (void *arg) +{ + ++cl_called; + + unlink (fifoname); + close (fifofd); + fifofd = -1; +} + struct cancel_tests { const char *name; diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c index 4221af4..fd0ab40 100644 --- a/nptl/tst-cancel4.c +++ b/nptl/tst-cancel4.c @@ -36,8 +36,6 @@ #include <sys/poll.h> #include <sys/wait.h> -#include "pthreadP.h" - /* Since STREAMS are not supported in the standard Linux kernel and there we don't advertise STREAMS as supported is no need to test @@ -67,6 +65,7 @@ #include "tst-cancel4-common.h" + #ifndef IPC_ADDVAL # define IPC_ADDVAL 0 #endif @@ -734,13 +733,7 @@ tf_sigpause (void *arg) pthread_cleanup_push (cl, NULL); -#ifdef SIGCANCEL - /* Just for fun block the cancellation signal. We need to use - __xpg_sigpause since otherwise we will get the BSD version. */ - __xpg_sigpause (SIGCANCEL); -#else - pause (); -#endif + sigpause (sigmask (SIGINT)); pthread_cleanup_pop (0); @@ -1348,27 +1341,34 @@ static void * tf_open (void *arg) { if (arg == NULL) - // XXX If somebody can provide a portable test case in which open() - // blocks we can enable this test to run in both rounds. - abort (); - - int r = pthread_barrier_wait (&b2); - if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) { - printf ("%s: barrier_wait failed\n", __FUNCTION__); - exit (1); + fifofd = mkfifo (fifoname, S_IWUSR | S_IRUSR); + if (fifofd == -1) + { + printf ("%s: mkfifo failed: %m\n", __func__); + exit (1); + } + } + else + { + int r = pthread_barrier_wait (&b2); + if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) + { + printf ("%s: barrier_wait failed: %m\n", __func__); + exit (1); + } } - r = pthread_barrier_wait (&b2); + int r = pthread_barrier_wait (&b2); if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) { - printf ("%s: 2nd barrier_wait failed\n", __FUNCTION__); + printf ("%s: 2nd barrier_wait failed: %m\n", __func__); exit (1); } - pthread_cleanup_push (cl, NULL); + pthread_cleanup_push (cl_fifo, NULL); - open ("Makefile", O_RDONLY); + open (arg ? "Makefile" : fifoname, O_RDONLY); pthread_cleanup_pop (0); diff --git a/nptl/tst-robust10.c b/nptl/tst-robust10.c new file mode 100644 index 0000000..6d9e502 --- /dev/null +++ b/nptl/tst-robust10.c @@ -0,0 +1,110 @@ +/* Test that pthread_mutex_timedlock properly times out. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <pthread.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> + +pthread_mutex_t mutex; + +static void * +thr (void *arg) +{ + struct timespec abstime; + clock_gettime (CLOCK_REALTIME, &abstime); + abstime.tv_sec += 1; + int ret = pthread_mutex_timedlock (&mutex, &abstime); + if (ret == 0) + { + puts ("mutex_timedlock didn't fail"); + exit (1); + } + if (ret != ETIMEDOUT) + { + printf ("mutex_timedlock failed: %s\n", strerror (ret)); + exit (1); + } + + return 0; +} + +static int +do_test (void) +{ + pthread_t pt; + pthread_mutexattr_t ma; + + if (pthread_mutexattr_init (&ma) != 0) + { + puts ("mutexattr_init failed"); + return 0; + } + if (pthread_mutexattr_setrobust_np (&ma, PTHREAD_MUTEX_ROBUST_NP) != 0) + { + puts ("mutexattr_setrobust failed"); + return 1; + } + if (pthread_mutex_init (&mutex, &ma)) + { + puts ("mutex_init failed"); + return 1; + } + + if (pthread_mutexattr_destroy (&ma)) + { + puts ("mutexattr_destroy failed"); + return 1; + } + + if (pthread_mutex_lock (&mutex)) + { + puts ("mutex_lock failed"); + return 1; + } + + if (pthread_create (&pt, NULL, thr, NULL)) + { + puts ("pthread_create failed"); + return 1; + } + + if (pthread_join (pt, NULL)) + { + puts ("pthread_join failed"); + return 1; + } + + if (pthread_mutex_unlock (&mutex)) + { + puts ("mutex_unlock failed"); + return 1; + } + + if (pthread_mutex_destroy (&mutex)) + { + puts ("mutex_destroy failed"); + return 1; + } + + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/nptl/tst-tls3-malloc.c b/nptl/tst-tls3-malloc.c new file mode 100644 index 0000000..5eab3cd --- /dev/null +++ b/nptl/tst-tls3-malloc.c @@ -0,0 +1,176 @@ +/* Test TLS allocation with an interposed malloc. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* Reuse the test. */ +#include "tst-tls3.c" + +#include <sys/mman.h> + +/* Interpose a minimal malloc implementation. This implementation + deliberately interposes just a restricted set of symbols, to detect + if the TLS code bypasses the interposed malloc. */ + +/* Lock to guard malloc internals. */ +static pthread_mutex_t malloc_lock = PTHREAD_MUTEX_INITIALIZER; + +/* Information about an allocation chunk. */ +struct malloc_chunk +{ + /* Start of the allocation. */ + void *start; + /* Size of the allocation. */ + size_t size; +}; + +enum { malloc_chunk_count = 1000 }; +static struct malloc_chunk chunks[malloc_chunk_count]; + +/* Lock the malloc lock. */ +static void +xlock (void) +{ + int ret = pthread_mutex_lock (&malloc_lock); + if (ret != 0) + { + errno = ret; + printf ("error: pthread_mutex_lock: %m\n"); + _exit (1); + } +} + +/* Unlock the malloc lock. */ +static void +xunlock (void) +{ + int ret = pthread_mutex_unlock (&malloc_lock); + if (ret != 0) + { + errno = ret; + printf ("error: pthread_mutex_unlock: %m\n"); + _exit (1); + } +} + +/* Internal malloc without locking and registration. */ +static void * +malloc_internal (size_t size) +{ + void *result = mmap (NULL, size, PROT_READ | PROT_WRITE, + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + if (result == MAP_FAILED) + { + printf ("error: mmap: %m\n"); + _exit (1); + } + return result; +} + +void * +malloc (size_t size) +{ + if (size == 0) + size = 1; + xlock (); + void *result = malloc_internal (size); + for (int i = 0; i < malloc_chunk_count; ++i) + if (chunks[i].start == NULL) + { + chunks[i].start = result; + chunks[i].size = size; + xunlock (); + return result; + } + xunlock (); + printf ("error: no place to store chunk pointer\n"); + _exit (1); +} + +void * +calloc (size_t a, size_t b) +{ + if (b != 0 && a > SIZE_MAX / b) + return NULL; + /* malloc uses mmap, which provides zeroed memory. */ + return malloc (a * b); +} + +static void +xunmap (void *ptr, size_t size) +{ + int ret = munmap (ptr, size); + if (ret < 0) + { + printf ("error: munmap (%p, %zu) failed: %m\n", ptr, size); + _exit (1); + } +} + +void +free (void *ptr) +{ + if (ptr == NULL) + return; + + xlock (); + for (int i = 0; i < malloc_chunk_count; ++i) + if (chunks[i].start == ptr) + { + xunmap (ptr, chunks[i].size); + chunks[i] = (struct malloc_chunk) {}; + xunlock (); + return; + } + xunlock (); + printf ("error: tried to free non-allocated pointer %p\n", ptr); + _exit (1); +} + +void * +realloc (void *old, size_t size) +{ + if (old != NULL) + { + xlock (); + for (int i = 0; i < malloc_chunk_count; ++i) + if (chunks[i].start == old) + { + size_t old_size = chunks[i].size; + void *result; + if (old_size < size) + { + result = malloc_internal (size); + /* Reuse the slot for the new allocation. */ + memcpy (result, old, old_size); + xunmap (old, old_size); + chunks[i].start = result; + chunks[i].size = size; + } + else + /* Old size is not smaller, so reuse the old + allocation. */ + result = old; + xunlock (); + return result; + } + xunlock (); + printf ("error: tried to realloc non-allocated pointer %p\n", old); + _exit (1); + } + else + return malloc (size); +} diff --git a/nptl_db/Makefile b/nptl_db/Makefile index 849a73f..bc20440 100644 --- a/nptl_db/Makefile +++ b/nptl_db/Makefile @@ -26,7 +26,7 @@ nptl_db-version = 1.0 extra-libs = libthread_db extra-libs-others := $(extra-libs) -headers = thread_db.h sys/procfs.h +headers = proc_service.h thread_db.h sys/procfs.h libthread_db-routines = td_init td_log td_ta_new td_ta_delete \ td_ta_get_nthreads td_ta_get_ph \ diff --git a/nptl_db/proc_service.h b/nptl_db/proc_service.h index c1c139f..109962d 100644 --- a/nptl_db/proc_service.h +++ b/nptl_db/proc_service.h @@ -16,9 +16,14 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#ifndef _PROC_SERVICE_H +#define _PROC_SERVICE_H 1 + /* The definitions in this file must correspond to those in the debugger. */ #include <sys/procfs.h> +__BEGIN_DECLS + /* Functions in this interface return one of these status codes. */ typedef enum { @@ -64,7 +69,7 @@ extern pid_t ps_getpid (struct ps_prochandle *); /* Fetch the special per-thread address associated with the given LWP. This call is only used on a few platforms (most use a normal register). The meaning of the `int' parameter is machine-dependent. */ -extern ps_err_e ps_get_thread_area (const struct ps_prochandle *, +extern ps_err_e ps_get_thread_area (struct ps_prochandle *, lwpid_t, int, psaddr_t *); @@ -78,9 +83,13 @@ extern ps_err_e ps_pglobal_lookup (struct ps_prochandle *, /* Stop or continue the entire process. */ -extern ps_err_e ps_pstop (const struct ps_prochandle *); -extern ps_err_e ps_pcontinue (const struct ps_prochandle *); +extern ps_err_e ps_pstop (struct ps_prochandle *); +extern ps_err_e ps_pcontinue (struct ps_prochandle *); /* Stop or continue the given LWP alone. */ -extern ps_err_e ps_lstop (const struct ps_prochandle *, lwpid_t); -extern ps_err_e ps_lcontinue (const struct ps_prochandle *, lwpid_t); +extern ps_err_e ps_lstop (struct ps_prochandle *, lwpid_t); +extern ps_err_e ps_lcontinue (struct ps_prochandle *, lwpid_t); + +__END_DECLS + +#endif /* proc_service.h */ @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU libc 2.22-pre1\n" "POT-Creation-Date: 2015-07-31 00:10-0400\n" -"PO-Revision-Date: 2015-08-31 18:30+0200\n" +"PO-Revision-Date: 2016-04-22 18:44+0200\n" "Last-Translator: Jochen Hein <jochen@jochen.org>\n" "Language-Team: German <translation-team-de@lists.sourceforge.net>\n" "Language: de\n" @@ -4479,13 +4479,13 @@ msgstr "" "%15s Cache ist dauerhaft\n" "%15s Cache wird gemeinsam verwendet\n" "%15Zu vorgeschlagene Größe\n" -"%15Zu Gesamtröße des Data-Pools\n" +"%15Zu Gesamtgröße des Data-Pools\n" "%15Zu Benutzter Speicher im Data-Pool\n" "%15lu Time to Live für positive Einträge in Sekunden\n" "%15lu Time to Live für negative Einträge in Sekunden\n" "%15<PRIuMAX> Cache-Hits bei positiven Einträgen\n" "%15<PRIuMAX> Cache-Hits bei positiven Einträgen\n" -"%15<PRIuMAX> Cache-Misses bei positiven Einträgen\n" +"%15<PRIuMAX> Cache-Misses bei positiven Einträgen\n" "%15<PRIuMAX> Cache-Misses bei negativen Einträgen\n" "%15lu%% Cache-Hit Verhältnis\n" "%15zu aktuelle Anzahl der Werte im Cache\n" @@ -24,16 +24,16 @@ # msgid "" msgstr "" -"Project-Id-Version: libc 2.21-pre1\n" +"Project-Id-Version: libc 2.22-pre1\n" "POT-Creation-Date: 2015-07-31 00:10-0400\n" -"PO-Revision-Date: 2015-07-28 20:29+0300\n" +"PO-Revision-Date: 2016-05-26 21:14+0300\n" "Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n" "Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.3\n" +"X-Generator: Poedit 1.8.7\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: argp/argp-help.c:227 @@ -126,7 +126,7 @@ msgid "%s%s%s:%u: %s%sUnexpected error: %s.\n" msgstr "%s%s%s:%u: %s%sOdottamaton virhe: %s.\n" #: assert/assert.c:101 -#, fuzzy, c-format +#, c-format msgid "" "%s%s%s:%u: %s%sAssertion `%s' failed.\n" "%n" @@ -169,12 +169,12 @@ msgstr "" #: malloc/memusagestat.c:563 nss/getent.c:973 nss/makedb.c:369 #: posix/getconf.c:486 sunrpc/rpcinfo.c:691 #: sysdeps/unix/sysv/linux/lddlibc4.c:61 -#, fuzzy, c-format +#, c-format msgid "" "For bug reporting instructions, please see:\n" "%s.\n" msgstr "" -"Ohjeet ohjelmistovioista ilmoittamiseen ovat osoitteessa\n" +"Katso ohjeet vikailmoitusten tekemiseen osoitteesta:\n" "%s.\n" #: catgets/gencat.c:245 debug/pcprofiledump.c:225 debug/xtrace.sh:64 @@ -321,9 +321,8 @@ msgstr "Käyttö: xtrace [VALITSIN]... OHJELMA [OHJELMANVALITSIN]...\\n" #: debug/xtrace.sh:32 elf/sotruss.sh:56 elf/sotruss.sh:67 elf/sotruss.sh:135 #: malloc/memusage.sh:26 -#, fuzzy msgid "Try \\`%s --help' or \\`%s --usage' for more information.\\n" -msgstr "Kokeile ”%s --help” tai ”%s --usage” saadaksesi lisää tietoa.\n" +msgstr "Kokeile ”%s --help” tai ”%s --usage” saadaksesi lisää tietoa.\\n" #: debug/xtrace.sh:38 #, fuzzy @@ -594,9 +593,8 @@ msgid "cannot enable executable stack as shared object requires" msgstr "jaettua objektikahvaa ei voi luoda" #: elf/dl-load.c:1339 -#, fuzzy msgid "cannot close file descriptor" -msgstr "tiedostoa %s ei voi sulkea" +msgstr "tiedostokahvaa ei voi sulkea" #: elf/dl-load.c:1568 msgid "file too short" @@ -796,9 +794,8 @@ msgid "Format to use: new, old or compat (default)" msgstr "Käytettävä muoto: ”new”, ”old” tai ”compat” (oletus)" #: elf/ldconfig.c:151 -#, fuzzy msgid "Ignore auxiliary cache file" -msgstr "Käytä CACHEa välimuistitiedostona" +msgstr "Jätä huomiotta apuvälimuistitiedosto" #: elf/ldconfig.c:159 msgid "Configure Dynamic Linker Run Time Bindings." @@ -1087,9 +1084,9 @@ msgid "invalid process ID '%s'" msgstr "virheellinen prosessi-ID ”%s”" #: elf/pldd.c:120 -#, fuzzy, c-format +#, c-format msgid "cannot open %s" -msgstr "laitetta %s ei voi avata" +msgstr "tiedostoa %s ei voi avata" #: elf/pldd.c:152 #, fuzzy, c-format @@ -1102,24 +1099,24 @@ msgid "cannot prepare reading %s/task" msgstr "ei voi avata laitetta %s lukutilaan" #: elf/pldd.c:168 -#, fuzzy, c-format +#, c-format msgid "invalid thread ID '%s'" -msgstr "virheellinen prosessi-ID ”%s”" +msgstr "virheellinen säie-ID ”%s”" #: elf/pldd.c:179 -#, fuzzy, c-format +#, c-format msgid "cannot attach to process %lu" -msgstr "tiedostoa ”%s” ei voi avata" +msgstr "ei voida kiinnittyä prosessiin %lu" #: elf/pldd.c:294 #, c-format msgid "cannot get information about process %lu" -msgstr "" +msgstr "tietojen saaminen prosessista %lu ei onnistu" #: elf/pldd.c:307 -#, fuzzy, c-format +#, c-format msgid "process %lu is no ELF program" -msgstr "ohjelma %lu ei ole käytettävissä\n" +msgstr "prosessi %lu ei ole ELF-ohjelma" #: elf/readelflib.c:34 #, c-format @@ -1203,7 +1200,7 @@ msgstr "%s kohde ei saa olla hakemisto\n" #: elf/sln.c:184 #, c-format msgid "%s: failed to remove the old destination\n" -msgstr "" +msgstr "%s: vanhan kohteen poistaminen epäonnistui\n" #: elf/sln.c:192 #, c-format @@ -1237,9 +1234,8 @@ msgid "Mandatory arguments to long options are also mandatory for any correspond msgstr "Pakolliset argumentit pitkille valitsimille ovat pakollisia kaikille vastaaville lyhyille valitsimille.\\n" #: elf/sotruss.sh:55 -#, fuzzy msgid "%s: option requires an argument -- '%s'\\n" -msgstr "%s: valitsin ”%s” vaatii argumentin\n" +msgstr "%s: valitsin vaatii argumentin -- ”%c”\\n" #: elf/sotruss.sh:61 msgid "%s: option is ambiguous; possibilities:" @@ -1507,7 +1503,6 @@ msgid "unknown iconv() error %d" msgstr "tuntematon iconv()-virhe %d" #: iconv/iconv_prog.c:791 -#, fuzzy msgid "" "The following list contains all the coded character sets known. This does\n" "not necessarily mean that all combinations of these names can be used for\n" @@ -1516,9 +1511,9 @@ msgid "" "\n" " " msgstr "" -"Seuraavassa listassa ovat kaikki tunnetut koodatut merkistöt. Se ei\n" +"Seuraavassa listassa ovat kaikki tunnetut koodatut merkistöt. Tämä ei\n" "kuitenkaan välttämättä tarkoita sitä, että kaikkia näiden nimien\n" -"yhdistelmiä voidaan käyttää FROM- ja TO-komentoriviparametreina. Yksi\n" +"yhdistelmiä voisi käyttää FROM- ja TO-komentoriviparametreina. Yksi\n" "koodattu merkistö voi olla listalla useilla eri nimillä (aliaksilla).\n" "\n" " " @@ -2733,14 +2728,12 @@ msgid "locale.alias file to consult when making archive" msgstr "Arkistoa luotaessa käytettävä locale.alias-tiedosto" #: locale/programs/localedef.c:150 -#, fuzzy msgid "Generate little-endian output" -msgstr "Tuota little-endian-koodia" +msgstr "Tuota little-endian-muotoa" #: locale/programs/localedef.c:152 -#, fuzzy msgid "Generate big-endian output" -msgstr "Tuota big-endian-koodia" +msgstr "Tuota big-endian-muotoa" #: locale/programs/localedef.c:157 msgid "Compile locale specification" @@ -4275,10 +4268,9 @@ msgid "" msgstr "" #: nscd/nscd.c:635 -#, fuzzy, c-format -#| msgid "lstat failed" +#, c-format msgid "'wait' failed\n" -msgstr "tiedoston tilan luku epäonnistui" +msgstr "”wait” epäonnistui\n" #: nscd/nscd.c:642 #, c-format @@ -4670,9 +4662,9 @@ msgid "cannot create temporary file" msgstr "tilapäistä tiedostoa ei voi luoda" #: nss/makedb.c:304 -#, fuzzy, c-format +#, c-format msgid "cannot stat newly created file" -msgstr "tiedoston ”%s” tilaa ei voi lukea: %s" +msgstr "juuri luodun tiedoston tilaa ei voi lukea" #: nss/makedb.c:315 #, c-format @@ -4680,9 +4672,9 @@ msgid "cannot rename temporary file" msgstr "tilapäistä tiedostoa ei voi nimetä uudelleen" #: nss/makedb.c:531 nss/makedb.c:554 -#, fuzzy, c-format +#, c-format msgid "cannot create search tree" -msgstr "hakupolulle ei voi luoda välimuistia" +msgstr "hakupuuta ei voi luoda" #: nss/makedb.c:560 msgid "duplicate key" @@ -4699,9 +4691,9 @@ msgid "failed to write new database file" msgstr "uuden tietokantatiedoston kirjoittaminen epäonnistui" #: nss/makedb.c:812 -#, fuzzy, c-format +#, c-format msgid "cannot stat database file" -msgstr "tiedoston ”%s” tilaa ei voi lukea: %s" +msgstr "tietokantatiedoston tilaa ei voi lukea" #: nss/makedb.c:817 #, fuzzy, c-format @@ -4709,9 +4701,9 @@ msgid "cannot map database file" msgstr "Karttatietokannassa ei ole enempää tietueita" #: nss/makedb.c:820 -#, fuzzy, c-format +#, c-format msgid "file not a database file" -msgstr "luettaessa profilointidatatiedoston tilaa" +msgstr "tiedosto ei ole tietokantatiedosto" #: nss/makedb.c:871 #, fuzzy, c-format @@ -4726,7 +4718,7 @@ msgstr "Käyttö: %s [-v määrittely] muuttujanimi [polku]\n" #: posix/getconf.c:403 #, c-format msgid " %s -a [pathname]\n" -msgstr "" +msgstr " %s -a [polku]\n" #: posix/getconf.c:479 #, c-format @@ -5094,11 +5086,11 @@ msgstr "Laitetta irrotettu" #: stdio-common/psiginfo.c:139 msgid "Signal sent by kill()" -msgstr "" +msgstr "Signaalin lähetti kill()" #: stdio-common/psiginfo.c:142 msgid "Signal sent by sigqueue()" -msgstr "" +msgstr "Signaalin lähetti sigqueue()" #: stdio-common/psiginfo.c:145 msgid "Signal generated by the expiration of a timer" @@ -5114,7 +5106,7 @@ msgstr "" #: stdio-common/psiginfo.c:157 msgid "Signal sent by tkill()" -msgstr "" +msgstr "Signaalin lähetti tkill()" #: stdio-common/psiginfo.c:162 msgid "Signal generated by the completion of an asynchronous name lookup request" @@ -5296,9 +5288,8 @@ msgid "Failed (unspecified error)" msgstr "Epäonnistui (määrittelemätön virhe)" #: sunrpc/clnt_raw.c:115 -#, fuzzy msgid "clnt_raw.c: fatal header serialization error" -msgstr "clnt_raw.c: vakava otsikon serialisointivirhe" +msgstr "clnt_raw.c: vakava otsikon sarjallistamisvirhe" #: sunrpc/pm_getmaps.c:77 msgid "pmap_getmaps.c: rpc problem" @@ -6825,9 +6816,8 @@ msgid "Interrupted by a signal" msgstr "Signaalin keskeyttämä" #: sysdeps/posix/gai_strerror-strs.h:17 -#, fuzzy msgid "Parameter string not correctly encoded" -msgstr "Parametrimerkkijono on väärin koodattu" +msgstr "Parametrimerkkijono ei ole koodattu oikein" #: sysdeps/unix/sysv/linux/i386/readelflib.c:65 #, c-format diff --git a/po/libc.pot b/po/libc.pot index 927aa37..7f54448 100644 --- a/po/libc.pot +++ b/po/libc.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: libc 2.23.90\n" -"POT-Creation-Date: 2016-02-18 17:26-0200\n" +"POT-Creation-Date: 2016-08-01 21:16-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -66,8 +66,7 @@ msgid "Give a short usage message" msgstr "" #: argp/argp-parse.c:103 catgets/gencat.c:109 catgets/gencat.c:113 -#: iconv/iconv_prog.c:60 iconv/iconv_prog.c:61 nscd/nscd.c:105 -#: nss/makedb.c:120 +#: iconv/iconv_prog.c:60 iconv/iconv_prog.c:61 nscd/nscd.c:105 nss/makedb.c:120 msgid "NAME" msgstr "" @@ -137,12 +136,12 @@ msgid "" "[OUTPUT-FILE [INPUT-FILE]...]" msgstr "" -#: catgets/gencat.c:229 debug/pcprofiledump.c:209 elf/ldconfig.c:307 +#: catgets/gencat.c:229 debug/pcprofiledump.c:209 elf/ldconfig.c:308 #: elf/pldd.c:252 elf/sln.c:85 elf/sprof.c:372 iconv/iconv_prog.c:408 #: iconv/iconvconfig.c:379 locale/programs/locale.c:277 -#: locale/programs/localedef.c:376 login/programs/pt_chown.c:89 +#: locale/programs/localedef.c:366 login/programs/pt_chown.c:89 #: malloc/memusagestat.c:563 nss/getent.c:913 nss/makedb.c:369 -#: posix/getconf.c:486 sunrpc/rpcinfo.c:676 +#: posix/getconf.c:503 sunrpc/rpcinfo.c:676 #: sysdeps/unix/sysv/linux/lddlibc4.c:61 #, c-format msgid "" @@ -151,12 +150,12 @@ msgid "" msgstr "" #: catgets/gencat.c:245 debug/pcprofiledump.c:225 debug/xtrace.sh:64 -#: elf/ldconfig.c:323 elf/ldd.bash.in:38 elf/pldd.c:268 elf/sotruss.sh:75 +#: elf/ldconfig.c:324 elf/ldd.bash.in:38 elf/pldd.c:268 elf/sotruss.sh:75 #: elf/sprof.c:389 iconv/iconv_prog.c:425 iconv/iconvconfig.c:396 -#: locale/programs/locale.c:294 locale/programs/localedef.c:402 -#: login/programs/pt_chown.c:63 malloc/memusage.sh:71 -#: malloc/memusagestat.c:581 nscd/nscd.c:509 nss/getent.c:86 nss/makedb.c:385 -#: posix/getconf.c:468 sysdeps/unix/sysv/linux/lddlibc4.c:68 +#: locale/programs/locale.c:294 locale/programs/localedef.c:392 +#: login/programs/pt_chown.c:63 malloc/memusage.sh:71 malloc/memusagestat.c:581 +#: nscd/nscd.c:509 nss/getent.c:86 nss/makedb.c:385 posix/getconf.c:485 +#: sysdeps/unix/sysv/linux/lddlibc4.c:68 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" @@ -165,11 +164,11 @@ msgid "" msgstr "" #: catgets/gencat.c:250 debug/pcprofiledump.c:230 debug/xtrace.sh:68 -#: elf/ldconfig.c:328 elf/pldd.c:273 elf/sprof.c:395 iconv/iconv_prog.c:430 +#: elf/ldconfig.c:329 elf/pldd.c:273 elf/sprof.c:395 iconv/iconv_prog.c:430 #: iconv/iconvconfig.c:401 locale/programs/locale.c:299 -#: locale/programs/localedef.c:407 malloc/memusage.sh:75 +#: locale/programs/localedef.c:397 malloc/memusage.sh:75 #: malloc/memusagestat.c:586 nscd/nscd.c:514 nss/getent.c:91 nss/makedb.c:390 -#: posix/getconf.c:473 +#: posix/getconf.c:490 #, c-format msgid "Written by %s.\n" msgstr "" @@ -371,7 +370,7 @@ msgstr "" msgid ", OS ABI: %s %d.%d.%d" msgstr "" -#: elf/cache.c:157 elf/ldconfig.c:1340 +#: elf/cache.c:157 elf/ldconfig.c:1341 #, c-format msgid "Can't open cache file %s\n" msgstr "" @@ -622,11 +621,11 @@ msgstr "" msgid "cannot map zero-fill pages" msgstr "" -#: elf/dl-lookup.c:845 +#: elf/dl-lookup.c:849 msgid "relocation error" msgstr "" -#: elf/dl-lookup.c:872 +#: elf/dl-lookup.c:875 msgid "symbol lookup error" msgstr "" @@ -658,16 +657,16 @@ msgstr "" msgid "cannot make segment writable for relocation" msgstr "" -#: elf/dl-reloc.c:276 +#: elf/dl-reloc.c:277 #, c-format msgid "%s: out of memory to store relocation results for %s\n" msgstr "" -#: elf/dl-reloc.c:292 +#: elf/dl-reloc.c:293 msgid "cannot restore segment prot after reloc" msgstr "" -#: elf/dl-reloc.c:323 +#: elf/dl-reloc.c:324 msgid "cannot apply additional memory protection after relocation" msgstr "" @@ -687,222 +686,222 @@ msgstr "" msgid "cannot allocate version reference table" msgstr "" -#: elf/ldconfig.c:141 +#: elf/ldconfig.c:142 msgid "Print cache" msgstr "" -#: elf/ldconfig.c:142 +#: elf/ldconfig.c:143 msgid "Generate verbose messages" msgstr "" -#: elf/ldconfig.c:143 +#: elf/ldconfig.c:144 msgid "Don't build cache" msgstr "" -#: elf/ldconfig.c:144 -msgid "Don't generate links" +#: elf/ldconfig.c:145 +msgid "Don't update symbolic links" msgstr "" -#: elf/ldconfig.c:145 +#: elf/ldconfig.c:146 msgid "Change to and use ROOT as root directory" msgstr "" -#: elf/ldconfig.c:145 +#: elf/ldconfig.c:146 msgid "ROOT" msgstr "" -#: elf/ldconfig.c:146 +#: elf/ldconfig.c:147 msgid "CACHE" msgstr "" -#: elf/ldconfig.c:146 +#: elf/ldconfig.c:147 msgid "Use CACHE as cache file" msgstr "" -#: elf/ldconfig.c:147 +#: elf/ldconfig.c:148 msgid "CONF" msgstr "" -#: elf/ldconfig.c:147 +#: elf/ldconfig.c:148 msgid "Use CONF as configuration file" msgstr "" -#: elf/ldconfig.c:148 +#: elf/ldconfig.c:149 msgid "" "Only process directories specified on the command line. Don't build cache." msgstr "" -#: elf/ldconfig.c:149 +#: elf/ldconfig.c:150 msgid "Manually link individual libraries." msgstr "" -#: elf/ldconfig.c:150 +#: elf/ldconfig.c:151 msgid "FORMAT" msgstr "" -#: elf/ldconfig.c:150 +#: elf/ldconfig.c:151 msgid "Format to use: new, old or compat (default)" msgstr "" -#: elf/ldconfig.c:151 +#: elf/ldconfig.c:152 msgid "Ignore auxiliary cache file" msgstr "" -#: elf/ldconfig.c:159 +#: elf/ldconfig.c:160 msgid "Configure Dynamic Linker Run Time Bindings." msgstr "" -#: elf/ldconfig.c:346 +#: elf/ldconfig.c:347 #, c-format msgid "Path `%s' given more than once" msgstr "" -#: elf/ldconfig.c:386 +#: elf/ldconfig.c:387 #, c-format msgid "%s is not a known library type" msgstr "" -#: elf/ldconfig.c:414 +#: elf/ldconfig.c:415 #, c-format msgid "Can't stat %s" msgstr "" -#: elf/ldconfig.c:488 +#: elf/ldconfig.c:489 #, c-format msgid "Can't stat %s\n" msgstr "" -#: elf/ldconfig.c:498 +#: elf/ldconfig.c:499 #, c-format msgid "%s is not a symbolic link\n" msgstr "" -#: elf/ldconfig.c:517 +#: elf/ldconfig.c:518 #, c-format msgid "Can't unlink %s" msgstr "" -#: elf/ldconfig.c:523 +#: elf/ldconfig.c:524 #, c-format msgid "Can't link %s to %s" msgstr "" -#: elf/ldconfig.c:529 +#: elf/ldconfig.c:530 msgid " (changed)\n" msgstr "" -#: elf/ldconfig.c:531 +#: elf/ldconfig.c:532 msgid " (SKIPPED)\n" msgstr "" -#: elf/ldconfig.c:586 +#: elf/ldconfig.c:587 #, c-format msgid "Can't find %s" msgstr "" -#: elf/ldconfig.c:602 elf/ldconfig.c:775 elf/ldconfig.c:834 elf/ldconfig.c:868 +#: elf/ldconfig.c:603 elf/ldconfig.c:776 elf/ldconfig.c:835 elf/ldconfig.c:869 #, c-format msgid "Cannot lstat %s" msgstr "" -#: elf/ldconfig.c:609 +#: elf/ldconfig.c:610 #, c-format msgid "Ignored file %s since it is not a regular file." msgstr "" -#: elf/ldconfig.c:618 +#: elf/ldconfig.c:619 #, c-format msgid "No link created since soname could not be found for %s" msgstr "" -#: elf/ldconfig.c:701 +#: elf/ldconfig.c:702 #, c-format msgid "Can't open directory %s" msgstr "" -#: elf/ldconfig.c:793 elf/ldconfig.c:855 elf/readlib.c:97 +#: elf/ldconfig.c:794 elf/ldconfig.c:856 elf/readlib.c:97 #, c-format msgid "Input file %s not found.\n" msgstr "" -#: elf/ldconfig.c:800 +#: elf/ldconfig.c:801 #, c-format msgid "Cannot stat %s" msgstr "" -#: elf/ldconfig.c:951 +#: elf/ldconfig.c:952 #, c-format msgid "libc5 library %s in wrong directory" msgstr "" -#: elf/ldconfig.c:954 +#: elf/ldconfig.c:955 #, c-format msgid "libc6 library %s in wrong directory" msgstr "" -#: elf/ldconfig.c:957 +#: elf/ldconfig.c:958 #, c-format msgid "libc4 library %s in wrong directory" msgstr "" -#: elf/ldconfig.c:985 +#: elf/ldconfig.c:986 #, c-format msgid "" "libraries %s and %s in directory %s have same soname but different type." msgstr "" -#: elf/ldconfig.c:1094 +#: elf/ldconfig.c:1095 #, c-format msgid "Warning: ignoring configuration file that cannot be opened: %s" msgstr "" -#: elf/ldconfig.c:1160 +#: elf/ldconfig.c:1161 #, c-format msgid "%s:%u: bad syntax in hwcap line" msgstr "" -#: elf/ldconfig.c:1166 +#: elf/ldconfig.c:1167 #, c-format msgid "%s:%u: hwcap index %lu above maximum %u" msgstr "" -#: elf/ldconfig.c:1173 elf/ldconfig.c:1181 +#: elf/ldconfig.c:1174 elf/ldconfig.c:1182 #, c-format msgid "%s:%u: hwcap index %lu already defined as %s" msgstr "" -#: elf/ldconfig.c:1184 +#: elf/ldconfig.c:1185 #, c-format msgid "%s:%u: duplicate hwcap %lu %s" msgstr "" -#: elf/ldconfig.c:1206 +#: elf/ldconfig.c:1207 #, c-format msgid "need absolute file name for configuration file when using -r" msgstr "" -#: elf/ldconfig.c:1213 locale/programs/xmalloc.c:63 malloc/obstack.c:416 -#: malloc/obstack.c:418 posix/getconf.c:441 posix/getconf.c:661 +#: elf/ldconfig.c:1214 locale/programs/xmalloc.c:63 malloc/obstack.c:416 +#: malloc/obstack.c:418 posix/getconf.c:458 posix/getconf.c:697 #, c-format msgid "memory exhausted" msgstr "" -#: elf/ldconfig.c:1245 +#: elf/ldconfig.c:1246 #, c-format msgid "%s:%u: cannot read directory %s" msgstr "" -#: elf/ldconfig.c:1289 +#: elf/ldconfig.c:1290 #, c-format msgid "relative path `%s' used to build cache" msgstr "" -#: elf/ldconfig.c:1319 +#: elf/ldconfig.c:1320 #, c-format msgid "Can't chdir to /" msgstr "" -#: elf/ldconfig.c:1360 +#: elf/ldconfig.c:1361 #, c-format msgid "Can't open cache file directory %s\n" msgstr "" @@ -945,7 +944,7 @@ msgstr "" msgid "No such file or directory" msgstr "" -#: elf/ldd.bash.in:150 inet/rcmd.c:479 +#: elf/ldd.bash.in:150 inet/rcmd.c:475 msgid "not regular file" msgstr "" @@ -1358,7 +1357,7 @@ msgstr "" msgid "list all known coded character sets" msgstr "" -#: iconv/iconv_prog.c:64 locale/programs/localedef.c:129 +#: iconv/iconv_prog.c:64 locale/programs/localedef.c:123 msgid "Output control:" msgstr "" @@ -1367,8 +1366,8 @@ msgid "omit invalid characters from output" msgstr "" #: iconv/iconv_prog.c:66 iconv/iconvconfig.c:128 -#: locale/programs/localedef.c:122 locale/programs/localedef.c:124 -#: locale/programs/localedef.c:126 locale/programs/localedef.c:147 +#: locale/programs/localedef.c:116 locale/programs/localedef.c:118 +#: locale/programs/localedef.c:120 locale/programs/localedef.c:140 #: malloc/memusagestat.c:56 msgid "FILE" msgstr "" @@ -1461,7 +1460,7 @@ msgstr "" msgid "[DIR...]" msgstr "" -#: iconv/iconvconfig.c:126 locale/programs/localedef.c:133 +#: iconv/iconvconfig.c:126 locale/programs/localedef.c:126 msgid "PATH" msgstr "" @@ -1484,7 +1483,7 @@ msgstr "" msgid "Directory arguments required when using --nostdlib" msgstr "" -#: iconv/iconvconfig.c:341 locale/programs/localedef.c:294 +#: iconv/iconvconfig.c:341 locale/programs/localedef.c:287 #, c-format msgid "no output file produced because warnings were issued" msgstr "" @@ -1499,84 +1498,84 @@ msgstr "" msgid "cannot generate output file" msgstr "" -#: inet/rcmd.c:159 +#: inet/rcmd.c:155 msgid "rcmd: Cannot allocate memory\n" msgstr "" -#: inet/rcmd.c:174 +#: inet/rcmd.c:170 msgid "rcmd: socket: All ports in use\n" msgstr "" -#: inet/rcmd.c:202 +#: inet/rcmd.c:198 #, c-format msgid "connect to address %s: " msgstr "" -#: inet/rcmd.c:215 +#: inet/rcmd.c:211 #, c-format msgid "Trying %s...\n" msgstr "" -#: inet/rcmd.c:251 +#: inet/rcmd.c:247 #, c-format msgid "rcmd: write (setting up stderr): %m\n" msgstr "" -#: inet/rcmd.c:267 +#: inet/rcmd.c:263 #, c-format msgid "rcmd: poll (setting up stderr): %m\n" msgstr "" -#: inet/rcmd.c:270 +#: inet/rcmd.c:266 msgid "poll: protocol failure in circuit setup\n" msgstr "" -#: inet/rcmd.c:302 +#: inet/rcmd.c:298 msgid "socket: protocol failure in circuit setup\n" msgstr "" -#: inet/rcmd.c:326 +#: inet/rcmd.c:322 #, c-format msgid "rcmd: %s: short read" msgstr "" -#: inet/rcmd.c:477 +#: inet/rcmd.c:473 msgid "lstat failed" msgstr "" -#: inet/rcmd.c:484 +#: inet/rcmd.c:480 msgid "cannot open" msgstr "" -#: inet/rcmd.c:486 +#: inet/rcmd.c:482 msgid "fstat failed" msgstr "" -#: inet/rcmd.c:488 +#: inet/rcmd.c:484 msgid "bad owner" msgstr "" -#: inet/rcmd.c:490 +#: inet/rcmd.c:486 msgid "writeable by other than owner" msgstr "" -#: inet/rcmd.c:492 +#: inet/rcmd.c:488 msgid "hard linked somewhere" msgstr "" -#: inet/ruserpass.c:169 inet/ruserpass.c:192 +#: inet/ruserpass.c:165 inet/ruserpass.c:188 msgid "out of memory" msgstr "" -#: inet/ruserpass.c:183 +#: inet/ruserpass.c:179 msgid "Error: .netrc file is readable by others." msgstr "" -#: inet/ruserpass.c:184 +#: inet/ruserpass.c:180 msgid "Remove password or make file unreadable by others." msgstr "" -#: inet/ruserpass.c:276 +#: inet/ruserpass.c:199 #, c-format msgid "Unknown .netrc keyword %s" msgstr "" @@ -1683,12 +1682,11 @@ msgstr "" #: locale/programs/charmap.c:610 locale/programs/ld-address.c:528 #: locale/programs/ld-collate.c:2626 locale/programs/ld-collate.c:3784 #: locale/programs/ld-ctype.c:2128 locale/programs/ld-ctype.c:2840 -#: locale/programs/ld-identification.c:368 -#: locale/programs/ld-measurement.c:215 locale/programs/ld-messages.c:298 -#: locale/programs/ld-monetary.c:740 locale/programs/ld-name.c:264 -#: locale/programs/ld-numeric.c:326 locale/programs/ld-paper.c:214 -#: locale/programs/ld-telephone.c:278 locale/programs/ld-time.c:943 -#: locale/programs/repertoire.c:313 +#: locale/programs/ld-identification.c:399 locale/programs/ld-measurement.c:215 +#: locale/programs/ld-messages.c:298 locale/programs/ld-monetary.c:740 +#: locale/programs/ld-name.c:264 locale/programs/ld-numeric.c:326 +#: locale/programs/ld-paper.c:214 locale/programs/ld-telephone.c:278 +#: locale/programs/ld-time.c:947 locale/programs/repertoire.c:313 #, c-format msgid "%1$s: definition does not end with `END %1$s'" msgstr "" @@ -1710,12 +1708,12 @@ msgstr "" #: locale/programs/charmap.c:850 locale/programs/ld-address.c:544 #: locale/programs/ld-collate.c:2623 locale/programs/ld-collate.c:3977 #: locale/programs/ld-ctype.c:2125 locale/programs/ld-ctype.c:2857 -#: locale/programs/ld-identification.c:384 -#: locale/programs/ld-measurement.c:231 locale/programs/ld-messages.c:314 -#: locale/programs/ld-monetary.c:756 locale/programs/ld-name.c:280 -#: locale/programs/ld-numeric.c:342 locale/programs/ld-paper.c:230 -#: locale/programs/ld-telephone.c:294 locale/programs/ld-time.c:959 -#: locale/programs/locfile.c:1000 locale/programs/repertoire.c:324 +#: locale/programs/ld-identification.c:415 locale/programs/ld-measurement.c:231 +#: locale/programs/ld-messages.c:314 locale/programs/ld-monetary.c:756 +#: locale/programs/ld-name.c:280 locale/programs/ld-numeric.c:342 +#: locale/programs/ld-paper.c:230 locale/programs/ld-telephone.c:294 +#: locale/programs/ld-time.c:963 locale/programs/locfile.c:1000 +#: locale/programs/repertoire.c:324 #, c-format msgid "%s: premature end of file" msgstr "" @@ -1820,33 +1818,32 @@ msgstr "" #: locale/programs/ld-address.c:436 locale/programs/ld-address.c:473 #: locale/programs/ld-address.c:511 locale/programs/ld-ctype.c:2489 -#: locale/programs/ld-identification.c:280 -#: locale/programs/ld-measurement.c:198 locale/programs/ld-messages.c:267 -#: locale/programs/ld-monetary.c:495 locale/programs/ld-monetary.c:530 -#: locale/programs/ld-monetary.c:571 locale/programs/ld-name.c:237 -#: locale/programs/ld-numeric.c:218 locale/programs/ld-paper.c:197 -#: locale/programs/ld-telephone.c:253 locale/programs/ld-time.c:848 -#: locale/programs/ld-time.c:890 +#: locale/programs/ld-identification.c:311 locale/programs/ld-measurement.c:198 +#: locale/programs/ld-messages.c:267 locale/programs/ld-monetary.c:495 +#: locale/programs/ld-monetary.c:530 locale/programs/ld-monetary.c:571 +#: locale/programs/ld-name.c:237 locale/programs/ld-numeric.c:218 +#: locale/programs/ld-paper.c:197 locale/programs/ld-telephone.c:253 +#: locale/programs/ld-time.c:852 locale/programs/ld-time.c:894 #, c-format msgid "%s: field `%s' declared more than once" msgstr "" #: locale/programs/ld-address.c:440 locale/programs/ld-address.c:478 -#: locale/programs/ld-identification.c:284 locale/programs/ld-messages.c:277 +#: locale/programs/ld-identification.c:315 locale/programs/ld-messages.c:277 #: locale/programs/ld-monetary.c:499 locale/programs/ld-monetary.c:534 #: locale/programs/ld-name.c:241 locale/programs/ld-numeric.c:222 -#: locale/programs/ld-telephone.c:257 locale/programs/ld-time.c:742 -#: locale/programs/ld-time.c:811 locale/programs/ld-time.c:853 +#: locale/programs/ld-telephone.c:257 locale/programs/ld-time.c:746 +#: locale/programs/ld-time.c:815 locale/programs/ld-time.c:857 #, c-format msgid "%s: unknown character in field `%s'" msgstr "" #: locale/programs/ld-address.c:525 locale/programs/ld-collate.c:3782 -#: locale/programs/ld-ctype.c:2837 locale/programs/ld-identification.c:365 +#: locale/programs/ld-ctype.c:2837 locale/programs/ld-identification.c:396 #: locale/programs/ld-measurement.c:212 locale/programs/ld-messages.c:296 #: locale/programs/ld-monetary.c:738 locale/programs/ld-name.c:262 #: locale/programs/ld-numeric.c:324 locale/programs/ld-paper.c:212 -#: locale/programs/ld-telephone.c:276 locale/programs/ld-time.c:941 +#: locale/programs/ld-telephone.c:276 locale/programs/ld-time.c:945 #, c-format msgid "%s: incomplete `END' line" msgstr "" @@ -1857,11 +1854,11 @@ msgstr "" #: locale/programs/ld-collate.c:2613 locale/programs/ld-collate.c:3967 #: locale/programs/ld-ctype.c:1857 locale/programs/ld-ctype.c:2115 #: locale/programs/ld-ctype.c:2687 locale/programs/ld-ctype.c:2848 -#: locale/programs/ld-identification.c:375 -#: locale/programs/ld-measurement.c:222 locale/programs/ld-messages.c:305 -#: locale/programs/ld-monetary.c:747 locale/programs/ld-name.c:271 -#: locale/programs/ld-numeric.c:333 locale/programs/ld-paper.c:221 -#: locale/programs/ld-telephone.c:285 locale/programs/ld-time.c:950 +#: locale/programs/ld-identification.c:406 locale/programs/ld-measurement.c:222 +#: locale/programs/ld-messages.c:305 locale/programs/ld-monetary.c:747 +#: locale/programs/ld-name.c:271 locale/programs/ld-numeric.c:333 +#: locale/programs/ld-paper.c:221 locale/programs/ld-telephone.c:285 +#: locale/programs/ld-time.c:954 #, c-format msgid "%s: syntax error" msgstr "" @@ -2349,12 +2346,17 @@ msgstr "" msgid "%s: table for width: %lu bytes\n" msgstr "" -#: locale/programs/ld-identification.c:170 +#: locale/programs/ld-identification.c:175 #, c-format msgid "%s: no identification for category `%s'" msgstr "" -#: locale/programs/ld-identification.c:351 +#: locale/programs/ld-identification.c:199 +#, c-format +msgid "%s: unknown standard `%s' for category `%s'" +msgstr "" + +#: locale/programs/ld-identification.c:382 #, c-format msgid "%s: duplicate category version definition" msgstr "" @@ -2478,27 +2480,27 @@ msgstr "" msgid "%s: missing era format in string %Zd in `era' field" msgstr "" -#: locale/programs/ld-time.c:497 +#: locale/programs/ld-time.c:501 #, c-format msgid "%s: third operand for value of field `%s' must not be larger than %d" msgstr "" -#: locale/programs/ld-time.c:505 locale/programs/ld-time.c:513 -#: locale/programs/ld-time.c:521 +#: locale/programs/ld-time.c:509 locale/programs/ld-time.c:517 +#: locale/programs/ld-time.c:525 #, c-format msgid "%s: values for field `%s' must not be larger than %d" msgstr "" -#: locale/programs/ld-time.c:726 +#: locale/programs/ld-time.c:730 #, c-format msgid "%s: too few values for field `%s'" msgstr "" -#: locale/programs/ld-time.c:771 +#: locale/programs/ld-time.c:775 msgid "extra trailing semicolon" msgstr "" -#: locale/programs/ld-time.c:774 +#: locale/programs/ld-time.c:778 #, c-format msgid "%s: too many values for field `%s'" msgstr "" @@ -2609,115 +2611,111 @@ msgstr "" msgid "while preparing output" msgstr "" -#: locale/programs/localedef.c:121 +#: locale/programs/localedef.c:115 msgid "Input Files:" msgstr "" -#: locale/programs/localedef.c:123 +#: locale/programs/localedef.c:117 msgid "Symbolic character names defined in FILE" msgstr "" -#: locale/programs/localedef.c:125 +#: locale/programs/localedef.c:119 msgid "Source definitions are found in FILE" msgstr "" -#: locale/programs/localedef.c:127 +#: locale/programs/localedef.c:121 msgid "FILE contains mapping from symbolic names to UCS4 values" msgstr "" -#: locale/programs/localedef.c:131 +#: locale/programs/localedef.c:125 msgid "Create output even if warning messages were issued" msgstr "" -#: locale/programs/localedef.c:132 -msgid "Create old-style tables" -msgstr "" - -#: locale/programs/localedef.c:133 +#: locale/programs/localedef.c:126 msgid "Optional output file prefix" msgstr "" -#: locale/programs/localedef.c:134 +#: locale/programs/localedef.c:127 msgid "Strictly conform to POSIX" msgstr "" -#: locale/programs/localedef.c:136 +#: locale/programs/localedef.c:129 msgid "Suppress warnings and information messages" msgstr "" -#: locale/programs/localedef.c:137 +#: locale/programs/localedef.c:130 msgid "Print more messages" msgstr "" -#: locale/programs/localedef.c:138 +#: locale/programs/localedef.c:131 msgid "Archive control:" msgstr "" -#: locale/programs/localedef.c:140 +#: locale/programs/localedef.c:133 msgid "Don't add new data to archive" msgstr "" -#: locale/programs/localedef.c:142 +#: locale/programs/localedef.c:135 msgid "Add locales named by parameters to archive" msgstr "" -#: locale/programs/localedef.c:143 +#: locale/programs/localedef.c:136 msgid "Replace existing archive content" msgstr "" -#: locale/programs/localedef.c:145 +#: locale/programs/localedef.c:138 msgid "Remove locales named by parameters from archive" msgstr "" -#: locale/programs/localedef.c:146 +#: locale/programs/localedef.c:139 msgid "List content of archive" msgstr "" -#: locale/programs/localedef.c:148 +#: locale/programs/localedef.c:141 msgid "locale.alias file to consult when making archive" msgstr "" -#: locale/programs/localedef.c:150 +#: locale/programs/localedef.c:143 msgid "Generate little-endian output" msgstr "" -#: locale/programs/localedef.c:152 +#: locale/programs/localedef.c:145 msgid "Generate big-endian output" msgstr "" -#: locale/programs/localedef.c:157 +#: locale/programs/localedef.c:150 msgid "Compile locale specification" msgstr "" -#: locale/programs/localedef.c:160 +#: locale/programs/localedef.c:153 msgid "" "NAME\n" "[--add-to-archive|--delete-from-archive] FILE...\n" "--list-archive [FILE]" msgstr "" -#: locale/programs/localedef.c:235 +#: locale/programs/localedef.c:228 #, c-format msgid "cannot create directory for output files" msgstr "" -#: locale/programs/localedef.c:246 +#: locale/programs/localedef.c:239 #, c-format msgid "FATAL: system does not define `_POSIX2_LOCALEDEF'" msgstr "" -#: locale/programs/localedef.c:260 locale/programs/localedef.c:276 -#: locale/programs/localedef.c:612 locale/programs/localedef.c:632 +#: locale/programs/localedef.c:253 locale/programs/localedef.c:269 +#: locale/programs/localedef.c:602 locale/programs/localedef.c:622 #, c-format msgid "cannot open locale definition file `%s'" msgstr "" -#: locale/programs/localedef.c:288 +#: locale/programs/localedef.c:281 #, c-format msgid "cannot write output files to `%s'" msgstr "" -#: locale/programs/localedef.c:380 +#: locale/programs/localedef.c:370 #, c-format msgid "" "System's directory for character maps : %s\n" @@ -2726,12 +2724,12 @@ msgid "" "%s" msgstr "" -#: locale/programs/localedef.c:580 +#: locale/programs/localedef.c:570 #, c-format msgid "circular dependencies between locale definitions" msgstr "" -#: locale/programs/localedef.c:586 +#: locale/programs/localedef.c:576 #, c-format msgid "cannot add already read locale `%s' a second time" msgstr "" @@ -4022,23 +4020,23 @@ msgstr "" msgid "setgroups failed" msgstr "" -#: nscd/grpcache.c:405 nscd/hstcache.c:432 nscd/initgrcache.c:411 -#: nscd/pwdcache.c:383 nscd/servicescache.c:338 +#: nscd/grpcache.c:416 nscd/hstcache.c:432 nscd/initgrcache.c:411 +#: nscd/pwdcache.c:394 nscd/servicescache.c:338 #, c-format msgid "short write in %s: %s" msgstr "" -#: nscd/grpcache.c:450 nscd/initgrcache.c:78 +#: nscd/grpcache.c:461 nscd/initgrcache.c:78 #, c-format msgid "Haven't found \"%s\" in group cache!" msgstr "" -#: nscd/grpcache.c:452 nscd/initgrcache.c:80 +#: nscd/grpcache.c:463 nscd/initgrcache.c:80 #, c-format msgid "Reloading \"%s\" in group cache!" msgstr "" -#: nscd/grpcache.c:531 +#: nscd/grpcache.c:542 #, c-format msgid "Invalid numeric gid \"%s\"!" msgstr "" @@ -4344,17 +4342,17 @@ msgid "" "%15s check /etc/%s for changes\n" msgstr "" -#: nscd/pwdcache.c:428 +#: nscd/pwdcache.c:439 #, c-format msgid "Haven't found \"%s\" in password cache!" msgstr "" -#: nscd/pwdcache.c:430 +#: nscd/pwdcache.c:441 #, c-format msgid "Reloading \"%s\" in password cache!" msgstr "" -#: nscd/pwdcache.c:511 +#: nscd/pwdcache.c:522 #, c-format msgid "Invalid numeric uid \"%s\"!" msgstr "" @@ -4602,17 +4600,17 @@ msgstr "" msgid "cannot set file creation context for `%s'" msgstr "" -#: posix/getconf.c:400 +#: posix/getconf.c:417 #, c-format msgid "Usage: %s [-v specification] variable_name [pathname]\n" msgstr "" -#: posix/getconf.c:403 +#: posix/getconf.c:420 #, c-format msgid " %s -a [pathname]\n" msgstr "" -#: posix/getconf.c:479 +#: posix/getconf.c:496 #, c-format msgid "" "Usage: getconf [-v SPEC] VAR\n" @@ -4624,21 +4622,21 @@ msgid "" "\n" msgstr "" -#: posix/getconf.c:537 +#: posix/getconf.c:572 #, c-format msgid "unknown specification \"%s\"" msgstr "" -#: posix/getconf.c:589 +#: posix/getconf.c:624 #, c-format msgid "Couldn't execute %s" msgstr "" -#: posix/getconf.c:633 posix/getconf.c:649 +#: posix/getconf.c:669 posix/getconf.c:685 msgid "undefined" msgstr "" -#: posix/getconf.c:671 +#: posix/getconf.c:707 #, c-format msgid "Unrecognized variable `%s'" msgstr "" @@ -4771,31 +4769,31 @@ msgstr "" msgid "parameter null or not set" msgstr "" -#: resolv/herror.c:68 +#: resolv/herror.c:63 msgid "Resolver Error 0 (no error)" msgstr "" -#: resolv/herror.c:69 +#: resolv/herror.c:64 msgid "Unknown host" msgstr "" -#: resolv/herror.c:70 +#: resolv/herror.c:65 msgid "Host name lookup failure" msgstr "" -#: resolv/herror.c:71 +#: resolv/herror.c:66 msgid "Unknown server error" msgstr "" -#: resolv/herror.c:72 +#: resolv/herror.c:67 msgid "No address associated with name" msgstr "" -#: resolv/herror.c:107 +#: resolv/herror.c:102 msgid "Resolver internal error" msgstr "" -#: resolv/herror.c:110 +#: resolv/herror.c:105 msgid "Unknown resolver error" msgstr "" @@ -1,13 +1,17 @@ # GNU libc message catalog for Swedish -# Copyright © 1996, 1998, 2001, 2002, 2003, 2006, 2008, 2009, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. +# Copyright © 1996, 1998, 2001, 2002, 2003, 2006, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. # This file is distributed under the same license as the glibc package. -# Jan Djärv <jan.h.d@swipnet.se>, 1996, 1998, 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015 +# +# Jan Djärv <jan.h.d@swipnet.se>, 1996, 1998, 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015. +# Göran Uddeborg <goeran@uddeborg.se>, 2016. +# +# $Revision: 1.3 $ msgid "" msgstr "" -"Project-Id-Version: libc 2.21-pre1\n" +"Project-Id-Version: libc 2.22-pre1\n" "POT-Creation-Date: 2015-07-31 00:10-0400\n" -"PO-Revision-Date: 2015-01-24 10:35+0100\n" -"Last-Translator: Jan Djärv <jan.h.d@swipnet.se>\n" +"PO-Revision-Date: 2016-08-02 17:17+0200\n" +"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n" "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -48,7 +52,7 @@ msgstr " [FLAGGA...]" #: argp/argp-help.c:1643 #, c-format msgid "Try `%s --help' or `%s --usage' for more information.\n" -msgstr "Försök med \"%s --help\" eller \"%s --usage\" för mer information\n" +msgstr "Försök med ”%s --help” eller ”%s --usage” för mer information.\n" #: argp/argp-help.c:1671 #, c-format @@ -304,11 +308,11 @@ msgstr "Användning: xtrace [FLAGGA]... PROGRAM [PROGRAMFLAGGA}...\\n" #: debug/xtrace.sh:32 elf/sotruss.sh:56 elf/sotruss.sh:67 elf/sotruss.sh:135 #: malloc/memusage.sh:26 msgid "Try \\`%s --help' or \\`%s --usage' for more information.\\n" -msgstr "Försök med \\\"%s --help\\\" eller \\\"%s --usage\\\" för mer information\\n" +msgstr "Försök med ”%s --help” eller ”%s --usage” för mer information\\n" #: debug/xtrace.sh:38 msgid "%s: option '%s' requires an argument.\\n" -msgstr "%s: flaggan \\\"%s\\\" kräver ett argument\\n" +msgstr "%s: flaggan ”%s” kräver ett argument.\\n" #: debug/xtrace.sh:45 msgid "" @@ -332,19 +336,17 @@ msgstr "" " --usage Visa en kort hjälptext\n" " -V,--version Visa versionsinformation och avsluta\n" "\n" -"Obligatoriska argument för långa flaggor är obligatoriska även för\n" +"Obligatoriska argument för långa flaggor är obligatoriska även för\n" "motsvarande korta.\n" #: debug/xtrace.sh:57 elf/ldd.bash.in:55 elf/sotruss.sh:49 #: malloc/memusage.sh:64 msgid "For bug reporting instructions, please see:\\\\n%s.\\\\n" -msgstr "" -"För felrapporteringsinstruktioner, se:\\\\n%s.\\\\n\n" -"Rapportera fel eller synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\\\\n" +msgstr "För felrapporteringsinstruktioner, se:\\\\n%s.\\\\nRapportera fel eller synpunkter på översättningen till:\\\\n<tp-sv@listor.tp-sv.se>.\\\\n" #: debug/xtrace.sh:125 msgid "xtrace: unrecognized option \\`$1'\\n" -msgstr "xtrace: okänd flagga \"$1\"\\n" +msgstr "xtrace: okänd flagga ”$1”\\n" #: debug/xtrace.sh:138 msgid "No program name given\\n" @@ -353,12 +355,12 @@ msgstr "Inget programnamn givet\\n" #: debug/xtrace.sh:146 #, sh-format msgid "executable \\`$program' not found\\n" -msgstr "program \"$program\" hittades inte\\n" +msgstr "program ”$program” hittades inte\\n" #: debug/xtrace.sh:150 #, sh-format msgid "\\`$program' is no executable\\n" -msgstr "\"$program\" är inte en körbar binär\\n" +msgstr "”$program” är inte en körbar binär\\n" #: dlfcn/dlinfo.c:63 msgid "RTLD_SELF used in code not dynamically loaded" @@ -396,7 +398,7 @@ msgstr ", OS ABI: %s %d.%d.%d" #: elf/cache.c:157 elf/ldconfig.c:1340 #, c-format msgid "Can't open cache file %s\n" -msgstr "Kan inte öppna cache-fil \"%s\"\n" +msgstr "Kan inte öppna cache-filen %s\n" #: elf/cache.c:171 #, c-format @@ -416,7 +418,7 @@ msgstr "%d bibliotek hittades i cache \"%s\"\n" #: elf/cache.c:426 #, c-format msgid "Can't create temporary cache file %s" -msgstr "Kan inte skapa temporär cache-fil \"%s\"" +msgstr "Kan inte skapa en temporär cache-fil %s" #: elf/cache.c:434 elf/cache.c:444 elf/cache.c:448 elf/cache.c:453 #, c-format @@ -829,7 +831,7 @@ msgstr "Kan inte ta status (lstat) på %s" #: elf/ldconfig.c:609 #, c-format msgid "Ignored file %s since it is not a regular file." -msgstr "Ignorerar fil %s eftersom den inte är en vanlig fil" +msgstr "Ignorerar fil %s eftersom den inte är en vanlig fil." #: elf/ldconfig.c:618 #, c-format @@ -951,7 +953,7 @@ msgstr "" #: elf/ldd.bash.in:80 msgid "ldd: option \\`$1' is ambiguous" -msgstr "ldd: flaggan \"$1\" är tvetydig" +msgstr "ldd: flaggan ”$1” är tvetydig" #: elf/ldd.bash.in:87 msgid "unrecognized option" @@ -959,7 +961,7 @@ msgstr "okänd flagga" #: elf/ldd.bash.in:88 elf/ldd.bash.in:125 msgid "Try \\`ldd --help' for more information." -msgstr "Försök med \"ldd --help\" för mer information" +msgstr "Försök med \"ldd --help\" för mer information." #: elf/ldd.bash.in:124 msgid "missing file arguments" @@ -1028,10 +1030,9 @@ msgid "cannot read object name" msgstr "kan inte läsa objektnamn" #: elf/pldd-xx.c:219 -#, fuzzy, c-format -#| msgid "cannot allocate memory for program header" +#, c-format msgid "cannot allocate buffer for object name" -msgstr "kan inte allokera minne för programhuvud" +msgstr "kan inte allokera en buffert för objektnamn" #: elf/pldd.c:64 msgid "List dynamic shared objects loaded into process." @@ -1212,11 +1213,11 @@ msgstr "" #: elf/sotruss.sh:46 msgid "Mandatory arguments to long options are also mandatory for any corresponding\\nshort options.\\n" -msgstr "Obligatoriska respektive valfria argument för långa flaggor är obligatoriska respektive\\nvalfria även för korta.\\n" +msgstr "Obligatoriska respektive valfria argument för långa flaggor är obligatoriska\\nrespektive valfria även för korta.\\n" #: elf/sotruss.sh:55 msgid "%s: option requires an argument -- '%s'\\n" -msgstr "%s: flaggan kräver ett argument -- \\\"%s\\\"\\n" +msgstr "%s: flaggan kräver ett argument — ”%s”\\n" #: elf/sotruss.sh:61 msgid "%s: option is ambiguous; possibilities:" @@ -1240,7 +1241,7 @@ msgstr "" #: elf/sotruss.sh:134 msgid "%s: unrecognized option '%c%s'\\n" -msgstr "%s: okänd flagga \\\"%c%s\\\"\\n" +msgstr "%s: okänd flagga ”%c%s”\\n" #: elf/sprof.c:77 msgid "Output selection:" @@ -1260,7 +1261,7 @@ msgstr "generera anropsgraf" #: elf/sprof.c:89 msgid "Read and display shared object profiling data." -msgstr "Läs och visa profildata för delat objekt" +msgstr "Läs och visa profildata för delat objekt." #: elf/sprof.c:94 msgid "SHOBJ [PROFDATA]" @@ -1622,7 +1623,7 @@ msgstr "Fel: .netrc kan läsas av andra." #: inet/ruserpass.c:185 msgid "Remove password or make file unreadable by others." -msgstr "Ta bort lösenord eller gör filen oläsbar för andra" +msgstr "Ta bort lösenord eller gör filen oläsbar för andra." #: inet/ruserpass.c:277 #, c-format @@ -2182,12 +2183,12 @@ msgstr "Inget namn definierat i teckenuppsättning" #: locale/programs/ld-ctype.c:479 #, c-format msgid "character L'\\u%0*x' in class `%s' must be in class `%s'" -msgstr "tecken L\"\\u%0*x\" i klass \"%s\" måste vara i klass \"%s\"" +msgstr "tecken L'\\u%0*x' i klassen ”%s” måste vara i klassen ”%s”" #: locale/programs/ld-ctype.c:494 #, c-format msgid "character L'\\u%0*x' in class `%s' must not be in class `%s'" -msgstr "tecken L\"\\u%0*x\" i klass \"%s\" får inte vara i klass \"%s\"" +msgstr "tecken L'\\u%0*x' i klassen ”%s” får inte vara i klassen ”%s”" #: locale/programs/ld-ctype.c:508 locale/programs/ld-ctype.c:566 #, c-format @@ -2611,7 +2612,7 @@ msgstr "Skriv mer information" #: locale/programs/locale.c:85 msgid "Get locale-specific information." -msgstr "Hämta lokalspecifik information" +msgstr "Hämta lokalspecifik information." #: locale/programs/locale.c:88 msgid "" @@ -3022,7 +3023,7 @@ msgstr "felaktig mcheck_status, biblioteket är felaktigt\n" #: malloc/memusage.sh:32 msgid "%s: option '%s' requires an argument\\n" -msgstr "%s: flaggan \\\"%s\\\" kräver ett argument\\n" +msgstr "%s: flaggan ”%s” kräver ett argument\\n" #: malloc/memusage.sh:38 msgid "" @@ -3091,11 +3092,11 @@ msgstr "" #: malloc/memusage.sh:191 msgid "memusage: option \\`${1##*=}' is ambiguous" -msgstr "memusage: flaggan \"${1##*=}\" är tvetydig" +msgstr "memusage: flaggan ”${1##*=}” är tvetydig" #: malloc/memusage.sh:200 msgid "memusage: unrecognized option \\`$1'" -msgstr "memusage: okänd flagga \"$1\"" +msgstr "memusage: okänd flagga ”$1”" #: malloc/memusage.sh:213 msgid "No program name given" @@ -3341,7 +3342,7 @@ msgstr "Kan inte skapa process hos server" #: nis/nis_error.h:48 msgid "Master server busy, full dump rescheduled." -msgstr "Huvudserver är upptagen, full dump åter schemalagd" +msgstr "Huvudserver är upptagen, full dump åter schemalagd." #: nis/nis_local_names.c:121 #, c-format @@ -3511,7 +3512,7 @@ msgstr "\t\tRättigheter : " #: nis/nis_print.c:290 msgid "Linked Object Type : " -msgstr "Länkad objekttyp: " +msgstr "Länkad objekttyp : " #: nis/nis_print.c:292 #, c-format @@ -3802,15 +3803,14 @@ msgid " (first)" msgstr " (första)" #: nscd/cache.c:288 -#, fuzzy, c-format -#| msgid "cannot stat() file `%s': %s" +#, c-format msgid "checking for monitored file `%s': %s" -msgstr "kan inte ta status på fil \"%s\": %s" +msgstr "kontrollerar den övervakade filen ”%s”: %s" #: nscd/cache.c:298 #, c-format msgid "monitored file `%s` changed (mtime)" -msgstr "" +msgstr "den övervakade filen ”%s” ändrades (mtime)" #: nscd/cache.c:341 #, c-format @@ -3906,34 +3906,32 @@ msgstr "kan inte få uttag (socket) att acceptera förbindelser: %s" #: nscd/connections.c:973 #, c-format msgid "disabled inotify-based monitoring for file `%s': %s" -msgstr "" +msgstr "avaktiverade inotify-baserad övervakning för filen ”%s”: %s" #: nscd/connections.c:977 #, c-format msgid "monitoring file `%s` (%d)" -msgstr "" +msgstr "övervakar filen ”%s” (%d)" #: nscd/connections.c:990 #, c-format msgid "disabled inotify-based monitoring for directory `%s': %s" -msgstr "" +msgstr "avaktiverade inotify-baserad övervakning av katalogen ”%s”: %s" #: nscd/connections.c:994 -#, fuzzy, c-format -#| msgid "Can't open directory %s" +#, c-format msgid "monitoring directory `%s` (%d)" -msgstr "Kan inte öppna katalog %s" +msgstr "övervakar katalogen ”%s” (%d)" #: nscd/connections.c:1022 -#, fuzzy, c-format -#| msgid "register trace file %s for database %s" +#, c-format msgid "monitoring file %s for database %s" -msgstr "registrera spårningsfil %s för databas %s" +msgstr "övervakar filen %s för databas %s" #: nscd/connections.c:1032 #, c-format msgid "stat failed for file `%s'; will try again later: %s" -msgstr "" +msgstr "stat misslyckades för filen ”%s”; kommer försöka igen senare: %s" #: nscd/connections.c:1151 #, c-format @@ -4032,44 +4030,42 @@ msgstr "handle_request: begäran mottagen (Version = %d)" #: nscd/connections.c:1963 #, c-format msgid "ignored inotify event for `%s` (file exists)" -msgstr "" +msgstr "ignorerade inotify-händelse för ”%s” (filen finns)" #: nscd/connections.c:1968 #, c-format msgid "monitored file `%s` was %s, removing watch" -msgstr "" +msgstr "den övervakade filen ”%s” var %s, tar bort vakten" #: nscd/connections.c:1976 nscd/connections.c:2018 #, c-format msgid "failed to remove file watch `%s`: %s" -msgstr "" +msgstr "misslyckades att ta bort filvakt ”%s”: %s" #: nscd/connections.c:1991 #, c-format msgid "monitored file `%s` was written to" -msgstr "" +msgstr "den övervakade filen ”%s” skrevs till" #: nscd/connections.c:2015 #, c-format msgid "monitored parent directory `%s` was %s, removing watch on `%s`" -msgstr "" +msgstr "den övervakade föräldrakatalogen ”%s” var %s, tar bort vakten av ”%s”" #: nscd/connections.c:2041 #, c-format msgid "monitored file `%s` was %s, adding watch" -msgstr "" +msgstr "den övervakade filen ”%s” var %s, lägger till vakt" #: nscd/connections.c:2053 -#, fuzzy, c-format -#| msgid "failed to load shared object `%s'" +#, c-format msgid "failed to add file watch `%s`: %s" -msgstr "misslyckades med att ladda delat objekt \"%s\"" +msgstr "misslyckades med att lägga till filvakt ”%s”: %s" #: nscd/connections.c:2247 nscd/connections.c:2428 -#, fuzzy, c-format -#| msgid "disabled inotify after read error %d" +#, c-format msgid "disabled inotify-based monitoring after read error %d" -msgstr "inaktiverade inotify efter läsfel %d" +msgstr "avaktiverade inotify-baserad övervakning efter läsfel %d" #: nscd/connections.c:2543 msgid "could not initialize conditional variable" @@ -4199,7 +4195,7 @@ msgstr "Använd separat cache för varje användare" #: nscd/nscd.c:122 msgid "Name Service Cache Daemon." -msgstr "Namntjänst cache-demon" +msgstr "Cache-demon för namntjänsten." #: nscd/nscd.c:155 nss/getent.c:1007 nss/makedb.c:206 #, c-format @@ -4531,11 +4527,11 @@ msgstr "Access Vector Cache (AVC) startad" #: nscd/selinux.c:368 msgid "Error querying policy for undefined object classes or permissions." -msgstr "Fel när policy för odefinierade objektklasser eller rättigheter hämtades" +msgstr "Fel när policy för odefinierade objektklasser eller rättigheter hämtades." #: nscd/selinux.c:375 msgid "Error getting security class for nscd." -msgstr "Fel när säkerhetsklass för nscd hämtades" +msgstr "Fel när säkerhetsklass för nscd hämtades." #: nscd/selinux.c:380 #, c-format @@ -4609,7 +4605,7 @@ msgstr "inaktivera DIN-kodning" #: nss/getent.c:64 msgid "Get entries from administrative database." -msgstr "Hämta poster från den administrativa databasen" +msgstr "Hämta poster från den administrativa databasen." #: nss/getent.c:148 nss/getent.c:477 nss/getent.c:522 #, c-format @@ -4652,7 +4648,7 @@ msgstr "Genererad rad som inte ingår i iterationen" #: nss/makedb.c:131 msgid "Create simple database from textual input." -msgstr "Skapa en enkel databas från textuell indata" +msgstr "Skapa en enkel databas från textuell indata." #: nss/makedb.c:134 msgid "" @@ -5412,7 +5408,7 @@ msgstr "Kan inte ange netid-flaggan utan TIRPC!\n" #: sunrpc/rpc_main.c:1374 #, c-format msgid "Cannot use table flags with newstyle!\n" -msgstr "Kan inte ange tabellflaggor med ny stil\n" +msgstr "Kan inte ange tabellflaggor med ny stil!\n" #: sunrpc/rpc_main.c:1393 #, c-format @@ -7270,18 +7266,9 @@ msgstr "tidszonsförkortning skiljer sig från POSIX-standarden" #: timezone/zic.c:2789 msgid "too many, or too long, time zone abbreviations" -msgstr "för många eller för långa tidszonförkortningar" +msgstr "för många eller för långa tidszonsförkortningar" #: timezone/zic.c:2829 #, c-format msgid "%s: Can't create directory %s: %s\n" msgstr "%s: Kan inte skapa katalog %s: %s\n" - -#~ msgid "cannot load any more object with static TLS" -#~ msgstr "kan inte ladda fler objekt med statiskt TLS" - -#~ msgid "%s: no PLTREL found in object %s\n" -#~ msgstr "%s: hittade inga PLTREL i objekt %s\n" - -#~ msgid "cannot create internal descriptors" -#~ msgstr "kan inte skapa interna deskriptorer" diff --git a/posix/Makefile b/posix/Makefile index 5b0e298..3a7719e 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -29,7 +29,7 @@ headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \ bits/local_lim.h tar.h bits/utsname.h bits/confname.h \ bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h \ bits/sched.h re_comp.h wait.h bits/environments.h cpio.h \ - sys/sysmacros.h spawn.h bits/unistd.h + spawn.h bits/unistd.h routines := \ uname \ diff --git a/posix/sys/types.h b/posix/sys/types.h index a728567..83dadcd 100644 --- a/posix/sys/types.h +++ b/posix/sys/types.h @@ -218,8 +218,14 @@ typedef int register_t __attribute__ ((__mode__ (__word__))); /* It also defines `fd_set' and the FD_* macros for `select'. */ # include <sys/select.h> -/* BSD defines these symbols, so we follow. */ +/* BSD defines `major', `minor', and `makedev' in this header. + However, these symbols are likely to collide with user code, so we are + going to stop defining them here in an upcoming release. Code that needs + these macros should include <sys/sysmacros.h> directly. Code that does + not need these macros should #undef them after including this header. */ +# define __SYSMACROS_DEPRECATED_INCLUSION # include <sys/sysmacros.h> +# undef __SYSMACROS_DEPRECATED_INCLUSION #endif /* Use misc. */ diff --git a/posix/tst-preadwrite-common.c b/posix/tst-preadwrite-common.c new file mode 100644 index 0000000..533fb93 --- /dev/null +++ b/posix/tst-preadwrite-common.c @@ -0,0 +1,85 @@ +/* Common definitions for pread and pwrite. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <error.h> +#include <string.h> +#include <unistd.h> + +static void do_prepare (void); +#define PREPARE(argc, argv) do_prepare () +static int do_test (void); +#define TEST_FUNCTION do_test () + +/* We might need a bit longer timeout. */ +#define TIMEOUT 20 /* sec */ + +/* This defines the `main' function and some more. */ +#include <test-skeleton.c> + +/* These are for the temporary file we generate. */ +static char *name; +static int fd; + +static void +do_prepare (void) +{ + fd = create_temp_file ("tst-preadwrite.", &name); + if (fd == -1) + error (EXIT_FAILURE, errno, "cannot create temporary file"); +} + + +static ssize_t +do_test_with_offset (off_t offset) +{ + char buf[1000]; + char res[1000]; + int i; + ssize_t ret; + + memset (buf, '\0', sizeof (buf)); + memset (res, '\xff', sizeof (res)); + + if (write (fd, buf, sizeof (buf)) != sizeof (buf)) + error (EXIT_FAILURE, errno, "during write"); + + for (i = 100; i < 200; ++i) + buf[i] = i; + ret = pwrite (fd, buf + 100, 100, offset + 100); + if (ret == -1) + error (EXIT_FAILURE, errno, "during pwrite"); + + for (i = 450; i < 600; ++i) + buf[i] = i; + ret = pwrite (fd, buf + 450, 150, offset + 450); + if (ret == -1) + error (EXIT_FAILURE, errno, "during pwrite"); + + ret = pread (fd, res, sizeof (buf) - 50, offset + 50); + if (ret == -1) + error (EXIT_FAILURE, errno, "during pread"); + + if (memcmp (buf + 50, res, ret) != 0) + { + printf ("error: read of pread != write of pwrite\n"); + return -1; + } + + return ret; +} diff --git a/posix/tst-preadwrite.c b/posix/tst-preadwrite.c index b7c1658..9c9acca 100644 --- a/posix/tst-preadwrite.c +++ b/posix/tst-preadwrite.c @@ -1,7 +1,6 @@ /* Tests for pread and pwrite. Copyright (C) 1998-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,88 +16,10 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <error.h> -#include <string.h> -#include <unistd.h> +#include "tst-preadwrite-common.c" - -/* Allow testing of the 64-bit versions as well. */ -#ifndef PREAD -# define PREAD pread -# define PWRITE pwrite -#endif - -#define STRINGIFY(s) STRINGIFY2 (s) -#define STRINGIFY2(s) #s - -/* Prototype for our test function. */ -extern void do_prepare (int argc, char *argv[]); -extern int do_test (int argc, char *argv[]); - -/* We have a preparation function. */ -#define PREPARE do_prepare - -/* We might need a bit longer timeout. */ -#define TIMEOUT 20 /* sec */ - -/* This defines the `main' function and some more. */ -#include <test-skeleton.c> - -/* These are for the temporary file we generate. */ -char *name; -int fd; - -void -do_prepare (int argc, char *argv[]) -{ - size_t name_len; - -#define FNAME FNAME2(TRUNCATE) -#define FNAME2(s) "/" STRINGIFY(s) "XXXXXX" - - name_len = strlen (test_dir); - name = malloc (name_len + sizeof (FNAME)); - if (name == NULL) - error (EXIT_FAILURE, errno, "cannot allocate file name"); - mempcpy (mempcpy (name, test_dir, name_len), FNAME, sizeof (FNAME)); - add_temp_file (name); - - /* Open our test file. */ - fd = mkstemp (name); - if (fd == -1) - error (EXIT_FAILURE, errno, "cannot open test file `%s'", name); -} - - -int -do_test (int argc, char *argv[]) +static int +do_test (void) { - char buf[1000]; - char res[1000]; - int i; - - memset (buf, '\0', sizeof (buf)); - memset (res, '\xff', sizeof (res)); - - if (write (fd, buf, sizeof (buf)) != sizeof (buf)) - error (EXIT_FAILURE, errno, "during write"); - - for (i = 100; i < 200; ++i) - buf[i] = i; - if (PWRITE (fd, buf + 100, 100, 100) != 100) - error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE)); - - for (i = 450; i < 600; ++i) - buf[i] = i; - if (PWRITE (fd, buf + 450, 150, 450) != 150) - error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE)); - - if (PREAD (fd, res, sizeof (buf) - 50, 50) != sizeof (buf) - 50) - error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PREAD)); - - close (fd); - unlink (name); - - return memcmp (buf + 50, res, sizeof (buf) - 50); + return do_test_with_offset (0) == -1; } diff --git a/posix/tst-preadwrite64.c b/posix/tst-preadwrite64.c index 27425be..00af21a 100644 --- a/posix/tst-preadwrite64.c +++ b/posix/tst-preadwrite64.c @@ -1,7 +1,6 @@ /* Tests for pread64 and pwrite64. Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,7 +16,40 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#define PREAD pread64 -#define PWRITE pwrite64 +#define _FILE_OFFSET_BITS 64 +#include "tst-preadwrite-common.c" -#include "tst-preadwrite.c" +static int +do_test (void) +{ + ssize_t ret; + + ret = do_test_with_offset (0); + if (ret == -1) + return 1; + + /* Create a sparse file larger than 4GB to check if offset is handled + correctly in p{write,read}64. */ + off_t base_offset = UINT32_MAX + 2048LL; + ret = do_test_with_offset (base_offset); + if (ret == -1) + return 1; + + struct stat st; + if (fstat (fd, &st) == -1) + { + printf ("error: fstat on temporary file failed: %m"); + return 1; + } + + /* The file size should >= base_offset plus bytes read. */ + off_t expected_value = base_offset + ret; + if (st.st_size < expected_value) + { + printf ("error: file size less than expected (%jd > %jd)\n", + (intmax_t) expected_value, (intmax_t) st.st_size); + return 1; + } + + return 0; +} diff --git a/string/string.h b/string/string.h index c7f8fde..57deaa4 100644 --- a/string/string.h +++ b/string/string.h @@ -22,7 +22,8 @@ #ifndef _STRING_H #define _STRING_H 1 -#include <features.h> +#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +#include <bits/libc-header-start.h> __BEGIN_DECLS @@ -166,7 +167,8 @@ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, __locale_t __l) __THROW __nonnull ((2, 4)); #endif -#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 +#if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ + || __GLIBC_USE (LIB_EXT2)) /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *__s) __THROW __attribute_malloc__ __nonnull ((1)); @@ -175,7 +177,7 @@ extern char *strdup (const char *__s) /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ -#if defined __USE_XOPEN2K8 +#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) extern char *strndup (const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull ((1)); #endif diff --git a/string/test-strncmp.c b/string/test-strncmp.c index 8c0a331..d392248 100644 --- a/string/test-strncmp.c +++ b/string/test-strncmp.c @@ -156,6 +156,9 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char, size_t i, align_n; CHAR *s1, *s2; + align1 &= ~(CHARBYTES - 1); + align2 &= ~(CHARBYTES - 1); + if (n == 0) { s1 = (CHAR *) (buf1 + page_size); @@ -204,6 +207,9 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char, size_t i; CHAR *s1, *s2; + align1 &= ~(CHARBYTES - 1); + align2 &= ~(CHARBYTES - 1); + if (n == 0) return; diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index 0632355..562c137 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -12,3 +12,7 @@ endif ifeq ($(subdir),csu) gen-as-const-headers += tlsdesc.sym endif + +ifeq ($(subdir),gmon) +CFLAGS-mcount.c += -mgeneral-regs-only +endif diff --git a/sysdeps/aarch64/libm-test-ulps b/sysdeps/aarch64/libm-test-ulps index bc5795b..7d62a32 100644 --- a/sysdeps/aarch64/libm-test-ulps +++ b/sysdeps/aarch64/libm-test-ulps @@ -40,9 +40,9 @@ ildouble: 2 ldouble: 2 Function: "acosh_downward": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 ildouble: 3 ldouble: 3 @@ -1910,16 +1910,16 @@ ildouble: 1 ldouble: 1 Function: "log_towardzero": -float: 1 -ifloat: 1 +float: 2 +ifloat: 2 ildouble: 2 ldouble: 2 Function: "log_upward": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 ildouble: 1 ldouble: 1 diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 6b728ec..e045759 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -66,9 +66,38 @@ /* If compiled for profiling, call `mcount' at the start of each function. */ #ifdef PROF # define CALL_MCOUNT \ - str x30, [sp, #-16]!; \ + str x30, [sp, #-80]!; \ + cfi_adjust_cfa_offset (80); \ + cfi_rel_offset (x30, 0); \ + stp x0, x1, [sp, #16]; \ + cfi_rel_offset (x0, 16); \ + cfi_rel_offset (x1, 24); \ + stp x2, x3, [sp, #32]; \ + cfi_rel_offset (x2, 32); \ + cfi_rel_offset (x3, 40); \ + stp x4, x5, [sp, #48]; \ + cfi_rel_offset (x4, 48); \ + cfi_rel_offset (x5, 56); \ + stp x6, x7, [sp, #64]; \ + cfi_rel_offset (x6, 64); \ + cfi_rel_offset (x7, 72); \ + mov x0, x30; \ bl mcount; \ - ldr x30, [sp], #16 ; + ldp x0, x1, [sp, #16]; \ + cfi_restore (x0); \ + cfi_restore (x1); \ + ldp x2, x3, [sp, #32]; \ + cfi_restore (x2); \ + cfi_restore (x3); \ + ldp x4, x5, [sp, #48]; \ + cfi_restore (x4); \ + cfi_restore (x5); \ + ldp x6, x7, [sp, #64]; \ + cfi_restore (x6); \ + cfi_restore (x7); \ + ldr x30, [sp], #80; \ + cfi_adjust_cfa_offset (-80); \ + cfi_restore (x30); #else # define CALL_MCOUNT /* Do nothing. */ #endif diff --git a/sysdeps/alpha/fpu/s_ceil.c b/sysdeps/alpha/fpu/s_ceil.c index c1ff864..e9c350a 100644 --- a/sysdeps/alpha/fpu/s_ceil.c +++ b/sysdeps/alpha/fpu/s_ceil.c @@ -26,17 +26,16 @@ double __ceil (double x) { + if (isnan (x)) + return x + x; + if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */ { double tmp1, new_x; new_x = -x; __asm ( -#ifdef _IEEE_FP_INEXACT - "cvttq/svim %2,%1\n\t" -#else "cvttq/svm %2,%1\n\t" -#endif "cvtqt/m %1,%0\n\t" : "=f"(new_x), "=&f"(tmp1) : "f"(new_x)); diff --git a/sysdeps/alpha/fpu/s_ceilf.c b/sysdeps/alpha/fpu/s_ceilf.c index 7e63a6f..77e01a9 100644 --- a/sysdeps/alpha/fpu/s_ceilf.c +++ b/sysdeps/alpha/fpu/s_ceilf.c @@ -25,6 +25,9 @@ float __ceilf (float x) { + if (isnanf (x)) + return x + x; + if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */ { /* Note that Alpha S_Floating is stored in registers in a @@ -36,11 +39,7 @@ __ceilf (float x) new_x = -x; __asm ("cvtst/s %3,%2\n\t" -#ifdef _IEEE_FP_INEXACT - "cvttq/svim %2,%1\n\t" -#else "cvttq/svm %2,%1\n\t" -#endif "cvtqt/m %1,%0\n\t" : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2) : "f"(new_x)); diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_floor.c index 1a6f8c4..9930f6b 100644 --- a/sysdeps/alpha/fpu/s_floor.c +++ b/sysdeps/alpha/fpu/s_floor.c @@ -27,16 +27,15 @@ double __floor (double x) { + if (isnan (x)) + return x + x; + if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */ { double tmp1, new_x; __asm ( -#ifdef _IEEE_FP_INEXACT - "cvttq/svim %2,%1\n\t" -#else "cvttq/svm %2,%1\n\t" -#endif "cvtqt/m %1,%0\n\t" : "=f"(new_x), "=&f"(tmp1) : "f"(x)); diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_floorf.c index 8cd80e2..015c04f 100644 --- a/sysdeps/alpha/fpu/s_floorf.c +++ b/sysdeps/alpha/fpu/s_floorf.c @@ -26,6 +26,9 @@ float __floorf (float x) { + if (isnanf (x)) + return x + x; + if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */ { /* Note that Alpha S_Floating is stored in registers in a @@ -36,11 +39,7 @@ __floorf (float x) float tmp1, tmp2, new_x; __asm ("cvtst/s %3,%2\n\t" -#ifdef _IEEE_FP_INEXACT - "cvttq/svim %2,%1\n\t" -#else "cvttq/svm %2,%1\n\t" -#endif "cvtqt/m %1,%0\n\t" : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2) : "f"(x)); diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_rint.c index f33fe72..259348a 100644 --- a/sysdeps/alpha/fpu/s_rint.c +++ b/sysdeps/alpha/fpu/s_rint.c @@ -23,6 +23,9 @@ double __rint (double x) { + if (isnan (x)) + return x + x; + if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */ { double tmp1, new_x; diff --git a/sysdeps/alpha/fpu/s_rintf.c b/sysdeps/alpha/fpu/s_rintf.c index 1400dfe..645728a 100644 --- a/sysdeps/alpha/fpu/s_rintf.c +++ b/sysdeps/alpha/fpu/s_rintf.c @@ -22,6 +22,9 @@ float __rintf (float x) { + if (isnanf (x)) + return x + x; + if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */ { /* Note that Alpha S_Floating is stored in registers in a diff --git a/sysdeps/alpha/fpu/s_trunc.c b/sysdeps/alpha/fpu/s_trunc.c index 16cb114..4b986a6 100644 --- a/sysdeps/alpha/fpu/s_trunc.c +++ b/sysdeps/alpha/fpu/s_trunc.c @@ -28,12 +28,11 @@ __trunc (double x) double two52 = copysign (0x1.0p52, x); double r, tmp; + if (isgreaterequal (fabs (x), 0x1.0p52)) + return x; + __asm ( -#ifdef _IEEE_FP_INEXACT - "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0" -#else "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0" -#endif : "=&f"(r), "=&f"(tmp) : "f"(x), "f"(two52)); diff --git a/sysdeps/alpha/fpu/s_truncf.c b/sysdeps/alpha/fpu/s_truncf.c index 2290f28..3e93356 100644 --- a/sysdeps/alpha/fpu/s_truncf.c +++ b/sysdeps/alpha/fpu/s_truncf.c @@ -27,12 +27,11 @@ __truncf (float x) float two23 = copysignf (0x1.0p23, x); float r, tmp; + if (isgreaterequal (fabsf (x), 0x1.0p23)) + return x; + __asm ( -#ifdef _IEEE_FP_INEXACT - "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0" -#else "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0" -#endif : "=&f"(r), "=&f"(tmp) : "f"(x), "f"(two23)); diff --git a/sysdeps/arm/nacl/libc.abilist b/sysdeps/arm/nacl/libc.abilist index 2f7751d..4d3b0b9 100644 --- a/sysdeps/arm/nacl/libc.abilist +++ b/sysdeps/arm/nacl/libc.abilist @@ -1840,4 +1840,9 @@ GLIBC_2.23 fts64_close F GLIBC_2.23 fts64_open F GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F +GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A +GLIBC_2.25 gnu_dev_major F +GLIBC_2.25 gnu_dev_makedev F +GLIBC_2.25 gnu_dev_minor F diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h index 36c5c58..39d8fe2 100644 --- a/sysdeps/generic/dl-dtv.h +++ b/sysdeps/generic/dl-dtv.h @@ -19,15 +19,17 @@ #ifndef _DL_DTV_H #define _DL_DTV_H +struct dtv_pointer +{ + void *val; /* Pointer to data, or TLS_DTV_UNALLOCATED. */ + void *to_free; /* Unaligned pointer, for deallocation. */ +}; + /* Type for the dtv. */ typedef union dtv { size_t counter; - struct - { - void *val; - bool is_static; - } pointer; + struct dtv_pointer pointer; } dtv_t; /* Value used for dtv entries for which the allocation is delayed. */ diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index ddec0be..f68fdf4 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -88,6 +88,19 @@ typedef struct link_map *lookup_t; || (ADDR) < (L)->l_addr + (SYM)->st_value + (SYM)->st_size) \ && ((MATCHSYM) == NULL || (MATCHSYM)->st_value < (SYM)->st_value)) +/* According to the ELF gABI no STV_HIDDEN or STV_INTERNAL symbols are + expected to be present in dynamic symbol tables as they should have + been either removed or converted to STB_LOCAL binding by the static + linker. However some GNU binutils versions produce such symbols in + some cases. To prevent such symbols present in a buggy binary from + preempting global symbols we filter them out with this predicate. */ +static __always_inline bool +dl_symbol_visibility_binds_local_p (const ElfW(Sym) *sym) +{ + return (ELFW(ST_VISIBILITY) (sym->st_other) == STV_HIDDEN + || ELFW(ST_VISIBILITY) (sym->st_other) == STV_INTERNAL); +} + /* Unmap a loaded object, called by _dl_close (). */ #ifndef DL_UNMAP_IS_SPECIAL # define DL_UNMAP(map) _dl_unmap_segments (map) diff --git a/sysdeps/generic/math-tests.h b/sysdeps/generic/math-tests.h index 9393229..974dda4 100644 --- a/sysdeps/generic/math-tests.h +++ b/sysdeps/generic/math-tests.h @@ -87,3 +87,12 @@ # define EXCEPTION_ENABLE_SUPPORTED(EXCEPT) \ (EXCEPTION_TESTS_float || EXCEPTION_TESTS_double) #endif + +/* Indicate whether exception traps, if enabled, occur whenever an + exception flag is set explicitly, so it is not possible to set flag + bits with traps enabled without causing traps to be taken. If + traps cannot be enabled, the value of this macro does not + matter. */ +#ifndef EXCEPTION_SET_FORCES_TRAP +# define EXCEPTION_SET_FORCES_TRAP 0 +#endif diff --git a/sysdeps/gnu/netinet/udp.h b/sysdeps/gnu/netinet/udp.h index bcc3213..e3d4492 100644 --- a/sysdeps/gnu/netinet/udp.h +++ b/sysdeps/gnu/netinet/udp.h @@ -87,6 +87,8 @@ struct udphdr #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ #define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ +#define UDP_ENCAP_GTP0 4 /* GSM TS 09.60 */ +#define UDP_ENCAP_GTP1U 5 /* 3GPP TS 29.060 */ #define SOL_UDP 17 /* sockopt level for UDP */ diff --git a/sysdeps/hppa/fpu/libm-test-ulps b/sysdeps/hppa/fpu/libm-test-ulps index 3f1f2fa..fcd8e49 100644 --- a/sysdeps/hppa/fpu/libm-test-ulps +++ b/sysdeps/hppa/fpu/libm-test-ulps @@ -1,6 +1,10 @@ # Begin of automatic generation # Maximal error of functions: +Function: "acos": +float: 1 +ifloat: 1 + Function: "acos_downward": double: 1 float: 1 @@ -15,30 +19,36 @@ ifloat: 1 Function: "acos_upward": double: 1 -idouble: 1 - -Function: "acosh": -double: 1 float: 1 idouble: 1 ifloat: 1 +Function: "acosh": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 + Function: "acosh_downward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "acosh_towardzero": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "acosh_upward": -double: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 + +Function: "asin": float: 1 -idouble: 1 ifloat: 1 Function: "asin_downward": @@ -66,10 +76,10 @@ idouble: 1 ifloat: 1 Function: "asinh_downward": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 Function: "asinh_towardzero": double: 2 @@ -78,9 +88,13 @@ idouble: 2 ifloat: 2 Function: "asinh_upward": -double: 2 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 + +Function: "atan": float: 1 -idouble: 2 ifloat: 1 Function: "atan2": @@ -107,9 +121,9 @@ ifloat: 2 Function: "atan_downward": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 Function: "atan_towardzero": double: 1 @@ -119,33 +133,49 @@ ifloat: 1 Function: "atan_upward": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 Function: "atanh": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 + +Function: "atanh_downward": +double: 3 +float: 3 +idouble: 3 +ifloat: 3 + +Function: "atanh_towardzero": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 + +Function: "atanh_upward": +double: 3 +float: 3 +idouble: 3 +ifloat: 3 + +Function: "cabs": double: 1 -float: 1 idouble: 1 -ifloat: 1 -Function: "atanh_downward": +Function: "cabs_downward": double: 1 -float: 1 idouble: 1 -ifloat: 1 -Function: "atanh_towardzero": +Function: "cabs_towardzero": double: 1 -float: 1 idouble: 1 -ifloat: 1 -Function: "atanh_upward": +Function: "cabs_upward": double: 1 -float: 1 idouble: 1 -ifloat: 1 Function: Real part of "cacos": double: 1 @@ -160,9 +190,9 @@ idouble: 1 ifloat: 2 Function: Real part of "cacos_downward": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Imaginary part of "cacos_downward": @@ -172,9 +202,9 @@ idouble: 5 ifloat: 3 Function: Real part of "cacos_towardzero": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Imaginary part of "cacos_towardzero": @@ -214,9 +244,9 @@ idouble: 5 ifloat: 3 Function: Imaginary part of "cacosh_downward": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Real part of "cacosh_towardzero": @@ -226,9 +256,9 @@ idouble: 5 ifloat: 3 Function: Imaginary part of "cacosh_towardzero": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Real part of "cacosh_upward": @@ -243,6 +273,10 @@ float: 2 idouble: 2 ifloat: 2 +Function: "carg": +float: 1 +ifloat: 1 + Function: "carg_downward": double: 1 float: 2 @@ -250,8 +284,10 @@ idouble: 1 ifloat: 2 Function: "carg_towardzero": -float: 1 -ifloat: 1 +double: 1 +float: 2 +idouble: 1 +ifloat: 2 Function: "carg_upward": double: 1 @@ -298,9 +334,9 @@ idouble: 5 ifloat: 3 Function: Real part of "casin_upward": -double: 1 +double: 2 float: 1 -idouble: 1 +idouble: 2 ifloat: 1 Function: Imaginary part of "casin_upward": @@ -356,9 +392,9 @@ idouble: 4 ifloat: 4 Function: Imaginary part of "casinh_upward": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 Function: Real part of "catan": @@ -458,29 +494,31 @@ idouble: 1 ifloat: 1 Function: "cbrt": -double: 1 +double: 3 float: 1 -idouble: 1 +idouble: 3 ifloat: 1 ildouble: 1 ldouble: 1 Function: "cbrt_downward": -double: 2 +double: 4 float: 1 -idouble: 2 +idouble: 4 ifloat: 1 Function: "cbrt_towardzero": -double: 2 -idouble: 2 - -Function: "cbrt_upward": double: 3 float: 1 idouble: 3 ifloat: 1 +Function: "cbrt_upward": +double: 5 +float: 1 +idouble: 5 +ifloat: 1 + Function: Real part of "ccos": double: 1 float: 1 @@ -593,71 +631,107 @@ float: 2 idouble: 1 ifloat: 2 -Function: Real part of "clog": +Function: Real part of "cexp_downward": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 + +Function: Imaginary part of "cexp_downward": +double: 1 +float: 3 +idouble: 1 +ifloat: 3 + +Function: Real part of "cexp_towardzero": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 + +Function: Imaginary part of "cexp_towardzero": +double: 1 +float: 3 +idouble: 1 +ifloat: 3 + +Function: Real part of "cexp_upward": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 + +Function: Imaginary part of "cexp_upward": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 + +Function: Real part of "clog": +double: 3 +float: 3 +idouble: 3 +ifloat: 3 Function: Imaginary part of "clog": float: 1 ifloat: 1 Function: Real part of "clog10": +double: 3 +float: 4 +idouble: 3 +ifloat: 4 + +Function: Imaginary part of "clog10": double: 2 float: 2 idouble: 2 ifloat: 2 - -Function: Imaginary part of "clog10": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 ildouble: 1 ldouble: 1 Function: Real part of "clog10_downward": -double: 3 -float: 3 -idouble: 3 -ifloat: 3 +double: 5 +float: 4 +idouble: 5 +ifloat: 4 Function: Imaginary part of "clog10_downward": double: 3 -float: 2 +float: 4 idouble: 3 -ifloat: 2 +ifloat: 4 Function: Real part of "clog10_towardzero": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 +double: 5 +float: 5 +idouble: 5 +ifloat: 5 Function: Imaginary part of "clog10_towardzero": double: 3 -float: 2 +float: 4 idouble: 3 -ifloat: 2 +ifloat: 4 Function: Real part of "clog10_upward": -double: 4 -float: 3 -idouble: 4 -ifloat: 3 +double: 6 +float: 5 +idouble: 6 +ifloat: 5 Function: Imaginary part of "clog10_upward": double: 2 -float: 2 +float: 4 idouble: 2 -ifloat: 2 +ifloat: 4 Function: Real part of "clog_downward": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 +double: 4 +float: 3 +idouble: 4 +ifloat: 3 Function: Imaginary part of "clog_downward": double: 1 @@ -666,22 +740,22 @@ idouble: 1 ifloat: 2 Function: Real part of "clog_towardzero": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 +double: 4 +float: 4 +idouble: 4 +ifloat: 4 Function: Imaginary part of "clog_towardzero": double: 1 -float: 2 +float: 3 idouble: 1 -ifloat: 2 +ifloat: 3 Function: Real part of "clog_upward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 +double: 4 +float: 3 +idouble: 4 +ifloat: 3 Function: Imaginary part of "clog_upward": double: 2 @@ -832,9 +906,9 @@ idouble: 2 ifloat: 2 Function: Real part of "csin_upward": -double: 1 +double: 2 float: 3 -idouble: 1 +idouble: 2 ifloat: 3 Function: Imaginary part of "csin_upward": @@ -856,10 +930,10 @@ ildouble: 1 ldouble: 1 Function: Real part of "csinh_downward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: Imaginary part of "csinh_downward": double: 2 @@ -892,52 +966,52 @@ idouble: 2 ifloat: 3 Function: Real part of "csqrt": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Imaginary part of "csqrt": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: Real part of "csqrt_downward": -double: 3 -float: 3 -idouble: 3 -ifloat: 3 - -Function: Imaginary part of "csqrt_downward": double: 2 float: 2 idouble: 2 ifloat: 2 -Function: Real part of "csqrt_towardzero": +Function: Imaginary part of "csqrt": double: 2 float: 2 idouble: 2 ifloat: 2 +Function: Real part of "csqrt_downward": +double: 5 +float: 4 +idouble: 5 +ifloat: 4 + +Function: Imaginary part of "csqrt_downward": +double: 4 +float: 3 +idouble: 4 +ifloat: 3 + +Function: Real part of "csqrt_towardzero": +double: 4 +float: 3 +idouble: 4 +ifloat: 3 + Function: Imaginary part of "csqrt_towardzero": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 +double: 4 +float: 3 +idouble: 4 +ifloat: 3 Function: Real part of "csqrt_upward": -double: 3 -float: 2 -idouble: 3 -ifloat: 2 +double: 5 +float: 4 +idouble: 5 +ifloat: 4 Function: Imaginary part of "csqrt_upward": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 Function: Real part of "ctan": double: 1 @@ -1065,47 +1139,59 @@ ifloat: 3 Function: "erf": double: 1 +float: 1 idouble: 1 +ifloat: 1 ildouble: 1 ldouble: 1 Function: "erf_downward": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: "erf_towardzero": +double: 1 float: 1 +idouble: 1 ifloat: 1 Function: "erf_upward": -float: 1 -ifloat: 1 - -Function: "erfc": double: 1 float: 1 idouble: 1 ifloat: 1 + +Function: "erfc": +double: 3 +float: 2 +idouble: 3 +ifloat: 2 ildouble: 1 ldouble: 1 Function: "erfc_downward": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 +double: 5 +float: 6 +idouble: 5 +ifloat: 6 Function: "erfc_towardzero": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 +double: 3 +float: 4 +idouble: 3 +ifloat: 4 Function: "erfc_upward": -double: 2 -float: 2 -idouble: 2 -ifloat: 2 +double: 5 +float: 6 +idouble: 5 +ifloat: 6 + +Function: "exp": +float: 1 +ifloat: 1 Function: "exp10": double: 6 @@ -1116,9 +1202,9 @@ ildouble: 6 ldouble: 6 Function: "exp10_downward": -double: 1 +double: 2 float: 1 -idouble: 1 +idouble: 2 ifloat: 1 Function: "exp10_tonearest": @@ -1126,12 +1212,36 @@ double: 1 idouble: 1 Function: "exp10_towardzero": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 + +Function: "exp10_upward": +double: 2 +float: 1 +idouble: 2 +ifloat: 1 + +Function: "exp2": double: 1 float: 1 idouble: 1 ifloat: 1 -Function: "exp10_upward": +Function: "exp2_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 + +Function: "exp2_towardzero": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 + +Function: "exp2_upward": double: 1 float: 1 idouble: 1 @@ -1177,9 +1287,9 @@ ifloat: 1 Function: "expm1_towardzero": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 Function: "expm1_upward": double: 1 @@ -1188,28 +1298,28 @@ idouble: 1 ifloat: 1 Function: "gamma": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 +double: 4 +float: 4 +idouble: 4 +ifloat: 4 Function: "gamma_downward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 +double: 5 +float: 4 +idouble: 5 +ifloat: 4 Function: "gamma_towardzero": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 5 +float: 4 +idouble: 5 +ifloat: 4 Function: "gamma_upward": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 +double: 5 +float: 5 +idouble: 5 +ifloat: 5 Function: "hypot": double: 1 @@ -1289,134 +1399,166 @@ ifloat: 5 ildouble: 4 ldouble: 4 +Function: "jn_downward": +double: 5 +float: 5 +idouble: 5 +ifloat: 5 + +Function: "jn_towardzero": +double: 5 +float: 5 +idouble: 5 +ifloat: 5 + +Function: "jn_upward": +double: 5 +float: 5 +idouble: 5 +ifloat: 5 + Function: "lgamma": -double: 1 -float: 2 -idouble: 1 -ifloat: 2 +double: 4 +float: 4 +idouble: 4 +ifloat: 4 ildouble: 1 ldouble: 1 Function: "lgamma_downward": -double: 2 -float: 1 -idouble: 2 -ifloat: 1 +double: 5 +float: 4 +idouble: 5 +ifloat: 4 Function: "lgamma_towardzero": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 5 +float: 4 +idouble: 5 +ifloat: 4 Function: "lgamma_upward": -double: 1 -float: 3 -idouble: 1 -ifloat: 3 +double: 5 +float: 5 +idouble: 5 +ifloat: 5 Function: "log": float: 1 ifloat: 1 Function: "log10": -double: 1 +double: 2 float: 2 -idouble: 1 +idouble: 2 ifloat: 2 ildouble: 1 ldouble: 1 Function: "log10_downward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 3 +idouble: 2 +ifloat: 3 Function: "log10_towardzero": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "log10_upward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "log1p": -float: 1 -ifloat: 1 - -Function: "log1p_downward": double: 1 float: 1 idouble: 1 ifloat: 1 +Function: "log1p_downward": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 + Function: "log1p_towardzero": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "log1p_upward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "log2_downward": double: 2 float: 2 idouble: 2 ifloat: 2 -Function: "log2_towardzero": -double: 1 +Function: "log2": +double: 2 float: 1 -idouble: 1 +idouble: 2 ifloat: 1 -Function: "log2_upward": +Function: "log2_downward": +double: 3 +float: 3 +idouble: 3 +ifloat: 3 + +Function: "log2_towardzero": double: 2 float: 2 idouble: 2 ifloat: 2 +Function: "log2_upward": +double: 3 +float: 3 +idouble: 3 +ifloat: 3 + Function: "log_downward": -float: 1 -ifloat: 1 +float: 2 +ifloat: 2 + +Function: "log_towardzero": +float: 2 +ifloat: 2 Function: "log_upward": -float: 1 -ifloat: 1 +double: 1 +float: 2 +idouble: 1 +ifloat: 2 Function: "pow": float: 1 ifloat: 1 Function: "pow10": -double: 1 -idouble: 1 +double: 2 +idouble: 2 Function: "pow10_downward": -double: 1 +double: 2 float: 1 -idouble: 1 +idouble: 2 ifloat: 1 Function: "pow10_towardzero": -double: 1 +double: 2 float: 1 -idouble: 1 +idouble: 2 ifloat: 1 Function: "pow10_upward": -double: 1 +double: 2 float: 1 -idouble: 1 +idouble: 2 ifloat: 1 Function: "pow_downward": @@ -1489,31 +1631,39 @@ ifloat: 1 Function: "sincos_upward": double: 1 -float: 1 +float: 2 idouble: 1 -ifloat: 1 +ifloat: 2 + +Function: "sinh": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "sinh_downward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 Function: "sinh_towardzero": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "sinh_upward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 Function: "tan": double: 1 +float: 1 idouble: 1 +ifloat: 1 ildouble: 1 ldouble: 1 @@ -1535,32 +1685,56 @@ float: 1 idouble: 1 ifloat: 1 +Function: "tanh": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 + Function: "tanh_downward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 3 +float: 3 +idouble: 3 +ifloat: 3 Function: "tanh_towardzero": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 +double: 2 +float: 2 +idouble: 2 +ifloat: 2 Function: "tanh_upward": -double: 1 -float: 1 -idouble: 1 -ifloat: 1 - -Function: "tgamma": -double: 4 +double: 3 float: 3 -idouble: 4 +idouble: 3 ifloat: 3 + +Function: "tgamma": +double: 5 +float: 4 +idouble: 5 +ifloat: 4 ildouble: 1 ldouble: 1 +Function: "tgamma_downward": +double: 5 +float: 5 +idouble: 5 +ifloat: 5 + +Function: "tgamma_towardzero": +double: 5 +float: 4 +idouble: 5 +ifloat: 4 + +Function: "tgamma_upward": +double: 4 +float: 4 +idouble: 4 +ifloat: 4 + Function: "y0": double: 2 float: 1 diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile index 6c91842..e94f2cb 100644 --- a/sysdeps/i386/Makefile +++ b/sysdeps/i386/Makefile @@ -84,17 +84,20 @@ ifeq ($(subdir),csu) gen-as-const-headers += tlsdesc.sym endif -ifeq ($(subdir),elf) # Make sure no code in ld.so uses mm/xmm/ymm/zmm registers on i386 since # the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters # which must be preserved. # With SSE disabled, ensure -fpmath is not set to use sse either. +rtld-CFLAGS = -mno-sse -mno-mmx -mfpmath=387 +ifeq ($(subdir),elf) CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ - -mno-sse -mno-mmx -mfpmath=387) + $(rtld-CFLAGS)) tests-special += $(objpfx)tst-ld-sse-use.out $(objpfx)tst-ld-sse-use.out: ../sysdeps/i386/tst-ld-sse-use.sh $(objpfx)ld.so @echo "Checking ld.so for SSE register use. This will take a few seconds..." $(BASH) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@; \ $(evaluate-test) +else +CFLAGS-.os += $(if $(filter rtld-%.os,$(@F)), $(rtld-CFLAGS)) endif diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps index 646b9e3..cb82d3e 100644 --- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps +++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps @@ -1628,9 +1628,9 @@ ldouble: 2 Function: "j0_downward": double: 1 -float: 2 +float: 3 idouble: 1 -ifloat: 2 +ifloat: 3 ildouble: 4 ldouble: 4 diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c index ca2532f..7c9a079 100644 --- a/sysdeps/ieee754/dbl-64/s_sin.c +++ b/sysdeps/ieee754/dbl-64/s_sin.c @@ -803,7 +803,7 @@ sloww (double x, double dx, double orig, int k) a = t - y; da = ((t - a) - y) + da; - if (n == 2 || n == 1) + if (n & 2) { a = -a; da = -da; @@ -817,7 +817,7 @@ sloww (double x, double dx, double orig, int k) if (w[0] == w[0] + cor) return (a > 0) ? w[0] : -w[0]; - return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true); + return k ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true); } /***************************************************************************/ diff --git a/sysdeps/ieee754/dbl-64/s_trunc.c b/sysdeps/ieee754/dbl-64/s_trunc.c index f64e097..7663f61 100644 --- a/sysdeps/ieee754/dbl-64/s_trunc.c +++ b/sysdeps/ieee754/dbl-64/s_trunc.c @@ -53,8 +53,10 @@ __trunc (double x) return x; } +#ifndef __trunc weak_alias (__trunc, trunc) -#ifdef NO_LONG_DOUBLE +# ifdef NO_LONG_DOUBLE strong_alias (__trunc, __truncl) weak_alias (__trunc, truncl) +# endif #endif diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c index 81ac55e..f961e52 100644 --- a/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c +++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c @@ -48,8 +48,10 @@ __trunc (double x) return x; } +#ifndef __trunc weak_alias (__trunc, trunc) -#ifdef NO_LONG_DOUBLE +# ifdef NO_LONG_DOUBLE strong_alias (__trunc, __truncl) weak_alias (__trunc, truncl) +# endif #endif diff --git a/sysdeps/ieee754/flt-32/s_truncf.c b/sysdeps/ieee754/flt-32/s_truncf.c index 43d35c7..5228ec6 100644 --- a/sysdeps/ieee754/flt-32/s_truncf.c +++ b/sysdeps/ieee754/flt-32/s_truncf.c @@ -48,4 +48,6 @@ __truncf (float x) return x; } +#ifndef __truncf weak_alias (__truncf, truncf) +#endif diff --git a/sysdeps/ieee754/ldbl-128/k_tanl.c b/sysdeps/ieee754/ldbl-128/k_tanl.c index 6bb221e..cd2bbf5 100644 --- a/sysdeps/ieee754/ldbl-128/k_tanl.c +++ b/sysdeps/ieee754/ldbl-128/k_tanl.c @@ -98,7 +98,7 @@ __kernel_tanl (long double x, long double y, int iy) { /* generate inexact */ if ((ix | u.parts32.w1 | u.parts32.w2 | u.parts32.w3 | (iy + 1)) == 0) - return one / fabs (x); + return one / fabsl (x); else if (iy == 1) { math_check_force_underflow (x); diff --git a/sysdeps/ieee754/ldbl-128/s_atanl.c b/sysdeps/ieee754/ldbl-128/s_atanl.c index aaae701..35577a8 100644 --- a/sysdeps/ieee754/ldbl-128/s_atanl.c +++ b/sysdeps/ieee754/ldbl-128/s_atanl.c @@ -231,7 +231,7 @@ __atanl (long double x) Roundoff to integer is asymmetrical to avoid cancellation when t < 0 (cf. fdlibm). */ k = 8.0 * x + 0.25; - u = 0.125 * k; + u = 0.125L * k; /* Small arctan argument. */ t = (x - u) / (1.0 + x * u); } diff --git a/sysdeps/ieee754/ldbl-128/s_logbl.c b/sysdeps/ieee754/ldbl-128/s_logbl.c index 3ba67b7..b7c1ca1 100644 --- a/sysdeps/ieee754/ldbl-128/s_logbl.c +++ b/sysdeps/ieee754/ldbl-128/s_logbl.c @@ -34,7 +34,7 @@ __logbl (long double x) GET_LDOUBLE_WORDS64 (hx, lx, x); hx &= 0x7fffffffffffffffLL; /* high |x| */ if ((hx | lx) == 0) - return -1.0 / fabs (x); + return -1.0 / fabsl (x); if (hx >= 0x7fff000000000000LL) return x * x; if ((ex = hx >> 48) == 0) /* IEEE 754 logb */ diff --git a/sysdeps/m68k/Makefile b/sysdeps/m68k/Makefile index 22a961c..4d5515d 100644 --- a/sysdeps/m68k/Makefile +++ b/sysdeps/m68k/Makefile @@ -43,3 +43,7 @@ endif ifeq ($(subdir),elf) CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused endif + +ifeq ($(subdir),gmon) +CFLAGS-mcount.c += -Wno-frame-address +endif diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c index 770a42e..51cfbd7 100644 --- a/sysdeps/mach/hurd/recvmsg.c +++ b/sysdeps/mach/hurd/recvmsg.c @@ -64,7 +64,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) &message->msg_flags, amount))) return __hurd_sockfail (fd, flags, err); - if (message->msg_name != NULL) + if (message->msg_name != NULL && aport != MACH_PORT_NULL) { char *buf = message->msg_name; mach_msg_type_number_t buflen = message->msg_namelen; @@ -98,6 +98,8 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) if (buflen > 0) ((struct sockaddr *) message->msg_name)->sa_family = type; } + else if (message->msg_name != NULL) + message->msg_namelen = 0; __mach_port_deallocate (__mach_task_self (), aport); diff --git a/sysdeps/powerpc/fpu/fsetexcptflg.c b/sysdeps/powerpc/fpu/fsetexcptflg.c index a066405..cb440d5 100644 --- a/sysdeps/powerpc/fpu/fsetexcptflg.c +++ b/sysdeps/powerpc/fpu/fsetexcptflg.c @@ -31,7 +31,10 @@ __fesetexceptflag (const fexcept_t *flagp, int excepts) flag = *flagp & excepts; /* Replace the exception status */ - n.l = ((u.l & ~(FPSCR_STICKY_BITS & excepts)) + int excepts_mask = FPSCR_STICKY_BITS & excepts; + if ((excepts & FE_INVALID) != 0) + excepts_mask |= FE_ALL_INVALID; + n.l = ((u.l & ~excepts_mask) | (flag & FPSCR_STICKY_BITS) | (flag >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT)) & FE_INVALID_SOFTWARE)); diff --git a/sysdeps/powerpc/ifunc-sel.h b/sysdeps/powerpc/ifunc-sel.h index 526d8ed..ac589bd 100644 --- a/sysdeps/powerpc/ifunc-sel.h +++ b/sysdeps/powerpc/ifunc-sel.h @@ -17,15 +17,17 @@ ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void)) "addis %0,11,%2-1b@ha\n\t" "addi %0,%0,%2-1b@l\n\t" "cmpwi 12,1\n\t" - "beqlr\n\t" + "beq 2f\n\t" "addis %0,11,%3-1b@ha\n\t" "addi %0,%0,%3-1b@l\n\t" "cmpwi 12,-1\n\t" - "beqlr\n\t" + "beq 2f\n\t" "addis %0,11,%4-1b@ha\n\t" - "addi %0,%0,%4-1b@l" + "addi %0,%0,%4-1b@l\n\t" + "2:" : "=r" (ret) - : "X" (&global), "X" (f1), "X" (f2), "X" (f3)); + : "i" (&global), "i" (f1), "i" (f2), "i" (f3) + : "11", "12", "cr0"); return ret; } @@ -40,7 +42,8 @@ ifunc_one (int (*f1) (void)) "addis %0,%0,%1-1b@ha\n\t" "addi %0,%0,%1-1b@l" : "=r" (ret) - : "X" (f1)); + : "i" (f1) + : "12"); return ret; } #endif diff --git a/sysdeps/powerpc/math-tests.h b/sysdeps/powerpc/math-tests.h index 31042fa..426a027 100644 --- a/sysdeps/powerpc/math-tests.h +++ b/sysdeps/powerpc/math-tests.h @@ -24,4 +24,10 @@ <http://gcc.gnu.org/PR56828>. */ #define SNAN_TESTS_TYPE_CAST 0 +#ifndef __NO_FPRS__ +/* Setting exception flags in FPSCR results in enabled traps for those + exceptions being taken. */ +# define EXCEPTION_SET_FORCES_TRAP 1 +#endif + #include_next <math-tests.h> diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile index 590a8eb..804e7dc 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile @@ -34,4 +34,9 @@ CFLAGS-s_logb-power7.c = -mcpu=power7 CFLAGS-s_logbf-power7.c = -mcpu=power7 CFLAGS-e_hypot-power7.c = -mcpu=power7 CFLAGS-e_hypotf-power7.c = -mcpu=power7 + +# These files quiet sNaNs in a way that is optimized away without +# -fsignaling-nans. +CFLAGS-s_modf-ppc32.c += -fsignaling-nans +CFLAGS-s_modff-ppc32.c += -fsignaling-nans endif diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile index add1fb8..ff42288 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile @@ -35,4 +35,9 @@ CFLAGS-s_modf-power5+.c = -mcpu=power5+ CFLAGS-s_modff-power5+.c = -mcpu=power5+ CFLAGS-e_hypot-power7.c = -mcpu=power7 CFLAGS-e_hypotf-power7.c = -mcpu=power7 + +# These files quiet sNaNs in a way that is optimized away without +# -fsignaling-nans. +CFLAGS-s_modf-ppc64.c += -fsignaling-nans +CFLAGS-s_modff-ppc64.c += -fsignaling-nans endif diff --git a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S index 63f6217..c83dc52 100644 --- a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S +++ b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S @@ -40,11 +40,20 @@ vsel v5, v7, v5, v8; \ vcmpequb. v7, v5, v4; -/* Get 16 bytes for unaligned case. */ +/* + * Get 16 bytes for unaligned case. + * reg1: Vector to hold next 16 bytes. + * reg2: Address to read from. + * reg3: Permute control vector. + * v8: Tmp vector used to mask unwanted bytes. + * v9: Tmp vector,0 when null is found on first 16 bytes + */ #ifdef __LITTLE_ENDIAN__ #define GET16BYTES(reg1, reg2, reg3) \ lvx reg1, 0, reg2; \ - vcmpequb. v8, v0, reg1; \ + vspltisb v8, -1; \ + vperm v8, v8, reg1, reg3; \ + vcmpequb. v8, v0, v8; \ beq cr6, 1f; \ vspltisb v9, 0; \ b 2f; \ @@ -57,7 +66,9 @@ #else #define GET16BYTES(reg1, reg2, reg3) \ lvx reg1, 0, reg2; \ - vcmpequb. v8, v0, reg1; \ + vspltisb v8, -1; \ + vperm v8, reg1, v8, reg3; \ + vcmpequb. v8, v0, v8; \ beq cr6, 1f; \ vspltisb v9, 0; \ b 2f; \ diff --git a/sysdeps/s390/linkmap.h b/sysdeps/s390/linkmap.h index fc1fba3..283615b 100644 --- a/sysdeps/s390/linkmap.h +++ b/sysdeps/s390/linkmap.h @@ -2,12 +2,12 @@ struct link_map_machine { Elf64_Addr plt; /* Address of .plt + 0x2e */ - Elf64_Addr gotplt; /* Address of .got + 0x18 */ + const Elf64_Rela *jmprel; /* Address of first JMP_SLOT reloc */ }; #else struct link_map_machine { Elf32_Addr plt; /* Address of .plt + 0x2c */ - Elf32_Addr gotplt; /* Address of .got + 0x0c */ + const Elf32_Rela *jmprel; /* Address of first JMP_SLOT reloc */ }; #endif diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h index ec0ae4a..0a58897 100644 --- a/sysdeps/s390/s390-32/dl-machine.h +++ b/sysdeps/s390/s390-32/dl-machine.h @@ -109,7 +109,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) if (got[1]) { l->l_mach.plt = got[1] + l->l_addr; - l->l_mach.gotplt = (Elf32_Addr) &got[3]; + l->l_mach.jmprel = (const Elf32_Rela *) D_PTR (l, l_info[DT_JMPREL]); } got[1] = (Elf32_Addr) l; /* Identify this shared object. */ @@ -506,9 +506,7 @@ elf_machine_lazy_rel (struct link_map *map, if (__builtin_expect (map->l_mach.plt, 0) == 0) *reloc_addr += l_addr; else - *reloc_addr = - map->l_mach.plt - + (((Elf32_Addr) reloc_addr) - map->l_mach.gotplt) * 8; + *reloc_addr = map->l_mach.plt + (reloc - map->l_mach.jmprel) * 32; } else if (__glibc_likely (r_type == R_390_IRELATIVE)) { diff --git a/sysdeps/s390/s390-32/memcpy.S b/sysdeps/s390/s390-32/memcpy.S index 6be5104..1a8bdbf 100644 --- a/sysdeps/s390/s390-32/memcpy.S +++ b/sysdeps/s390/s390-32/memcpy.S @@ -42,20 +42,18 @@ ENTRY(memcpy) .machine "g5" lr %r1,%r2 # r1: Use as dest ; r2: Return dest .L_G5_start: - st %r13,52(%r15) - .cfi_offset 13, -44 - basr %r13,0 -.L_G5_16: ltr %r4,%r4 - je .L_G5_4 + je .L_G5_99 ahi %r4,-1 lr %r5,%r4 srl %r5,8 ltr %r5,%r5 jne .L_G5_13 - ex %r4,.L_G5_17-.L_G5_16(%r13) .L_G5_4: - l %r13,52(%r15) + basr %r5,0 +.L_G5_16: + ex %r4,.L_G5_17-.L_G5_16(%r5) +.L_G5_99: br %r14 .L_G5_13: chi %r5,4096 # Switch to mvcle for copies >1MB @@ -65,7 +63,6 @@ ENTRY(memcpy) la %r1,256(%r1) la %r3,256(%r3) brct %r5,.L_G5_12 - ex %r4,.L_G5_17-.L_G5_16(%r13) j .L_G5_4 .L_G5_17: mvc 0(1,%r1),0(%r3) diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h index 9ee7c92..6e5ee1e 100644 --- a/sysdeps/s390/s390-64/dl-machine.h +++ b/sysdeps/s390/s390-64/dl-machine.h @@ -98,7 +98,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) if (got[1]) { l->l_mach.plt = got[1] + l->l_addr; - l->l_mach.gotplt = (Elf64_Addr) &got[3]; + l->l_mach.jmprel = (const Elf64_Rela *) D_PTR (l, l_info[DT_JMPREL]); } got[1] = (Elf64_Addr) l; /* Identify this shared object. */ @@ -460,9 +460,7 @@ elf_machine_lazy_rel (struct link_map *map, if (__builtin_expect (map->l_mach.plt, 0) == 0) *reloc_addr += l_addr; else - *reloc_addr = - map->l_mach.plt - + (((Elf64_Addr) reloc_addr) - map->l_mach.gotplt) * 4; + *reloc_addr = map->l_mach.plt + (reloc - map->l_mach.jmprel) * 32; } else if (__glibc_likely (r_type == R_390_IRELATIVE)) { diff --git a/sysdeps/sparc/sparc32/fpu/s_fdim.S b/sysdeps/sparc/sparc32/fpu/s_fdim.S deleted file mode 100644 index e93970f..0000000 --- a/sysdeps/sparc/sparc32/fpu/s_fdim.S +++ /dev/null @@ -1,42 +0,0 @@ -/* Compute positive difference, sparc 32-bit. - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> -#include <math_ldbl_opt.h> - -ENTRY(__fdim) - std %o0, [%sp + 72] - std %o2, [%sp + 80] - ldd [%sp + 72], %f0 - ldd [%sp + 80], %f2 - fcmpd %f0, %f2 - st %g0, [%sp + 72] - fbug 1f - st %g0, [%sp + 76] - ldd [%sp + 72], %f0 - fnegs %f0, %f2 - fmovs %f1, %f3 -1: retl - fsubd %f0, %f2, %f0 -END(__fdim) -weak_alias (__fdim, fdim) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __fdim, fdiml, GLIBC_2_1); -#endif diff --git a/sysdeps/sparc/sparc32/sparcv9/Makefile b/sysdeps/sparc/sparc32/sparcv9/Makefile index fefc742..08c5a96 100644 --- a/sysdeps/sparc/sparc32/sparcv9/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/Makefile @@ -1,4 +1,4 @@ -sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a +sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a -mvis ifeq ($(have-as-vis3),yes) ASFLAGS-.o += -Wa,-Av9d diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile index 0d92813..4489b70 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile @@ -1,15 +1,14 @@ ifeq ($(subdir),math) -libm-sysdep_routines += s_ceil-vis2 s_ceilf-vis2 \ - s_floor-vis2 s_floorf-vis2 ifeq ($(have-as-vis3),yes) -libm-sysdep_routines += m_copysignf-vis3 m_copysign-vis3 s_ceilf-vis3 \ - s_ceil-vis3 s_fabs-vis3 s_fabsf-vis3 s_floor-vis3 \ - s_floorf-vis3 s_llrintf-vis3 s_llrint-vis3 \ +libm-sysdep_routines += m_copysignf-vis3 m_copysign-vis3 s_fabs-vis3 \ + s_fabsf-vis3 s_llrintf-vis3 s_llrint-vis3 \ s_rintf-vis3 s_rint-vis3 w_sqrt-vis3 w_sqrtf-vis3 \ s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 s_fmax-vis3 \ - s_fmaf-vis3 s_fma-vis3 s_fdimf-vis3 s_fdim-vis3 \ - s_nearbyint-vis3 s_nearbyintf-vis3 s_truncf-vis3 \ - s_trunc-vis3 + s_fmaf-vis3 s_fma-vis3 s_nearbyint-vis3 \ + s_nearbyintf-vis3 s_fdimf-vis3 s_fdim-vis3 sysdep_routines += s_copysignf-vis3 s_copysign-vis3 + +CFLAGS-s_fdimf-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_fdim-vis3.c += -Wa,-Av9d -mvis3 endif endif diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S deleted file mode 100644 index edc24b3..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis2.S +++ /dev/null @@ -1,61 +0,0 @@ -/* ceil function, sparc32 v9 vis2 version. - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil_vis2) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - or %o0, %o1, %o0 - stx %o0, [%sp + 72] - sllx %o2, 32, %o2 - fzero ZERO - ldd [%sp + 72], %f0 - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + 72] - fabsd %f0, %f14 - ldd [%sp + 72], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__ceil_vis2) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S deleted file mode 100644 index 8b14c68..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil-vis3.S +++ /dev/null @@ -1,62 +0,0 @@ -/* ceil function, sparc32 v9 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - sllx %o2, 32, %o2 - or %o0, %o1, %o0 - movxtod %o0, %f0 - fzero ZERO - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__ceil_vis3) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S deleted file mode 100644 index efc8d49..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceil.S +++ /dev/null @@ -1,19 +0,0 @@ -#include <sparc-ifunc.h> -#include <math_ldbl_opt.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(ceil) - -weak_alias (__ceil, ceil) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __ceil, ceill, GLIBC_2_0) -#endif - -# undef weak_alias -# define weak_alias(a, b) -# undef compat_symbol -# define compat_symbol(a, b, c, d) - -#define __ceil __ceil_generic - -#include "../s_ceil.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S deleted file mode 100644 index 019681b..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis2.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Float ceil function, sparc32 v9 vis2 version. - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf_vis2) - st %o0, [%sp + 68] - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - ld [%sp + 68], %f0 - fnegs ZERO, SIGN_BIT - st %o2, [%sp + 68] - fabss %f0, %f14 - ld [%sp + 68], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f0, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - fadds %f0, %f16, %f1 - siam (1 << 2) | 0 - fsubs %f1, %f16, %f1 - siam (0 << 2) - retl - fors %f1, SIGN_BIT, %f0 -END (__ceilf_vis2) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S deleted file mode 100644 index 1bf306a..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf-vis3.S +++ /dev/null @@ -1,59 +0,0 @@ -/* Float ceil function, sparc32 v9 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf_vis3) - movwtos %o0, %f0 - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2, %f16 - fabss %f0, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f0, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - fadds %f0, %f16, %f1 - siam (1 << 2) | 0 - fsubs %f1, %f16, %f1 - siam (0 << 2) - retl - fors %f1, SIGN_BIT, %f0 -END (__ceilf_vis3) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S deleted file mode 100644 index 1c72a57..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_ceilf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(ceilf) - -weak_alias (__ceilf, ceilf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __ceilf __ceilf_generic - -#include "../s_ceilf.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c index 081fc15..2973b49 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c @@ -1,7 +1,6 @@ /* Compute positive difference, sparc 32-bit+v9+vis3. - Copyright (C) 2013-2016 Free Software Foundation, Inc. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,16 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#include <math.h> -ENTRY(__fdimf_vis3) - movwtos %o0, %f0 - movwtos %o1, %f1 - fcmps %f0, %f1 - fbug 1f - nop - fzeros %f0 - fnegs %f0, %f1 -1: retl - fsubs %f0, %f1, %f0 -END(__fdimf_vis3) +#define __fdim __fdim_vis3 + +#include <math/s_fdim.c> diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S deleted file mode 100644 index 4b13408..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S +++ /dev/null @@ -1,19 +0,0 @@ -#include <sparc-ifunc.h> -#include <math_ldbl_opt.h> - -SPARC_ASM_VIS3_IFUNC(fdim) - -weak_alias (__fdim, fdim) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __fdim, fdiml, GLIBC_2_1); -#endif - -# undef weak_alias -# define weak_alias(a, b) -# undef compat_symbol -# define compat_symbol(a, b, c, d) - -#define __fdim __fdim_generic - -#include "../s_fdim.S" diff --git a/sysdeps/sparc/sparc32/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c index c3fe8af..c9c7704 100644 --- a/sysdeps/sparc/sparc32/fpu/s_fdimf.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c @@ -1,7 +1,6 @@ /* Compute positive difference, sparc 32-bit. - Copyright (C) 2013-2016 Free Software Foundation, Inc. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,19 +16,17 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> - -ENTRY(__fdimf) - st %o0, [%sp + 72] - st %o1, [%sp + 76] - ld [%sp + 72], %f0 - ld [%sp + 76], %f1 - fcmps %f0, %f1 - fbug 1f - st %g0, [%sp + 72] - ld [%sp + 72], %f0 - fnegs %f0, %f1 -1: retl - fsubs %f0, %f1, %f0 -END(__fdimf) -weak_alias (__fdimf, fdimf) +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern double __fdim_vis3 (double, double); +extern double __fdim_generic (double, double); + +sparc_libm_ifunc(__fdim, hwcap & HWCAP_SPARC_VIS3 ? __fdim_vis3 : __fdim_generic); +weak_alias (__fdim, fdim) + +# define __fdim __fdim_generic +#endif + +#include <math/s_fdim.c> diff --git a/sysdeps/sparc/sparc64/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c index 356c23c..75997c6 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fdimf.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.c @@ -1,7 +1,6 @@ -/* Compute positive difference, sparc 64-bit. - Copyright (C) 2013-2016 Free Software Foundation, Inc. +/* Float compute positive difference, sparc 32-bit+v9+vis3. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,15 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> +#include <math.h> -ENTRY(__fdimf) - fcmps %f1, %f3 - fbug 1f - nop - fzeros %f1 - fnegs %f1, %f3 -1: retl - fsubs %f1, %f3, %f0 -END(__fdimf) -weak_alias (__fdimf, fdimf) +#define __fdimf __fdimf_vis3 + +#include <math/s_fdimf.c> diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S deleted file mode 100644 index 30381d6..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(fdimf) - -weak_alias (__fdimf, fdimf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __fdimf __fdimf_generic - -#include "../s_fdimf.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c index 9e0e3f2..767520f 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c @@ -1,7 +1,6 @@ -/* Compute positive difference, sparc 32-bit+v9. - Copyright (C) 2013-2016 Free Software Foundation, Inc. +/* Float compute positive difference, sparc 32-bit. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,19 +16,17 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> - -ENTRY(__fdimf) - st %o0, [%sp + 72] - st %o1, [%sp + 76] - ld [%sp + 72], %f0 - ld [%sp + 76], %f1 - fcmps %f0, %f1 - fbug 1f - nop - fzeros %f0 - fnegs %f0, %f1 -1: retl - fsubs %f0, %f1, %f0 -END(__fdimf) +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern float __fdimf_vis3 (float, float); +extern float __fdimf_generic (float, float); + +sparc_libm_ifunc(__fdimf, hwcap & HWCAP_SPARC_VIS3 ? __fdimf_vis3 : __fdimf_generic); weak_alias (__fdimf, fdimf) + +# define __fdimf __fdimf_generic +#endif + +#include <math/s_fdimf.c> diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S deleted file mode 100644 index 0180d10..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis2.S +++ /dev/null @@ -1,61 +0,0 @@ -/* floor function, sparc32 v9 vis2 version. - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor_vis2) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - or %o0, %o1, %o0 - stx %o0, [%sp + 72] - sllx %o2, 32, %o2 - fzero ZERO - ldd [%sp + 72], %f0 - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + 72] - fabsd %f0, %f14 - ldd [%sp + 72], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__floor_vis2) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S deleted file mode 100644 index 7b91620..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor-vis3.S +++ /dev/null @@ -1,62 +0,0 @@ -/* floor function, sparc32 v9 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - sllx %o2, 32, %o2 - or %o0, %o1, %o0 - movxtod %o0, %f0 - fzero ZERO - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__floor_vis3) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S deleted file mode 100644 index 1fe4b95..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floor.S +++ /dev/null @@ -1,19 +0,0 @@ -#include <sparc-ifunc.h> -#include <math_ldbl_opt.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(floor) - -weak_alias (__floor, floor) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __floor, floorl, GLIBC_2_0) -#endif - -# undef weak_alias -# define weak_alias(a, b) -# undef compat_symbol -# define compat_symbol(a, b, c, d) - -#define __floor __floor_generic - -#include "../s_floor.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S deleted file mode 100644 index 77e9f4b..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis2.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Float floor function, sparc32 v9 vis2 version. - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf_vis2) - st %o0, [%sp + 68] - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - ld [%sp + 68], %f0 - fnegs ZERO, SIGN_BIT - st %o2, [%sp + 68] - fabss %f0, %f14 - ld [%sp + 68], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f0, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - fadds %f0, %f16, %f1 - siam (1 << 2) | 0 - fsubs %f1, %f16, %f1 - siam (0 << 2) - retl - fors %f1, SIGN_BIT, %f0 -END (__floorf_vis2) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S deleted file mode 100644 index bf7da6f..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf-vis3.S +++ /dev/null @@ -1,59 +0,0 @@ -/* Float floor function, sparc32 v9 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf_vis3) - movwtos %o0, %f0 - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2, %f16 - fabss %f0, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f0, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - fadds %f0, %f16, %f1 - siam (1 << 2) | 0 - fsubs %f1, %f16, %f1 - siam (0 << 2) - retl - fors %f1, SIGN_BIT, %f0 -END (__floorf_vis3) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S deleted file mode 100644 index d2a83cb..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_floorf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(floorf) - -weak_alias (__floorf, floorf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __floorf __floorf_generic - -#include "../s_floorf.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S index 4475e8c..ff81b0d 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-vis3.S @@ -36,14 +36,15 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyint_vis3) + sllx %o0, 32, %o0 + or %o0, %o1, %o0 + movxtod %o0, %f0 + fcmpd %fcc3, %f0, %f0 /* Check for sNaN */ st %fsr, [%sp + 88] sethi %hi(TWO_FIFTYTWO), %o2 sethi %hi(0xf8003e0), %o5 ld [%sp + 88], %o4 - sllx %o0, 32, %o0 or %o5, %lo(0xf8003e0), %o5 - or %o0, %o1, %o0 - movxtod %o0, %f0 andn %o4, %o5, %o4 fzero ZERO st %o4, [%sp + 80] diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S index e39134b..833a0df 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-vis3.S @@ -35,8 +35,9 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyintf_vis3) - st %fsr, [%sp + 88] movwtos %o0, %f1 + fcmps %fcc3, %f1, %f1 /* Check for sNaN */ + st %fsr, [%sp + 88] sethi %hi(TWO_TWENTYTHREE), %o2 sethi %hi(0xf8003e0), %o5 ld [%sp + 88], %o4 diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S deleted file mode 100644 index 7f212d9..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc-vis3.S +++ /dev/null @@ -1,57 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc32 v9 vis3 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> -#include <math_ldbl_opt.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__trunc_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - or %o0, %o1, %o0 - fzero ZERO - movxtod %o0, %f0 - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f14 - fand %f0, SIGN_BIT, SIGN_BIT - fdtox %f14, %f14 - fxtod %f14, %f14 - faddd %f0, ZERO, %f18 - fmovduge %fcc3, %f18, %f14 - retl - for %f14, SIGN_BIT, %f0 -END (__trunc_vis3) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S deleted file mode 100644 index 3787fa1..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_trunc.S +++ /dev/null @@ -1,19 +0,0 @@ -#include <sparc-ifunc.h> -#include <math_ldbl_opt.h> - -SPARC_ASM_VIS3_IFUNC(trunc) - -weak_alias (__trunc, trunc) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __trunc, truncl, GLIBC_2_1) -#endif - -# undef weak_alias -# define weak_alias(a, b) -# undef compat_symbol -# define compat_symbol(a, b, c, d) - -#define __trunc __trunc_generic - -#include "../s_trunc.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S deleted file mode 100644 index 2acd04d..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf-vis3.S +++ /dev/null @@ -1,53 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc32 v9 vis3 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__truncf_vis3) - movwtos %o0, %f1 - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2, %f16 - fabss %f1, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f14 - fands %f1, SIGN_BIT, SIGN_BIT - fstoi %f14, %f14 - fitos %f14, %f14 - fadds %f1, ZERO, %f18 - fmovsuge %fcc3, %f18, %f14 - retl - fors %f14, SIGN_BIT, %f0 -END (__truncf_vis3) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S deleted file mode 100644 index 2ca2517..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_truncf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(truncf) - -weak_alias (__truncf, truncf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __truncf __truncf_generic - -#include "../s_truncf.S" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S deleted file mode 100644 index 0c477ee..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceil.S +++ /dev/null @@ -1,92 +0,0 @@ -/* ceil function, sparc32 v9 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> -#include <math_ldbl_opt.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ -#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - sethi %hi(ONE_DOT_ZERO), %o3 - or %o0, %o1, %o0 - stx %o0, [%sp + 72] - sllx %o2, 32, %o2 - fzero ZERO - sllx %o3, 32, %o3 - - ldd [%sp + 72], %f0 - fnegd ZERO, SIGN_BIT - - stx %o2, [%sp + 72] - fabsd %f0, %f14 - - ldd [%sp + 72], %f16 - fcmpd %fcc3, %f14, %f16 - - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - - for %f16, SIGN_BIT, %f16 - faddd %f0, %f16, %f18 - fsubd %f18, %f16, %f18 - fcmpd %fcc2, %f18, %f0 - stx %o3, [%sp + 72] - - ldd [%sp + 72], %f20 - fmovduge %fcc2, ZERO, %f20 - faddd %f18, %f20, %f0 - fabsd %f0, %f0 - retl - for %f0, SIGN_BIT, %f0 -END (__ceil) -weak_alias (__ceil, ceil) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __ceil, ceill, GLIBC_2_0) -#endif diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S deleted file mode 100644 index 0861261..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_ceilf.S +++ /dev/null @@ -1,83 +0,0 @@ -/* Float ceil function, sparc32 v9 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ -#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf) - st %o0, [%sp + 68] - sethi %hi(TWO_TWENTYTHREE), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzeros ZERO - - ld [%sp + 68], %f0 - fnegs ZERO, SIGN_BIT - - st %o2, [%sp + 68] - fabss %f0, %f14 - - ld [%sp + 68], %f16 - fcmps %fcc3, %f14, %f16 - - fmovsuge %fcc3, ZERO, %f16 - fands %f0, SIGN_BIT, SIGN_BIT - - fors %f16, SIGN_BIT, %f16 - fadds %f0, %f16, %f1 - fsubs %f1, %f16, %f1 - fcmps %fcc2, %f1, %f0 - st %o3, [%sp + 68] - - ld [%sp + 68], %f9 - fmovsuge %fcc2, ZERO, %f9 - fadds %f1, %f9, %f0 - fabss %f0, %f0 - retl - fors %f0, SIGN_BIT, %f0 -END (__ceilf) -weak_alias (__ceilf, ceilf) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S deleted file mode 100644 index c59f864..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floor.S +++ /dev/null @@ -1,92 +0,0 @@ -/* floor function, sparc32 v9 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> -#include <math_ldbl_opt.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ -#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - sethi %hi(ONE_DOT_ZERO), %o3 - or %o0, %o1, %o0 - stx %o0, [%sp + 72] - sllx %o2, 32, %o2 - fzero ZERO - sllx %o3, 32, %o3 - - ldd [%sp + 72], %f0 - fnegd ZERO, SIGN_BIT - - stx %o2, [%sp + 72] - fabsd %f0, %f14 - - ldd [%sp + 72], %f16 - fcmpd %fcc3, %f14, %f16 - - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - - for %f16, SIGN_BIT, %f16 - faddd %f0, %f16, %f18 - fsubd %f18, %f16, %f18 - fcmpd %fcc2, %f18, %f0 - stx %o3, [%sp + 72] - - ldd [%sp + 72], %f20 - fmovdule %fcc2, ZERO, %f20 - fsubd %f18, %f20, %f0 - fabsd %f0, %f0 - retl - for %f0, SIGN_BIT, %f0 -END (__floor) -weak_alias (__floor, floor) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __floor, floorl, GLIBC_2_0) -#endif diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S deleted file mode 100644 index 64b1042..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_floorf.S +++ /dev/null @@ -1,83 +0,0 @@ -/* Float floor function, sparc32 v9 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ -#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf) - st %o0, [%sp + 68] - sethi %hi(TWO_TWENTYTHREE), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzeros ZERO - - ld [%sp + 68], %f0 - fnegs ZERO, SIGN_BIT - - st %o2, [%sp + 68] - fabss %f0, %f14 - - ld [%sp + 68], %f16 - fcmps %fcc3, %f14, %f16 - - fmovsuge %fcc3, ZERO, %f16 - fands %f0, SIGN_BIT, SIGN_BIT - - fors %f16, SIGN_BIT, %f16 - fadds %f0, %f16, %f1 - fsubs %f1, %f16, %f1 - fcmps %fcc2, %f1, %f0 - st %o3, [%sp + 68] - - ld [%sp + 68], %f9 - fmovsule %fcc2, ZERO, %f9 - fsubs %f1, %f9, %f0 - fabss %f0, %f0 - retl - fors %f0, SIGN_BIT, %f0 -END (__floorf) -weak_alias (__floorf, floorf) diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S index 29b56b4..198440a 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S @@ -36,20 +36,21 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyint) + sllx %o0, 32, %o0 + or %o0, %o1, %o0 + stx %o0, [%sp + 72] + ldd [%sp + 72], %f0 + fcmpd %fcc3, %f0, %f0 /* Check for sNaN */ st %fsr, [%sp + 88] sethi %hi(TWO_FIFTYTWO), %o2 sethi %hi(0xf8003e0), %o5 ld [%sp + 88], %o4 - sllx %o0, 32, %o0 or %o5, %lo(0xf8003e0), %o5 - or %o0, %o1, %o0 andn %o4, %o5, %o4 fzero ZERO st %o4, [%sp + 80] - stx %o0, [%sp + 72] sllx %o2, 32, %o2 fnegd ZERO, SIGN_BIT - ldd [%sp + 72], %f0 ld [%sp + 80], %fsr stx %o2, [%sp + 72] fabsd %f0, %f14 diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S index e2188b2..9be41f6 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S +++ b/sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S @@ -35,8 +35,10 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyintf) - st %fsr, [%sp + 88] st %o0, [%sp + 68] + ld [%sp + 68], %f1 + fcmps %fcc3, %f1, %f1 /* Check for sNaN */ + st %fsr, [%sp + 88] sethi %hi(TWO_TWENTYTHREE), %o2 sethi %hi(0xf8003e0), %o5 ld [%sp + 88], %o4 @@ -45,7 +47,6 @@ ENTRY (__nearbyintf) fnegs ZERO, SIGN_BIT andn %o4, %o5, %o4 st %o4, [%sp + 80] - ld [%sp + 68], %f1 ld [%sp + 80], %fsr st %o2, [%sp + 68] fabss %f1, %f14 diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S deleted file mode 100644 index 6f2ed8a..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_trunc.S +++ /dev/null @@ -1,64 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc32 v9 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> -#include <math_ldbl_opt.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__trunc) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o0, 32, %o0 - or %o0, %o1, %o0 - fzero ZERO - stx %o0, [%sp + 72] - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - ldd [%sp + 72], %f0 - stx %o2, [%sp + 72] - fabsd %f0, %f14 - ldd [%sp + 72], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f14 - fand %f0, SIGN_BIT, SIGN_BIT - fdtox %f14, %f14 - fxtod %f14, %f14 - faddd %f0, ZERO, %f18 - fmovduge %fcc3, %f18, %f14 - retl - for %f14, SIGN_BIT, %f0 -END (__trunc) -weak_alias (__trunc, trunc) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __trunc, truncl, GLIBC_2_1) -#endif diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S b/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S deleted file mode 100644 index eab9cfd..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_truncf.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc32 v9 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__truncf) - st %o0, [%sp + 68] - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - ld [%sp + 68], %f1 - fnegs ZERO, SIGN_BIT - st %o2, [%sp + 68] - fabss %f1, %f14 - ld [%sp + 68], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f14 - fands %f1, SIGN_BIT, SIGN_BIT - fstoi %f14, %f14 - fitos %f14, %f14 - fadds %f1, ZERO, %f18 - fmovsuge %fcc3, %f18, %f14 - retl - fors %f14, SIGN_BIT, %f0 -END (__truncf) -weak_alias (__truncf, truncf) diff --git a/sysdeps/sparc/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile index 3a12510..fbabf69 100644 --- a/sysdeps/sparc/sparc64/Makefile +++ b/sysdeps/sparc/sparc64/Makefile @@ -1,3 +1,5 @@ +sysdep-CFLAGS += -Wa,-Av9a -mvis + ifeq ($(subdir),string) sysdep_routines += align-cpy endif diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index 6a9274b..51f3709 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -1,18 +1,23 @@ ifeq ($(subdir),math) -libm-sysdep_routines += s_ceil-vis2 s_ceilf-vis2 \ - s_floor-vis2 s_floorf-vis2 ifeq ($(have-as-vis3),yes) -libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 s_ceilf-vis3 \ - s_ceil-vis3 m_finitef-vis3 m_finite-vis3 \ - s_floorf-vis3 s_floor-vis3 m_isinff-vis3 \ - m_isinf-vis3 m_isnanf-vis3 m_isnan-vis3 \ - s_lrintf-vis3 s_lrint-vis3 s_rintf-vis3 \ - s_rint-vis3 s_fminf-vis3 s_fmin-vis3 \ - s_fmaxf-vis3 s_fmax-vis3 s_fmaf-vis3 \ - s_fma-vis3 s_nearbyint-vis3 s_nearbyintf-vis3 \ - s_truncf-vis3 s_trunc-vis3 +libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 m_finitef-vis3 \ + m_finite-vis3 m_isinff-vis3 m_isinf-vis3 \ + m_isnanf-vis3 m_isnan-vis3 s_lrintf-vis3 \ + s_lrint-vis3 s_rintf-vis3 s_rint-vis3 \ + s_fminf-vis3 s_fmin-vis3 s_fmaxf-vis3 \ + s_fmax-vis3 s_fmaf-vis3 s_fma-vis3 \ + s_nearbyint-vis3 s_nearbyintf-vis3 \ + s_ceilf-vis3 s_ceil-vis3 s_floorf-vis3 \ + s_floor-vis3 s_truncf-vis3 s_trunc-vis3 sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \ s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \ s_isnanf-vis3 s_isnan-vis3 + +CFLAGS-s_ceilf-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_ceil-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_floorf-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_floor-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_truncf-vis3.c += -Wa,-Av9d -mvis3 +CFLAGS-s_trunc-vis3.c += -Wa,-Av9d -mvis3 endif endif diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S deleted file mode 100644 index fd1bf38..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis2.S +++ /dev/null @@ -1,57 +0,0 @@ -/* ceil function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil_vis2) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__ceil_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S deleted file mode 100644 index e6fa3f5..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.S +++ /dev/null @@ -1,59 +0,0 @@ -/* ceil function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__ceil_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/s_fdim.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c index 7fae72a..77d3537 100644 --- a/sysdeps/sparc/sparc64/fpu/s_fdim.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-vis3.c @@ -1,7 +1,6 @@ -/* Compute positive difference, sparc 64-bit. - Copyright (C) 2013-2016 Free Software Foundation, Inc. +/* ceil function, sparc64 vis3 version. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,16 +16,8 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> -#include <math_ldbl_opt.h> +#include <math.h> -ENTRY(__fdim) - fcmpd %f0, %f2 - fbug 1f - nop - fzero %f0 - fnegd %f0, %f2 -1: retl - fsubd %f0, %f2, %f0 -END(__fdim) -weak_alias (__fdim, fdim) +#define __ceil __ceil_vis3 + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S deleted file mode 100644 index e7822bc..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(ceil) - -weak_alias (__ceil, ceil) - -# undef weak_alias -# define weak_alias(a, b) - -#define __ceil __ceil_generic - -#include "../s_ceil.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c new file mode 100644 index 0000000..6d04b78 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c @@ -0,0 +1,32 @@ +/* ceil function, sparc64 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern double __ceil_vis3 (double); +extern double __ceil_generic (double); + +sparc_libm_ifunc(__ceil, hwcap & HWCAP_SPARC_VIS3 ? __ceil_vis3 : __ceil_generic); +weak_alias (__ceil, ceil) + +# define __ceil __ceil_generic +#endif + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S deleted file mode 100644 index fe57a52..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis2.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Float ceil function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf_vis2) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__ceilf_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S deleted file mode 100644 index 9a0f9c5..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Float ceil function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf_vis3) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2, %f16 - fabss %f1, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 2 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__ceilf_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c new file mode 100644 index 0000000..119fe46 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-vis3.c @@ -0,0 +1,23 @@ +/* Float ceil function, sparc64 vis3 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math.h> + +#define __ceilf __ceilf_vis3 + +#include <sysdeps/ieee754/flt-32/s_ceilf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S deleted file mode 100644 index 1c72a57..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(ceilf) - -weak_alias (__ceilf, ceilf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __ceilf __ceilf_generic - -#include "../s_ceilf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c new file mode 100644 index 0000000..5eca59f --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c @@ -0,0 +1,32 @@ +/* Float ceil function, sparc64 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern float __ceilf_vis3 (float); +extern float __ceilf_generic (float); + +sparc_libm_ifunc(__ceilf, hwcap & HWCAP_SPARC_VIS3 ? __ceilf_vis3 : __ceilf_generic); +weak_alias (__ceilf, ceilf) + +# define __ceilf __ceilf_generic +#endif + +#include <sysdeps/ieee754/flt-32/s_ceilf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S deleted file mode 100644 index 84fda73..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis2.S +++ /dev/null @@ -1,57 +0,0 @@ -/* floor function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor_vis2) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__floor_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S deleted file mode 100644 index 1b275c2..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.S +++ /dev/null @@ -1,59 +0,0 @@ -/* floor function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - fzero ZERO - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - for %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - faddd %f0, %f16, %f18 - siam (1 << 2) | 0 - fsubd %f18, %f16, %f18 - siam (0 << 2) - retl - for %f18, SIGN_BIT, %f0 -END (__floor_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c new file mode 100644 index 0000000..39af6b9 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-vis3.c @@ -0,0 +1,23 @@ +/* floor function, sparc64 vis3 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math.h> + +#define __floor __floor_vis3 + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S deleted file mode 100644 index 989ccab..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(floor) - -weak_alias (__floor, floor) - -# undef weak_alias -# define weak_alias(a, b) - -#define __floor __floor_generic - -#include "../s_floor.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c new file mode 100644 index 0000000..3edd8a9 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c @@ -0,0 +1,32 @@ +/* floor function, sparc64 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern double __floor_vis3 (double); +extern double __floor_generic (double); + +sparc_libm_ifunc(__floor, hwcap & HWCAP_SPARC_VIS3 ? __floor_vis3 : __floor_generic); +weak_alias (__floor, floor) + +# define __floor __floor_generic +#endif + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S deleted file mode 100644 index ab7e110..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis2.S +++ /dev/null @@ -1,56 +0,0 @@ -/* Float floor function, sparc64 vis2 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf_vis2) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__floorf_vis2) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S deleted file mode 100644 index b71e1cc..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Float floor function, sparc64 vis3 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* 'siam' (Set Interval Arithmetic Mode) is used to quickly override - the rounding mode during this routine. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value and, - with suitable 'siam' initiated rouding mode settings, round - the final result in the proper direction. - - We also use VIS3 moves to avoid using the stack to transfer - values between float and integer registers. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf_vis3) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2, %f16 - fabss %f1, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - fors %f16, SIGN_BIT, %f16 - siam (1 << 2) | 3 - fadds %f1, %f16, %f5 - siam (1 << 2) | 0 - fsubs %f5, %f16, %f5 - siam (0 << 2) - retl - fors %f5, SIGN_BIT, %f0 -END (__floorf_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c new file mode 100644 index 0000000..4e525f6 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-vis3.c @@ -0,0 +1,23 @@ +/* Float floor function, sparc64 vis3 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math.h> + +#define __floorf __floorf_vis3 + +#include <sysdeps/ieee754/flt-32/s_floorf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S deleted file mode 100644 index d2a83cb..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_VIS2_IFUNC(floorf) - -weak_alias (__floorf, floorf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __floorf __floorf_generic - -#include "../s_floorf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c new file mode 100644 index 0000000..d86f313 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c @@ -0,0 +1,32 @@ +/* Float floor function, sparc64 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern float __floorf_vis3 (float); +extern float __floorf_generic (float); + +sparc_libm_ifunc(__floorf, hwcap & HWCAP_SPARC_VIS3 ? __floorf_vis3 : __floorf_generic); +weak_alias (__floorf, floorf) + +# define __floorf __floorf_generic +#endif + +#include <sysdeps/ieee754/flt-32/s_floorf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S index fff277a..3180554 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-vis3.S @@ -35,6 +35,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyint_vis3) + fcmpd %fcc3, %f0, %f0 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(TWO_FIFTYTWO), %o2 sllx %o2, 32, %o2 diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S index c6e94ba..7bf7eed 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-vis3.S @@ -35,6 +35,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyintf_vis3) + fcmps %fcc3, %f1, %f1 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(0xf8003e0), %o5 sethi %hi(TWO_TWENTYTHREE), %o2 diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S deleted file mode 100644 index 63d0148..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.S +++ /dev/null @@ -1,53 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 vis3 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__trunc_vis3) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o2, 32, %o2 - fzero ZERO - fnegd ZERO, SIGN_BIT - movxtod %o2, %f16 - fabsd %f0, %f14 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f14 - fand %f0, SIGN_BIT, SIGN_BIT - fdtox %f14, %f14 - fxtod %f14, %f14 - faddd %f0, ZERO, %f18 - fmovduge %fcc3, %f18, %f14 - retl - for %f14, SIGN_BIT, %f0 -END (__trunc_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c new file mode 100644 index 0000000..2451034 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-vis3.c @@ -0,0 +1,23 @@ +/* trunc function, sparc64 vis3 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math.h> + +#define __trunc __trunc_vis3 + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S deleted file mode 100644 index 0d6f43a..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(trunc) - -weak_alias (__trunc, trunc) - -# undef weak_alias -# define weak_alias(a, b) - -#define __trunc __trunc_generic - -#include "../s_trunc.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c new file mode 100644 index 0000000..7ae9a97 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c @@ -0,0 +1,32 @@ +/* trunc function, sparc64 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern double __trunc_vis3 (double); +extern double __trunc_generic (double); + +sparc_libm_ifunc(__trunc, hwcap & HWCAP_SPARC_VIS3 ? __trunc_vis3 : __trunc_generic); +weak_alias (__trunc, trunc) + +# define __trunc __trunc_generic +#endif + +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S deleted file mode 100644 index 10b09c2..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.S +++ /dev/null @@ -1,52 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 vis3 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__truncf_vis3) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - movwtos %o2,%f16 - fabss %f1, %f14 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f14 - fands %f1, SIGN_BIT, SIGN_BIT - fstoi %f14, %f14 - fitos %f14, %f14 - fadds %f1, ZERO, %f18 - fmovsuge %fcc3, %f18, %f14 - retl - fors %f14, SIGN_BIT, %f0 -END (__truncf_vis3) diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c new file mode 100644 index 0000000..6253efc --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-vis3.c @@ -0,0 +1,23 @@ +/* Float trunc function, sparc64 vis3 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math.h> + +#define __truncf __truncf_vis3 + +#include <sysdeps/ieee754/flt-32/s_truncf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S deleted file mode 100644 index 2ca2517..0000000 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.S +++ /dev/null @@ -1,12 +0,0 @@ -#include <sparc-ifunc.h> - -SPARC_ASM_VIS3_IFUNC(truncf) - -weak_alias (__truncf, truncf) - -# undef weak_alias -# define weak_alias(a, b) - -#define __truncf __truncf_generic - -#include "../s_truncf.S" diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c new file mode 100644 index 0000000..e36ffca --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c @@ -0,0 +1,32 @@ +/* Float trunc function, sparc64 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_AS_VIS3_SUPPORT +# include <sparc-ifunc.h> +# include <math.h> + +extern float __truncf_vis3 (float); +extern float __truncf_generic (float); + +sparc_libm_ifunc(__truncf, hwcap & HWCAP_SPARC_VIS3 ? __truncf_vis3 : __truncf_generic); +weak_alias (__truncf, truncf) + +# define __truncf __truncf_generic +#endif + +#include <sysdeps/ieee754/flt-32/s_truncf.c> diff --git a/sysdeps/sparc/sparc64/fpu/s_ceil.S b/sysdeps/sparc/sparc64/fpu/s_ceil.S deleted file mode 100644 index 2c74438..0000000 --- a/sysdeps/sparc/sparc64/fpu/s_ceil.S +++ /dev/null @@ -1,83 +0,0 @@ -/* ceil function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ -#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceil) - sethi %hi(TWO_FIFTYTWO), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzero ZERO - - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - - sllx %o3, 32, %o3 - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - - for %f16, SIGN_BIT, %f16 - faddd %f0, %f16, %f18 - fsubd %f18, %f16, %f18 - fcmpd %fcc2, %f18, %f0 - stx %o3, [%sp + STACK_BIAS + 128] - - ldd [%sp + STACK_BIAS + 128], %f20 - fmovduge %fcc2, ZERO, %f20 - faddd %f18, %f20, %f0 - fabsd %f0, %f0 - retl - for %f0, SIGN_BIT, %f0 -END (__ceil) -weak_alias (__ceil, ceil) diff --git a/sysdeps/sparc/sparc64/fpu/s_ceilf.S b/sysdeps/sparc/sparc64/fpu/s_ceilf.S deleted file mode 100644 index 5542dc4..0000000 --- a/sysdeps/sparc/sparc64/fpu/s_ceilf.S +++ /dev/null @@ -1,81 +0,0 @@ -/* Float ceil function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ -#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__ceilf) - sethi %hi(TWO_TWENTYTHREE), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzeros ZERO - - fnegs ZERO, SIGN_BIT - - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - - fors %f16, SIGN_BIT, %f16 - fadds %f1, %f16, %f5 - fsubs %f5, %f16, %f5 - fcmps %fcc2, %f5, %f1 - st %o3, [%sp + STACK_BIAS + 128] - - ld [%sp + STACK_BIAS + 128], %f9 - fmovsuge %fcc2, ZERO, %f9 - fadds %f5, %f9, %f0 - fabss %f0, %f0 - retl - fors %f0, SIGN_BIT, %f0 -END (__ceilf) -weak_alias (__ceilf, ceilf) diff --git a/sysdeps/sparc/sparc64/fpu/s_floor.S b/sysdeps/sparc/sparc64/fpu/s_floor.S deleted file mode 100644 index aded393..0000000 --- a/sysdeps/sparc/sparc64/fpu/s_floor.S +++ /dev/null @@ -1,83 +0,0 @@ -/* floor function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ -#define ONE_DOT_ZERO 0x3ff00000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floor) - sethi %hi(TWO_FIFTYTWO), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzero ZERO - - sllx %o2, 32, %o2 - fnegd ZERO, SIGN_BIT - - sllx %o3, 32, %o3 - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - - fmovduge %fcc3, ZERO, %f16 - fand %f0, SIGN_BIT, SIGN_BIT - - for %f16, SIGN_BIT, %f16 - faddd %f0, %f16, %f18 - fsubd %f18, %f16, %f18 - fcmpd %fcc2, %f18, %f0 - stx %o3, [%sp + STACK_BIAS + 128] - - ldd [%sp + STACK_BIAS + 128], %f20 - fmovdule %fcc2, ZERO, %f20 - fsubd %f18, %f20, %f0 - fabsd %f0, %f0 - retl - for %f0, SIGN_BIT, %f0 -END (__floor) -weak_alias (__floor, floor) diff --git a/sysdeps/sparc/sparc64/fpu/s_floorf.S b/sysdeps/sparc/sparc64/fpu/s_floorf.S deleted file mode 100644 index 9f20549..0000000 --- a/sysdeps/sparc/sparc64/fpu/s_floorf.S +++ /dev/null @@ -1,81 +0,0 @@ -/* Float floor function, sparc64 version. - Copyright (C) 2012-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* Since changing the rounding mode is extremely expensive, we - try to round up using a method that is rounding mode - agnostic. - - We add then subtract (or subtract than add if the initial - value was negative) 2**23 to the value, then subtract it - back out. - - This will clear out the fractional portion of the value. - One of two things will happen for non-whole initial values. - Either the rounding mode will round it up, or it will be - rounded down. If the value started out whole, it will be - equal after the addition and subtraction. This means we - can accurately detect with one test whether we need to add - another 1.0 to round it up properly. - - We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any - PIC references. We also thus avoid having to allocate a - register window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ -#define ONE_DOT_ZERO 0x3f800000 /* 1.0 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__floorf) - sethi %hi(TWO_TWENTYTHREE), %o2 - sethi %hi(ONE_DOT_ZERO), %o3 - fzeros ZERO - - fnegs ZERO, SIGN_BIT - - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - - fmovsuge %fcc3, ZERO, %f16 - fands %f1, SIGN_BIT, SIGN_BIT - - fors %f16, SIGN_BIT, %f16 - fadds %f1, %f16, %f5 - fsubs %f5, %f16, %f5 - fcmps %fcc2, %f5, %f1 - st %o3, [%sp + STACK_BIAS + 128] - - ld [%sp + STACK_BIAS + 128], %f9 - fmovsule %fcc2, ZERO, %f9 - fsubs %f5, %f9, %f0 - fabss %f0, %f0 - retl - fors %f0, SIGN_BIT, %f0 -END (__floorf) -weak_alias (__floorf, floorf) diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S index caf4d72..456c315 100644 --- a/sysdeps/sparc/sparc64/fpu/s_nearbyint.S +++ b/sysdeps/sparc/sparc64/fpu/s_nearbyint.S @@ -35,6 +35,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyint) + fcmpd %fcc3, %f0, %f0 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(TWO_FIFTYTWO), %o2 sllx %o2, 32, %o2 diff --git a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S index 4232eca..d0d9bed 100644 --- a/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S +++ b/sysdeps/sparc/sparc64/fpu/s_nearbyintf.S @@ -35,6 +35,7 @@ #define SIGN_BIT %f12 /* -0.0 */ ENTRY (__nearbyintf) + fcmps %fcc3, %f1, %f1 /* Check for sNaN */ stx %fsr, [%sp + STACK_BIAS + 144] sethi %hi(0xf8003e0), %o5 sethi %hi(TWO_TWENTYTHREE), %o2 diff --git a/sysdeps/sparc/sparc64/fpu/s_trunc.S b/sysdeps/sparc/sparc64/fpu/s_trunc.S deleted file mode 100644 index 34ecb14..0000000 --- a/sysdeps/sparc/sparc64/fpu/s_trunc.S +++ /dev/null @@ -1,55 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_FIFTYTWO 0x43300000 /* 2**52 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__trunc) - sethi %hi(TWO_FIFTYTWO), %o2 - sllx %o2, 32, %o2 - fzero ZERO - fnegd ZERO, SIGN_BIT - stx %o2, [%sp + STACK_BIAS + 128] - fabsd %f0, %f14 - ldd [%sp + STACK_BIAS + 128], %f16 - fcmpd %fcc3, %f14, %f16 - fmovduge %fcc3, ZERO, %f14 - fand %f0, SIGN_BIT, SIGN_BIT - fdtox %f14, %f14 - fxtod %f14, %f14 - faddd %f0, ZERO, %f18 - fmovduge %fcc3, %f18, %f14 - retl - for %f14, SIGN_BIT, %f0 -END (__trunc) -weak_alias (__trunc, trunc) diff --git a/sysdeps/sparc/sparc64/fpu/s_truncf.S b/sysdeps/sparc/sparc64/fpu/s_truncf.S deleted file mode 100644 index 7bc7235..0000000 --- a/sysdeps/sparc/sparc64/fpu/s_truncf.S +++ /dev/null @@ -1,54 +0,0 @@ -/* Truncate argument to nearest integral value not larger than - the argument, sparc64 version. - - Copyright (C) 2013-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>, 2013. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - - /* We pop constants into the FPU registers using the incoming - argument stack slots, since this avoid having to use any PIC - references. We also thus avoid having to allocate a register - window. - - VIS instructions are used to facilitate the formation of - easier constants, and the propagation of the sign bit. */ - -#define TWO_TWENTYTHREE 0x4b000000 /* 2**23 */ - -#define ZERO %f10 /* 0.0 */ -#define SIGN_BIT %f12 /* -0.0 */ - -ENTRY (__truncf) - sethi %hi(TWO_TWENTYTHREE), %o2 - fzeros ZERO - fnegs ZERO, SIGN_BIT - st %o2, [%sp + STACK_BIAS + 128] - fabss %f1, %f14 - ld [%sp + STACK_BIAS + 128], %f16 - fcmps %fcc3, %f14, %f16 - fmovsuge %fcc3, ZERO, %f14 - fands %f1, SIGN_BIT, SIGN_BIT - fstoi %f14, %f14 - fitos %f14, %f14 - fadds %f1, ZERO, %f18 - fmovsuge %fcc3, %f18, %f14 - retl - fors %f14, SIGN_BIT, %f0 -END (__truncf) -weak_alias (__truncf, truncf) diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 35e1ed4..f0b052d 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -15,7 +15,7 @@ ifeq ($(subdir),misc) include $(firstword $(wildcard $(sysdirs:=/sysctl.mk))) sysdep_routines += clone llseek umount umount2 readahead \ - setfsuid setfsgid makedev epoll_pwait signalfd \ + setfsuid setfsgid epoll_pwait signalfd \ eventfd eventfd_read eventfd_write prlimit \ personality diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h index 37f7f44..9759130 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S +++ b/sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h @@ -1,7 +1,6 @@ -/* Compute positive difference, sparc 32-bit+v9. - Copyright (C) 2013-2016 Free Software Foundation, Inc. +/* Defines for bits in AT_HWCAP. AArch64 Linux version. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,24 +16,19 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> -#include <math_ldbl_opt.h> - -ENTRY(__fdim) - std %o0, [%sp + 72] - std %o2, [%sp + 80] - ldd [%sp + 72], %f0 - ldd [%sp + 80], %f2 - fcmpd %f0, %f2 - fbug 1f - nop - fzero %f0 - fnegd %f0, %f2 -1: retl - fsubd %f0, %f2, %f0 -END(__fdim) -weak_alias (__fdim, fdim) - -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __fdim, fdiml, GLIBC_2_1); +#if !defined (_SYS_AUXV_H) +# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." #endif + +/* The following must match the kernel's <asm/hwcap.h>. */ +#define HWCAP_FP (1 << 0) +#define HWCAP_ASIMD (1 << 1) +#define HWCAP_EVTSTRM (1 << 2) +#define HWCAP_AES (1 << 3) +#define HWCAP_PMULL (1 << 4) +#define HWCAP_SHA1 (1 << 5) +#define HWCAP_SHA2 (1 << 6) +#define HWCAP_CRC32 (1 << 7) +#define HWCAP_ATOMICS (1 << 8) +#define HWCAP_FPHP (1 << 9) +#define HWCAP_ASIMDHP (1 << 10) diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 9cdb623..2c2f49e 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2089,3 +2089,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index f3f3c70..8afba47 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2000,6 +2000,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist index a93803d..de3bdf4 100644 --- a/sysdeps/unix/sysv/linux/arm/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/libc.abilist @@ -90,6 +90,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index 2eb95f7..2266047 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -83,7 +83,8 @@ typedef __socklen_t socklen_t; #define PF_NFC 39 /* NFC sockets. */ #define PF_VSOCK 40 /* vSockets. */ #define PF_KCM 41 /* Kernel Connection Multiplexor. */ -#define PF_MAX 42 /* For now.. */ +#define PF_QIPCRTR 42 /* Qualcomm IPC Router. */ +#define PF_MAX 43 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC @@ -131,6 +132,7 @@ typedef __socklen_t socklen_t; #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK #define AF_KCM PF_KCM +#define AF_QIPCRTR PF_QIPCRTR #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 58ed133..3261b93 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -1854,6 +1854,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile index 71ba61e..b015ff7 100644 --- a/sysdeps/unix/sysv/linux/i386/Makefile +++ b/sysdeps/unix/sysv/linux/i386/Makefile @@ -48,9 +48,11 @@ endif ifeq ($(subdir),nptl) # pull in __syscall_error routine libpthread-routines += sysdep +libpthread-shared-only-routines += sysdep endif ifeq ($(subdir),rt) # pull in __syscall_error routine librt-routines += sysdep +librt-shared-only-routines += sysdep endif diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 61cbae0..6465a55 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2012,6 +2012,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index d40d264..4536271 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1876,6 +1876,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 64432ae..287d7a5 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -91,6 +91,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0x98 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 8086c38..c9229fa 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -1968,6 +1968,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/microblaze/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/libc.abilist index 8c4c3bb..0409791 100644 --- a/sysdeps/unix/sysv/linux/microblaze/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/libc.abilist @@ -2089,3 +2089,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h index abc13c2..b83c436 100644 --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h @@ -209,70 +209,70 @@ SYSCALL_ERROR_LABEL_DCL: \ # define inline_syscall0(name,dummy) \ ({ \ - register long ret __asm__("r3"); \ + register long __ret __asm__("r3"); \ register long __r12 __asm__("r12") = name; \ __asm__ __volatile__( "brki r14,8; nop;" \ - : "=r"(ret) \ + : "=r"(__ret) \ : "r"(__r12) \ - : SYSCALL_CLOBBERS_0 ); ret; \ + : SYSCALL_CLOBBERS_0 ); __ret; \ }) # define inline_syscall1(name,arg1) \ ({ \ - register long ret __asm__("r3"); \ + register long __ret __asm__("r3"); \ register long __r12 __asm__("r12") = name; \ register long __r5 __asm__("r5") = (long)(arg1); \ __asm__ __volatile__( "brki r14,8; nop;" \ - : "=r"(ret) \ + : "=r"(__ret) \ : "r"(__r5), "r"(__r12) \ - : SYSCALL_CLOBBERS_1 ); ret; \ + : SYSCALL_CLOBBERS_1 ); __ret; \ }) # define inline_syscall2(name,arg1,arg2) \ ({ \ - register long ret __asm__("r3"); \ + register long __ret __asm__("r3"); \ register long __r12 __asm__("r12") = name; \ register long __r5 __asm__("r5") = (long)(arg1); \ register long __r6 __asm__("r6") = (long)(arg2); \ __asm__ __volatile__( "brki r14,8; nop;" \ - : "=r"(ret) \ + : "=r"(__ret) \ : "r"(__r5), "r"(__r6), "r"(__r12) \ - : SYSCALL_CLOBBERS_2 ); ret; \ + : SYSCALL_CLOBBERS_2 ); __ret; \ }) # define inline_syscall3(name,arg1,arg2,arg3) \ ({ \ - register long ret __asm__("r3"); \ + register long __ret __asm__("r3"); \ register long __r12 __asm__("r12") = name; \ register long __r5 __asm__("r5") = (long)(arg1); \ register long __r6 __asm__("r6") = (long)(arg2); \ register long __r7 __asm__("r7") = (long)(arg3); \ __asm__ __volatile__( "brki r14,8; nop;" \ - : "=r"(ret) \ + : "=r"(__ret) \ : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r12) \ - : SYSCALL_CLOBBERS_3 ); ret; \ + : SYSCALL_CLOBBERS_3 ); __ret; \ }) # define inline_syscall4(name,arg1,arg2,arg3,arg4) \ ({ \ - register long ret __asm__("r3"); \ + register long __ret __asm__("r3"); \ register long __r12 __asm__("r12") = name; \ register long __r5 __asm__("r5") = (long)(arg1); \ register long __r6 __asm__("r6") = (long)(arg2); \ register long __r7 __asm__("r7") = (long)(arg3); \ register long __r8 __asm__("r8") = (long)(arg4); \ __asm__ __volatile__( "brki r14,8; nop;" \ - : "=r"(ret) \ + : "=r"(__ret) \ : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r12) \ - : SYSCALL_CLOBBERS_4 ); ret; \ + : SYSCALL_CLOBBERS_4 ); __ret; \ }) # define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \ ({ \ - register long ret __asm__("r3"); \ + register long __ret __asm__("r3"); \ register long __r12 __asm__("r12") = name; \ register long __r5 __asm__("r5") = (long)(arg1); \ register long __r6 __asm__("r6") = (long)(arg2); \ @@ -280,15 +280,15 @@ SYSCALL_ERROR_LABEL_DCL: \ register long __r8 __asm__("r8") = (long)(arg4); \ register long __r9 __asm__("r9") = (long)(arg5); \ __asm__ __volatile__( "brki r14,8; nop;" \ - : "=r"(ret) \ + : "=r"(__ret) \ : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r12) \ - : SYSCALL_CLOBBERS_5 ); ret; \ + : SYSCALL_CLOBBERS_5 ); __ret; \ }) # define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \ ({ \ - register long ret __asm__("r3"); \ + register long __ret __asm__("r3"); \ register long __r12 __asm__("r12") = name; \ register long __r5 __asm__("r5") = (long)(arg1); \ register long __r6 __asm__("r6") = (long)(arg2); \ @@ -297,10 +297,10 @@ SYSCALL_ERROR_LABEL_DCL: \ register long __r9 __asm__("r9") = (long)(arg5); \ register long __r10 __asm__("r10") = (long)(arg6); \ __asm__ __volatile__( "brki r14,8; nop;" \ - : "=r"(ret) \ + : "=r"(__ret) \ : "r"(__r5), "r"(__r6), "r"(__r7), "r"(__r8),"r"(__r9), "r"(__r10), \ "r"(__r12) \ - : SYSCALL_CLOBBERS_6 ); ret; \ + : SYSCALL_CLOBBERS_6 ); __ret; \ }) diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index 09d5ece..b486d90 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -38,5 +38,4 @@ pass 64-bits values through syscalls. */ #if _MIPS_SIM == _ABIN32 # define __ASSUME_WORDSIZE64_ILP32 1 -# define __ASSUME_OFF_DIFF_OFF64 1 #endif diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index db014ed..f31653e 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -1943,6 +1943,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 33ac881..a56bd99 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -1941,6 +1941,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index b8b2c0e..44552df 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -1939,6 +1939,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 0741301..8d2a09d 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -1934,6 +1934,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index fa04825..0443b92 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2130,3 +2130,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/unix/sysv/linux/nios2/localplt.data b/sysdeps/unix/sysv/linux/nios2/localplt.data index 08c88dc..5a0b4d3 100644 --- a/sysdeps/unix/sysv/linux/nios2/localplt.data +++ b/sysdeps/unix/sysv/linux/nios2/localplt.data @@ -1,5 +1,4 @@ libc.so: realloc -libc.so: __eqsf2 libc.so: __floatsisf libc.so: __gtdf2 libc.so: __ltdf2 diff --git a/sysdeps/unix/sysv/linux/nptl-signals.h b/sysdeps/unix/sysv/linux/nptl-signals.h index 01f34c2..2710159 100644 --- a/sysdeps/unix/sysv/linux/nptl-signals.h +++ b/sysdeps/unix/sysv/linux/nptl-signals.h @@ -39,5 +39,46 @@ __nptl_is_internal_signal (int sig) return (sig == SIGCANCEL) || (sig == SIGTIMER) || (sig == SIGSETXID); } +/* Remove internal glibc signal from the mask. */ +static inline void +__nptl_clear_internal_signals (sigset_t *set) +{ + __sigdelset (set, SIGCANCEL); + __sigdelset (set, SIGTIMER); + __sigdelset (set, SIGSETXID); +} + +#define SIGALL_SET \ + ((__sigset_t) { .__val = {[0 ... _SIGSET_NWORDS-1 ] = -1 } }) + +/* Block all signals, including internal glibc ones. */ +static inline int +__libc_signal_block_all (sigset_t *set) +{ + INTERNAL_SYSCALL_DECL (err); + return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &SIGALL_SET, + set, _NSIG / 8); +} + +/* Block all application signals (excluding internal glibc ones). */ +static inline int +__libc_signal_block_app (sigset_t *set) +{ + sigset_t allset = SIGALL_SET; + __nptl_clear_internal_signals (&allset); + INTERNAL_SYSCALL_DECL (err); + return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &allset, set, + _NSIG / 8); +} + +/* Restore current process signal mask. */ +static inline int +__libc_signal_restore_set (const sigset_t *set) +{ + INTERNAL_SYSCALL_DECL (err); + return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, set, NULL, + _NSIG / 8); +} + /* Used to communicate with signal handler. */ extern struct xid_command *__xidcmd attribute_hidden; diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 3d633c0..ba9a29a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -1972,6 +1972,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index a6b164b..f19534c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -1977,6 +1977,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist index 7200b76..f8de1ab 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist @@ -2177,3 +2177,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist index de62ecb..6819133 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist @@ -91,6 +91,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 _Exit F GLIBC_2.3 _IO_2_1_stderr_ D 0xe0 diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h index 04100a2..2b97bc7 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h @@ -64,8 +64,8 @@ typedef struct /* For 64-bit kernels with Altivec support, a machine context is exactly * a sigcontext. For older kernel (without Altivec) the sigcontext matches * the mcontext upto but not including the v_regs field. For kernels that - * don't AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the - * v_regs field may not exit and should not be referenced. The v_regd field + * don't set AT_HWCAP or return AT_HWCAP without PPC_FEATURE_HAS_ALTIVEC the + * v_regs field may not exist and should not be referenced. The v_regd field * can be refernced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC * is set in AT_HWCAP. */ diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c index 5663092..1bcff64 100644 --- a/sysdeps/unix/sysv/linux/pread.c +++ b/sysdeps/unix/sysv/linux/pread.c @@ -19,7 +19,7 @@ #include <unistd.h> #include <sysdep-cancel.h> -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifndef __NR_pread # define __NR_pread __NR_pread64 diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c index c599f76..58c6aeb 100644 --- a/sysdeps/unix/sysv/linux/pread64.c +++ b/sysdeps/unix/sysv/linux/pread64.c @@ -33,7 +33,7 @@ __libc_pread64 (int fd, void *buf, size_t count, off64_t offset) weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64) -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (__libc_pread64, __libc_pread) weak_alias (__libc_pread64, __pread) weak_alias (__libc_pread64, pread) diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c index be206e2..107cb81 100644 --- a/sysdeps/unix/sysv/linux/preadv.c +++ b/sysdeps/unix/sysv/linux/preadv.c @@ -18,7 +18,7 @@ #include <sys/uio.h> #include <sysdep-cancel.h> -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifdef __ASSUME_PREADV diff --git a/sysdeps/unix/sysv/linux/preadv64.c b/sysdeps/unix/sysv/linux/preadv64.c index 64164bb..66afd4c 100644 --- a/sysdeps/unix/sysv/linux/preadv64.c +++ b/sysdeps/unix/sysv/linux/preadv64.c @@ -49,6 +49,6 @@ preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) # include <sysdeps/posix/preadv.c> #endif -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (preadv64, preadv) #endif diff --git a/sysdeps/unix/sysv/linux/pt-raise.c b/sysdeps/unix/sysv/linux/pt-raise.c index 715bbe9..5f6dea1 100644 --- a/sysdeps/unix/sysv/linux/pt-raise.c +++ b/sysdeps/unix/sysv/linux/pt-raise.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* ISO C raise function for libpthread. + Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -16,22 +17,4 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <signal.h> -#include <sysdep.h> -#include <tls.h> - - -int -raise (int sig) -{ - /* raise is an async-safe function. It could be called while the - fork function temporarily invalidated the PID field. Adjust for - that. */ - pid_t pid = THREAD_GETMEM (THREAD_SELF, pid); - if (__glibc_unlikely (pid < 0)) - pid = -pid; - - return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid), - sig); -} +#include <sysdeps/unix/sysv/linux/raise.c> diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c index ca3014f..9c502be 100644 --- a/sysdeps/unix/sysv/linux/pwrite.c +++ b/sysdeps/unix/sysv/linux/pwrite.c @@ -19,7 +19,7 @@ #include <unistd.h> #include <sysdep-cancel.h> -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifndef __NR_pwrite # define __NR_pwrite __NR_pwrite64 diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c index 5a37701..b49e6bc 100644 --- a/sysdeps/unix/sysv/linux/pwrite64.c +++ b/sysdeps/unix/sysv/linux/pwrite64.c @@ -33,7 +33,7 @@ weak_alias (__libc_pwrite64, __pwrite64) libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (__libc_pwrite64, __libc_pwrite) weak_alias (__libc_pwrite64, __pwrite) weak_alias (__libc_pwrite64, pwrite) diff --git a/sysdeps/unix/sysv/linux/pwritev.c b/sysdeps/unix/sysv/linux/pwritev.c index 19b4a10..6747f42 100644 --- a/sysdeps/unix/sysv/linux/pwritev.c +++ b/sysdeps/unix/sysv/linux/pwritev.c @@ -18,7 +18,7 @@ #include <sys/uio.h> #include <sysdep-cancel.h> -#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64) +#ifndef __OFF_T_MATCHES_OFF64_T # ifdef __ASSUME_PREADV diff --git a/sysdeps/unix/sysv/linux/pwritev64.c b/sysdeps/unix/sysv/linux/pwritev64.c index c0cfe4b..e162948 100644 --- a/sysdeps/unix/sysv/linux/pwritev64.c +++ b/sysdeps/unix/sysv/linux/pwritev64.c @@ -49,6 +49,6 @@ pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset) # include <sysdeps/posix/pwritev.c> #endif -#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64) +#ifdef __OFF_T_MATCHES_OFF64_T strong_alias (pwritev64, pwritev) #endif diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c index 3795e6e..470033e 100644 --- a/sysdeps/unix/sysv/linux/raise.c +++ b/sysdeps/unix/sysv/linux/raise.c @@ -16,42 +16,45 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <limits.h> #include <signal.h> #include <sysdep.h> -#include <nptl/pthreadP.h> - +#include <errno.h> +#include <sys/types.h> +#include <unistd.h> +#include <nptl-signals.h> int raise (int sig) { - struct pthread *pd = THREAD_SELF; - pid_t pid = THREAD_GETMEM (pd, pid); - pid_t selftid = THREAD_GETMEM (pd, tid); - if (selftid == 0) - { - /* This system call is not supposed to fail. */ -#ifdef INTERNAL_SYSCALL - INTERNAL_SYSCALL_DECL (err); - selftid = INTERNAL_SYSCALL (gettid, err, 0); -#else - selftid = INLINE_SYSCALL (gettid, 0); -#endif - THREAD_SETMEM (pd, tid, selftid); - - /* We do not set the PID field in the TID here since we might be - called from a signal handler while the thread executes fork. */ - pid = selftid; - } - else - /* raise is an async-safe function. It could be called while the - fork/vfork function temporarily invalidated the PID field. Adjust for - that. */ - if (__glibc_unlikely (pid <= 0)) - pid = (pid & INT_MAX) == 0 ? selftid : -pid; - - return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); + /* raise is an async-safe function so it could be called while the + fork/vfork function temporarily invalidated the PID field. To avoid + relying on cached value we block all user-defined signal handler + (which might call fork/vfork) and issue the getpid and gettid + syscalls directly. */ + + + /* rt_sigprocmask may fail if: + + 1. sigsetsize != sizeof (sigset_t) (EINVAL) + 2. a failure in copy from/to user space (EFAULT) + 3. an invalid 'how' operation (EINVAL) + + The first case is already handle in glibc syscall call by using the arch + defined _NSIG. Second case is handled by using a stack allocated mask. + The last one should be handled by the block/unblock functions. */ + + sigset_t set; + __libc_signal_block_app (&set); + + INTERNAL_SYSCALL_DECL (err); + pid_t pid = INTERNAL_SYSCALL (getpid, err, 0); + pid_t tid = INTERNAL_SYSCALL (gettid, err, 0); + + int ret = INLINE_SYSCALL (tgkill, 3, pid, tid, sig); + + __libc_signal_restore_set (&set); + + return ret; } libc_hidden_def (raise) weak_alias (raise, gsignal) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 8da0bc0..4cd5d85 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -1972,6 +1972,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 59066a9..8cdb9df 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1873,6 +1873,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist index 01ca9e6..69791b4 100644 --- a/sysdeps/unix/sysv/linux/sh/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/libc.abilist @@ -1858,6 +1858,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 245c1c6..fce58a8 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -1964,6 +1964,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 4478d13..16ce7399b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1902,6 +1902,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data b/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data index 633cfe4..2323551 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data @@ -1,4 +1,5 @@ libc.so: _Qp_add ? +libc.so: _Qp_cmp ? libc.so: _Qp_div ? libc.so: _Qp_feq ? libc.so: _Qp_fge ? diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h deleted file mode 100644 index 4c4a697..0000000 --- a/sysdeps/unix/sysv/linux/sys/sysmacros.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Definitions of macros to access `dev_t' values. - Copyright (C) 1996-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _SYS_SYSMACROS_H -#define _SYS_SYSMACROS_H 1 - -#include <features.h> - -__BEGIN_DECLS - -__extension__ -extern unsigned int gnu_dev_major (unsigned long long int __dev) - __THROW __attribute_const__; -__extension__ -extern unsigned int gnu_dev_minor (unsigned long long int __dev) - __THROW __attribute_const__; -__extension__ -extern unsigned long long int gnu_dev_makedev (unsigned int __major, - unsigned int __minor) - __THROW __attribute_const__; - -#ifdef __USE_EXTERN_INLINES -__extension__ __extern_inline __attribute_const__ unsigned int -__NTH (gnu_dev_major (unsigned long long int __dev)) -{ - return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); -} - -__extension__ __extern_inline __attribute_const__ unsigned int -__NTH (gnu_dev_minor (unsigned long long int __dev)) -{ - return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); -} - -__extension__ __extern_inline __attribute_const__ unsigned long long int -__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor)) -{ - return ((__minor & 0xff) | ((__major & 0xfff) << 8) - | (((unsigned long long int) (__minor & ~0xff)) << 12) - | (((unsigned long long int) (__major & ~0xfff)) << 32)); -} -#endif -__END_DECLS - -/* Access the functions with their traditional names. */ -#define major(dev) gnu_dev_major (dev) -#define minor(dev) gnu_dev_minor (dev) -#define makedev(maj, min) gnu_dev_makedev (maj, min) - -#endif /* sys/sysmacros.h */ diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h index 8c9e62e..a469f57 100644 --- a/sysdeps/unix/sysv/linux/sysdep.h +++ b/sysdeps/unix/sysv/linux/sysdep.h @@ -49,10 +49,6 @@ #endif /* Provide a macro to pass the off{64}_t argument on p{readv,writev}{64}. */ -#if __WORDSIZE == 64 || defined __ASSUME_WORDSIZE64_ILP32 -# define LO_HI_LONG(val) (val) -#else -# define LO_HI_LONG(val) \ - (long) (val), \ - (long) (((uint64_t) (val)) >> 32) -#endif +#define LO_HI_LONG(val) \ + (long) (val), \ + (long) (((uint64_t) (val)) >> 32) diff --git a/sysdeps/unix/sysv/linux/tile/kernel-features.h b/sysdeps/unix/sysv/linux/tile/kernel-features.h index 7511f77..9425e1c 100644 --- a/sysdeps/unix/sysv/linux/tile/kernel-features.h +++ b/sysdeps/unix/sysv/linux/tile/kernel-features.h @@ -21,4 +21,6 @@ /* Define this if your 32-bit syscall API requires 64-bit register pairs to start with an even-number register. */ -#define __ASSUME_ALIGNED_REGISTER_PAIRS 1 +#ifndef _LP64 +# define __ASSUME_ALIGNED_REGISTER_PAIRS 1 +#endif diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist index c1a2613..f99c298 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist @@ -2096,3 +2096,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist index 35fbf8a..c601ab0 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist @@ -2096,3 +2096,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist index c1a2613..f99c298 100644 --- a/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist @@ -2096,3 +2096,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index c1054ce..8e6fa57 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1853,6 +1853,7 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index d09d101..bcf6370 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,6 +6,10 @@ msgctl - msgctl i:iip __msgctl msgctl msgget - msgget i:ii __msgget msgget msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv msgsnd - msgsnd Ci:ibni __msgsnd msgsnd +pread64 - pread64 Ci:ipii __libc_pread __libc_pread64 __pread64 pread64 __pread pread +preadv64 - preadv Ci:ipii preadv64 preadv +pwrite64 - pwrite64 Ci:ipii __libc_pwrite __pwrite64 pwrite64 __pwrite pwrite +pwritev64 - pwritev Ci:ipii pwritev64 pwritev shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h index d023d68..1a671e1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -385,4 +385,8 @@ # endif #endif +/* How to pass the off{64}_t argument on p{readv,writev}{64}. */ +#undef LO_HI_LONG +#define LO_HI_LONG(val) (val) + #endif /* linux/x86_64/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 2fd6d60..1e12f48 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2096,3 +2096,4 @@ GLIBC_2.23 fts64_read F GLIBC_2.23 fts64_set F GLIBC_2.24 GLIBC_2.24 A GLIBC_2.24 quick_exit F +GLIBC_2.25 GLIBC_2.25 A diff --git a/sysdeps/x86/fpu/test-math-vector-sincos.h b/sysdeps/x86/fpu/test-math-vector-sincos.h new file mode 100644 index 0000000..0263fc5 --- /dev/null +++ b/sysdeps/x86/fpu/test-math-vector-sincos.h @@ -0,0 +1,98 @@ +/* Wrappers definitions for tests of ABI of vector sincos/sincosf having + vector declaration "#pragma omp declare simd notinbranch". + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#define INIT_VEC_PTRS_LOOP(vec, val, len) \ + do \ + { \ + for (i = 0; i < len; i++) \ + { \ + vec[i] = &val[i]; \ + } \ + } \ + while (0) + +/* Wrapper for vector sincos/sincosf compatible with x86_64 and x32 variants + of _ZGVbN2vvv_sincos, _ZGVdN4vvv_sincos, _ZGVeN8vvv_sincos; + x32 variants of _ZGVbN4vvv_sincosf, _ZGVcN4vvv_sincos, _ZGVdN8vvv_sincosf, + _ZGVeN16vvv_sincosf. */ +#define VECTOR_WRAPPER_fFF_2(scalar_func, vector_func) \ +extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE); \ +void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \ +{ \ + int i; \ + FLOAT r_loc[VEC_LEN], r1_loc[VEC_LEN]; \ + VEC_TYPE mx; \ + VEC_INT_TYPE mr, mr1; \ + INIT_VEC_LOOP (mx, x, VEC_LEN); \ + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr), r_loc, VEC_LEN); \ + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr1), r1_loc, VEC_LEN); \ + vector_func (mx, mr, mr1); \ + TEST_VEC_LOOP (r_loc, VEC_LEN); \ + TEST_VEC_LOOP (r1_loc, VEC_LEN); \ + *r = r_loc[0]; \ + *r1 = r1_loc[0]; \ + return; \ +} + +/* Wrapper for vector sincos/sincosf compatible with x86_64 variants of + _ZGVcN4vvv_sincos, _ZGVeN16vvv_sincosf, _ZGVbN4vvv_sincosf, + _ZGVdN8vvv_sincosf, _ZGVcN8vvv_sincosf. */ +#define VECTOR_WRAPPER_fFF_3(scalar_func, vector_func) \ +extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE, \ + VEC_INT_TYPE, VEC_INT_TYPE); \ +void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \ +{ \ + int i; \ + FLOAT r_loc[VEC_LEN/2], r1_loc[VEC_LEN/2]; \ + VEC_TYPE mx; \ + VEC_INT_TYPE mr, mr1; \ + INIT_VEC_LOOP (mx, x, VEC_LEN); \ + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr), r_loc, VEC_LEN/2); \ + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr1), r1_loc, VEC_LEN/2); \ + vector_func (mx, mr, mr, mr1, mr1); \ + TEST_VEC_LOOP (r_loc, VEC_LEN/2); \ + TEST_VEC_LOOP (r1_loc, VEC_LEN/2); \ + *r = r_loc[0]; \ + *r1 = r1_loc[0]; \ + return; \ +} + +/* Wrapper for vector sincosf compatible with x86_64 variant of + _ZGVcN8vvv_sincosf. */ +#define VECTOR_WRAPPER_fFF_4(scalar_func, vector_func) \ +extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE, \ + VEC_INT_TYPE, VEC_INT_TYPE, \ + VEC_INT_TYPE, VEC_INT_TYPE, \ + VEC_INT_TYPE, VEC_INT_TYPE); \ +void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \ +{ \ + int i; \ + FLOAT r_loc[VEC_LEN/4], r1_loc[VEC_LEN/4]; \ + VEC_TYPE mx; \ + VEC_INT_TYPE mr, mr1; \ + INIT_VEC_LOOP (mx, x, VEC_LEN); \ + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr), r_loc, VEC_LEN/4); \ + INIT_VEC_PTRS_LOOP (((FLOAT **) &mr1), r1_loc, VEC_LEN/4); \ + vector_func (mx, mr, mr, mr, mr, mr1, mr1, mr1, mr1); \ + TEST_VEC_LOOP (r_loc, VEC_LEN/4); \ + TEST_VEC_LOOP (r1_loc, VEC_LEN/4); \ + *r = r_loc[0]; \ + *r1 = r1_loc[0]; \ + return; \ +} diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure index 88fbfe4..2d14c34 100644 --- a/sysdeps/x86_64/configure +++ b/sysdeps/x86_64/configure @@ -1,13 +1,76 @@ # This file is generated from configure.ac by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/x86_64. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support in assembler" >&5 -$as_echo_n "checking for AVX512 support in assembler... " >&6; } -if ${libc_cv_asm_avx512+:} false; then : +for ac_prog in $AS +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AS" && break +done + +if test -z "$AS"; then + ac_verc_fail=yes +else + # Found it, now check the version. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $AS" >&5 +$as_echo_n "checking version of $AS... " >&6; } + ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.2[4-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 +$as_echo "$ac_prog_version" >&6; } +fi +if test $ac_verc_fail = yes; then + critic_missing="$critic_missing The program AS is required in version >= 2.24 for target x86_64." +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512DQ support in assembler" >&5 +$as_echo_n "checking for AVX512DQ support in assembler... " >&6; } +if ${libc_cv_asm_avx512dq+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.s <<\EOF - vmovdqu64 %zmm0, (%rsp) vandpd (%rax), %zmm6, %zmm1 EOF if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5' @@ -16,16 +79,16 @@ if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5' ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then - libc_cv_asm_avx512=yes + libc_cv_asm_avx512dq=yes else - libc_cv_asm_avx512=no + libc_cv_asm_avx512dq=no fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_avx512" >&5 -$as_echo "$libc_cv_asm_avx512" >&6; } -if test $libc_cv_asm_avx512 = yes; then - $as_echo "#define HAVE_AVX512_ASM_SUPPORT 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_avx512dq" >&5 +$as_echo "$libc_cv_asm_avx512dq" >&6; } +if test $libc_cv_asm_avx512dq = yes; then + $as_echo "#define HAVE_AVX512DQ_ASM_SUPPORT 1" >>confdefs.h fi @@ -40,7 +103,7 @@ else ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : - libc_cv_cc_avx512=$libc_cv_asm_avx512 + libc_cv_cc_avx512=$libc_cv_asm_avx512dq else libc_cv_cc_avx512=no fi @@ -88,4 +151,6 @@ fi $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h -# work around problem with autoconf and empty lines at the end of files + +test -n "$critic_missing" && as_fn_error $? " +*** $critic_missing" "$LINENO" 5 diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac index b39309e..7d8aaaf 100644 --- a/sysdeps/x86_64/configure.ac +++ b/sysdeps/x86_64/configure.ac @@ -1,25 +1,30 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/x86_64. -dnl Check if asm supports AVX512. -AC_CACHE_CHECK(for AVX512 support in assembler, libc_cv_asm_avx512, [dnl +dnl Accept as 2.24 or newer for AVX512 load and store. +AC_CHECK_PROG_VER(AS, $AS, --version, + [GNU assembler.* \([0-9]*\.[0-9.]*\)], + [2.2[4-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], + critic_missing="$critic_missing The program AS is required in version >= 2.24 for target x86_64.") + +dnl Check if asm supports AVX512DQ. +AC_CACHE_CHECK(for AVX512DQ support in assembler, libc_cv_asm_avx512dq, [dnl cat > conftest.s <<\EOF - vmovdqu64 %zmm0, (%rsp) vandpd (%rax), %zmm6, %zmm1 EOF if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then - libc_cv_asm_avx512=yes + libc_cv_asm_avx512dq=yes else - libc_cv_asm_avx512=no + libc_cv_asm_avx512dq=no fi rm -f conftest*]) -if test $libc_cv_asm_avx512 = yes; then - AC_DEFINE(HAVE_AVX512_ASM_SUPPORT) +if test $libc_cv_asm_avx512dq = yes; then + AC_DEFINE(HAVE_AVX512DQ_ASM_SUPPORT) fi dnl Check if -mavx512f works. AC_CACHE_CHECK(for AVX512 support, libc_cv_cc_avx512, [dnl -LIBC_TRY_CC_OPTION([-mavx512f], [libc_cv_cc_avx512=$libc_cv_asm_avx512], [libc_cv_cc_avx512=no]) +LIBC_TRY_CC_OPTION([-mavx512f], [libc_cv_cc_avx512=$libc_cv_asm_avx512dq], [libc_cv_cc_avx512=no]) ]) if test $libc_cv_cc_avx512 = yes; then AC_DEFINE(HAVE_AVX512_SUPPORT) @@ -48,4 +53,6 @@ fi dnl It is always possible to access static and hidden symbols in an dnl position independent way. AC_DEFINE(PI_STATIC_AND_HIDDEN) -# work around problem with autoconf and empty lines at the end of files + +test -n "$critic_missing" && AC_MSG_ERROR([ +*** $critic_missing]) diff --git a/sysdeps/x86_64/dl-tlsdesc.S b/sysdeps/x86_64/dl-tlsdesc.S index 3cb7c3d..777f30b 100644 --- a/sysdeps/x86_64/dl-tlsdesc.S +++ b/sysdeps/x86_64/dl-tlsdesc.S @@ -163,14 +163,15 @@ _dl_tlsdesc_dynamic: /* The PLT entry will have pushed the link_map pointer. */ _dl_tlsdesc_resolve_rela: cfi_adjust_cfa_offset (8) - /* Save all call-clobbered registers. */ - subq $72, %rsp - cfi_adjust_cfa_offset (72) + /* Save all call-clobbered registers. Add 8 bytes for push in + the PLT entry to align the stack. */ + subq $80, %rsp + cfi_adjust_cfa_offset (80) movq %rax, (%rsp) movq %rdi, 8(%rsp) movq %rax, %rdi /* Pass tlsdesc* in %rdi. */ movq %rsi, 16(%rsp) - movq 72(%rsp), %rsi /* Pass link_map* in %rsi. */ + movq 80(%rsp), %rsi /* Pass link_map* in %rsi. */ movq %r8, 24(%rsp) movq %r9, 32(%rsp) movq %r10, 40(%rsp) @@ -187,8 +188,8 @@ _dl_tlsdesc_resolve_rela: movq 48(%rsp), %r11 movq 56(%rsp), %rdx movq 64(%rsp), %rcx - addq $80, %rsp - cfi_adjust_cfa_offset (-80) + addq $88, %rsp + cfi_adjust_cfa_offset (-88) jmp *(%rax) cfi_endproc .size _dl_tlsdesc_resolve_rela, .-_dl_tlsdesc_resolve_rela diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S index 39b8771..12f1a5cf 100644 --- a/sysdeps/x86_64/dl-trampoline.S +++ b/sysdeps/x86_64/dl-trampoline.S @@ -77,30 +77,23 @@ #define RESTORE_AVX -#ifdef HAVE_AVX512_ASM_SUPPORT -# define VEC_SIZE 64 -# define VMOVA vmovdqa64 -# if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT -# define VMOV vmovdqa64 -# else -# define VMOV vmovdqu64 -# endif -# define VEC(i) zmm##i -# define _dl_runtime_resolve _dl_runtime_resolve_avx512 -# define _dl_runtime_profile _dl_runtime_profile_avx512 -# include "dl-trampoline.h" -# undef _dl_runtime_resolve -# undef _dl_runtime_profile -# undef VEC -# undef VMOV -# undef VMOVA -# undef VEC_SIZE +#define VEC_SIZE 64 +#define VMOVA vmovdqa64 +#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT +# define VMOV vmovdqa64 #else -strong_alias (_dl_runtime_resolve_avx, _dl_runtime_resolve_avx512) - .hidden _dl_runtime_resolve_avx512 -strong_alias (_dl_runtime_profile_avx, _dl_runtime_profile_avx512) - .hidden _dl_runtime_profile_avx512 +# define VMOV vmovdqu64 #endif +#define VEC(i) zmm##i +#define _dl_runtime_resolve _dl_runtime_resolve_avx512 +#define _dl_runtime_profile _dl_runtime_profile_avx512 +#include "dl-trampoline.h" +#undef _dl_runtime_resolve +#undef _dl_runtime_profile +#undef VEC +#undef VMOV +#undef VMOVA +#undef VEC_SIZE #define VEC_SIZE 32 #define VMOVA vmovdqa diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile index 36c4ae9..fad605a 100644 --- a/sysdeps/x86_64/fpu/Makefile +++ b/sysdeps/x86_64/fpu/Makefile @@ -35,15 +35,22 @@ tests += test-double-libmvec-alias test-double-libmvec-alias-avx \ test-double-libmvec-alias-avx-main test-double-libmvec-alias-avx2-main \ test-float-libmvec-alias test-float-libmvec-alias-avx \ test-float-libmvec-alias-avx2 test-float-libmvec-alias-main \ - test-float-libmvec-alias-avx-main test-float-libmvec-alias-avx2-main - + test-float-libmvec-alias-avx-main test-float-libmvec-alias-avx2-main \ + test-double-libmvec-sincos test-double-libmvec-sincos-avx \ + test-double-libmvec-sincos-avx2 test-float-libmvec-sincosf \ + test-float-libmvec-sincosf-avx test-float-libmvec-sincosf-avx2 modules-names += test-double-libmvec-alias-mod \ test-double-libmvec-alias-avx-mod \ test-double-libmvec-alias-avx2-mod \ test-float-libmvec-alias-mod \ test-float-libmvec-alias-avx-mod \ test-float-libmvec-alias-avx2-mod - +extra-test-objs += test-double-libmvec-sincos-avx-main.o \ + test-double-libmvec-sincos-avx2-main.o \ + test-double-libmvec-sincos-main.o \ + test-float-libmvec-sincosf-avx-main.o \ + test-float-libmvec-sincosf-avx2-main.o\ + test-float-libmvec-sincosf-main.o test-double-libmvec-alias-mod.so-no-z-defs = yes test-double-libmvec-alias-avx-mod.so-no-z-defs = yes test-double-libmvec-alias-avx2-mod.so-no-z-defs = yes @@ -105,14 +112,42 @@ $(objpfx)test-float-libmvec-alias-avx2-main: \ $(objpfx)test-float-libmvec-alias-avx2-mod.os \ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec) +$(objpfx)test-double-libmvec-sincos: \ + $(objpfx)test-double-libmvec-sincos.o \ + $(objpfx)test-double-libmvec-sincos-main.o $(libmvec) + +$(objpfx)test-double-libmvec-sincos-avx: \ + $(objpfx)test-double-libmvec-sincos-avx.o \ + $(objpfx)test-double-libmvec-sincos-avx-main.o $(libmvec) + +$(objpfx)test-double-libmvec-sincos-avx2: \ + $(objpfx)test-double-libmvec-sincos-avx2.o \ + $(objpfx)test-double-libmvec-sincos-avx2-main.o $(libmvec) + +$(objpfx)test-float-libmvec-sincosf: \ + $(objpfx)test-float-libmvec-sincosf.o \ + $(objpfx)test-float-libmvec-sincosf-main.o $(libmvec) + +$(objpfx)test-float-libmvec-sincosf-avx: \ + $(objpfx)test-float-libmvec-sincosf-avx.o \ + $(objpfx)test-float-libmvec-sincosf-avx-main.o $(libmvec) + +$(objpfx)test-float-libmvec-sincosf-avx2: \ + $(objpfx)test-float-libmvec-sincosf-avx2.o \ + $(objpfx)test-float-libmvec-sincosf-avx2-main.o $(libmvec) + ifeq (yes,$(config-cflags-avx512)) libmvec-tests += double-vlen8 float-vlen16 tests += test-double-libmvec-alias-avx512 \ test-float-libmvec-alias-avx512 \ test-double-libmvec-alias-avx512-main \ - test-float-libmvec-alias-avx512-main + test-float-libmvec-alias-avx512-main \ + test-double-libmvec-sincos-avx512 \ + test-float-libmvec-sincosf-avx512 modules-names += test-double-libmvec-alias-avx512-mod \ test-float-libmvec-alias-avx512-mod +extra-test-objs += test-double-libmvec-sincos-avx512-main.o \ + test-float-libmvec-sincosf-avx512-main.o test-double-libmvec-alias-avx512-mod.so-no-z-defs = yes test-float-libmvec-alias-avx512-mod.so-no-z-defs = yes @@ -133,6 +168,14 @@ $(objpfx)test-float-libmvec-alias-avx512-mod.so: \ $(objpfx)test-float-libmvec-alias-avx512-main: \ $(objpfx)test-float-libmvec-alias-avx512-mod.os \ $(objpfx)../mathvec/libmvec_nonshared.a $(libmvec) + +$(objpfx)test-double-libmvec-sincos-avx512: \ + $(objpfx)test-double-libmvec-sincos-avx512.o \ + $(objpfx)test-double-libmvec-sincos-avx512-main.o $(libmvec) + +$(objpfx)test-float-libmvec-sincosf-avx512: \ + $(objpfx)test-float-libmvec-sincosf-avx512.o \ + $(objpfx)test-float-libmvec-sincosf-avx512-main.o $(libmvec) endif double-vlen4-arch-ext-cflags = -mavx @@ -143,8 +186,8 @@ float-vlen8-arch-ext-cflags = -mavx float-vlen8-arch-ext2-cflags = -mavx2 float-vlen16-arch-ext-cflags = -mavx512f -libmvec-alias-cflags = $(libm-test-fast-math-cflags) -fno-inline -fopenmp \ - -ffloat-store -Wno-unknown-pragmas -ffinite-math-only +libmvec-sincos-cflags = $(libm-test-fast-math-cflags) -fno-inline -fopenmp -Wno-unknown-pragmas +libmvec-alias-cflags = $(libmvec-sincos-cflags) -ffloat-store -ffinite-math-only CFLAGS-test-double-libmvec-alias-mod.c = $(libmvec-alias-cflags) CFLAGS-test-double-libmvec-alias-avx-mod.c = $(double-vlen4-arch-ext-cflags) $(libmvec-alias-cflags) -DREQUIRE_AVX @@ -162,5 +205,20 @@ CFLAGS-test-double-vlen4-avx2-wrappers.c = $(double-vlen4-arch-ext2-cflags) CFLAGS-test-float-vlen8-avx2.c = $(libm-test-vec-cflags) CFLAGS-test-float-vlen8-avx2-wrappers.c = $(float-vlen8-arch-ext2-cflags) +CFLAGS-test-double-libmvec-sincos-main.c = $(libmvec-sincos-cflags) +CFLAGS-test-double-libmvec-sincos-avx.c = -DREQUIRE_AVX +CFLAGS-test-double-libmvec-sincos-avx-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext-cflags) +CFLAGS-test-double-libmvec-sincos-avx2.c = -DREQUIRE_AVX2 +CFLAGS-test-double-libmvec-sincos-avx2-main.c = $(libmvec-sincos-cflags) $(double-vlen4-arch-ext2-cflags) +CFLAGS-test-double-libmvec-sincos-avx512.c = -DREQUIRE_AVX512F +CFLAGS-test-double-libmvec-sincos-avx512-main.c = $(libmvec-sincos-cflags) $(double-vlen8-arch-ext-cflags) + +CFLAGS-test-float-libmvec-sincosf-main.c = $(libmvec-sincos-cflags) +CFLAGS-test-float-libmvec-sincosf-avx.c = -DREQUIRE_AVX +CFLAGS-test-float-libmvec-sincosf-avx-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext-cflags) +CFLAGS-test-float-libmvec-sincosf-avx2.c = -DREQUIRE_AVX2 +CFLAGS-test-float-libmvec-sincosf-avx2-main.c = $(libmvec-sincos-cflags) $(float-vlen8-arch-ext2-cflags) +CFLAGS-test-float-libmvec-sincosf-avx512.c = -DREQUIRE_AVX512F +CFLAGS-test-float-libmvec-sincosf-avx512-main.c = $(libmvec-sincos-cflags) $(float-vlen16-arch-ext-cflags) endif endif diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S index 874bd80..91e92e9 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_cos8_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVeN8v_cos_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_cos #else /* @@ -236,7 +236,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_cos END (_ZGVeN8v_cos_knl) ENTRY (_ZGVeN8v_cos_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_cos #else /* diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S index 9a77959..1e119e2 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp2_core_sse4.S @@ -207,7 +207,7 @@ ENTRY (_ZGVbN2v_exp_sse4) shlq $4, %r15 movsd 200(%rsp,%r15), %xmm0 - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) movsd %xmm0, 264(%rsp,%r15) jmp .LBL_1_8 @@ -217,7 +217,7 @@ ENTRY (_ZGVbN2v_exp_sse4) shlq $4, %r15 movsd 192(%rsp,%r15), %xmm0 - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) movsd %xmm0, 256(%rsp,%r15) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S index 2a35fe3..f350800 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp4_core_avx2.S @@ -193,7 +193,7 @@ ENTRY (_ZGVdN4v_exp_avx2) vmovsd 328(%rsp,%r15), %xmm0 vzeroupper - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) vmovsd %xmm0, 392(%rsp,%r15) jmp .LBL_1_8 @@ -204,7 +204,7 @@ ENTRY (_ZGVdN4v_exp_avx2) vmovsd 320(%rsp,%r15), %xmm0 vzeroupper - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) vmovsd %xmm0, 384(%rsp,%r15) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S index 456792d..18fb059 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_exp8_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVeN8v_exp_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_exp #else /* @@ -223,7 +223,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp movzbl %r12b, %r15d shlq $4, %r15 vmovsd 1160(%rsp,%r15), %xmm0 - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) vmovsd %xmm0, 1224(%rsp,%r15) jmp .LBL_1_8 @@ -231,14 +231,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp movzbl %r12b, %r15d shlq $4, %r15 vmovsd 1152(%rsp,%r15), %xmm0 - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) vmovsd %xmm0, 1216(%rsp,%r15) jmp .LBL_1_7 #endif END (_ZGVeN8v_exp_knl) ENTRY (_ZGVeN8v_exp_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_exp #else /* @@ -438,7 +438,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp vmovsd 1160(%rsp,%r15), %xmm0 vzeroupper vmovsd 1160(%rsp,%r15), %xmm0 - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) vmovsd %xmm0, 1224(%rsp,%r15) jmp .LBL_2_8 @@ -448,7 +448,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_exp vmovsd 1152(%rsp,%r15), %xmm0 vzeroupper vmovsd 1152(%rsp,%r15), %xmm0 - call JUMPTARGET(exp) + call JUMPTARGET(__exp_finite) vmovsd %xmm0, 1216(%rsp,%r15) jmp .LBL_2_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S index 6795972..6787699 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log2_core_sse4.S @@ -211,7 +211,7 @@ ENTRY (_ZGVbN2v_log_sse4) shlq $4, %r15 movsd 200(%rsp,%r15), %xmm0 - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) movsd %xmm0, 264(%rsp,%r15) jmp .LBL_1_8 @@ -221,7 +221,7 @@ ENTRY (_ZGVbN2v_log_sse4) shlq $4, %r15 movsd 192(%rsp,%r15), %xmm0 - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) movsd %xmm0, 256(%rsp,%r15) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S index 267dae0..8d21e5e 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log4_core_avx2.S @@ -191,7 +191,7 @@ ENTRY (_ZGVdN4v_log_avx2) vmovsd 328(%rsp,%r15), %xmm0 vzeroupper - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) vmovsd %xmm0, 392(%rsp,%r15) jmp .LBL_1_8 @@ -202,7 +202,7 @@ ENTRY (_ZGVdN4v_log_avx2) vmovsd 320(%rsp,%r15), %xmm0 vzeroupper - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) vmovsd %xmm0, 384(%rsp,%r15) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S index 4c52a91..cf2da9d 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_log8_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVeN8v_log_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_log #else /* @@ -222,7 +222,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log movzbl %r12b, %r15d shlq $4, %r15 vmovsd 1160(%rsp,%r15), %xmm0 - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) vmovsd %xmm0, 1224(%rsp,%r15) jmp .LBL_1_8 @@ -230,14 +230,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log movzbl %r12b, %r15d shlq $4, %r15 vmovsd 1152(%rsp,%r15), %xmm0 - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) vmovsd %xmm0, 1216(%rsp,%r15) jmp .LBL_1_7 #endif END (_ZGVeN8v_log_knl) ENTRY (_ZGVeN8v_log_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_log #else /* @@ -443,7 +443,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log vzeroupper vmovsd 1160(%rsp,%r15), %xmm0 - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) vmovsd %xmm0, 1224(%rsp,%r15) jmp .LBL_2_8 @@ -455,7 +455,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_log vzeroupper vmovsd 1152(%rsp,%r15), %xmm0 - call JUMPTARGET(log) + call JUMPTARGET(__log_finite) vmovsd %xmm0, 1216(%rsp,%r15) jmp .LBL_2_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S index 699f74e..c642f94 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow2_core_sse4.S @@ -413,7 +413,7 @@ ENTRY (_ZGVbN2vv_pow_sse4) movsd 72(%rsp,%r15), %xmm0 movsd 136(%rsp,%r15), %xmm1 - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) movsd %xmm0, 200(%rsp,%r15) jmp .LBL_1_8 @@ -424,7 +424,7 @@ ENTRY (_ZGVbN2vv_pow_sse4) movsd 64(%rsp,%r15), %xmm0 movsd 128(%rsp,%r15), %xmm1 - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) movsd %xmm0, 192(%rsp,%r15) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S index 35ba076..8ad9a57 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow4_core_avx2.S @@ -367,7 +367,7 @@ ENTRY (_ZGVdN4vv_pow_avx2) vmovsd 264(%rsp,%r15), %xmm1 vzeroupper - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) vmovsd %xmm0, 328(%rsp,%r15) jmp .LBL_1_8 @@ -379,7 +379,7 @@ ENTRY (_ZGVdN4vv_pow_avx2) vmovsd 256(%rsp,%r15), %xmm1 vzeroupper - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) vmovsd %xmm0, 320(%rsp,%r15) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S index fd6a889..026feee 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_pow8_core_avx512.S @@ -82,7 +82,7 @@ .text ENTRY (_ZGVeN8vv_pow_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow #else pushq %rbp @@ -392,7 +392,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow shlq $4, %r15 vmovsd 1160(%rsp,%r15), %xmm0 vmovsd 1224(%rsp,%r15), %xmm1 - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) vmovsd %xmm0, 1288(%rsp,%r15) jmp .LBL_1_8 @@ -401,7 +401,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow shlq $4, %r15 vmovsd 1152(%rsp,%r15), %xmm0 vmovsd 1216(%rsp,%r15), %xmm1 - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) vmovsd %xmm0, 1280(%rsp,%r15) jmp .LBL_1_7 @@ -409,7 +409,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow END (_ZGVeN8vv_pow_knl) ENTRY (_ZGVeN8vv_pow_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow #else pushq %rbp @@ -720,7 +720,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow vzeroupper vmovsd 1160(%rsp,%r15), %xmm0 - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) vmovsd %xmm0, 1288(%rsp,%r15) jmp .LBL_2_8 @@ -732,7 +732,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN4vv_pow vzeroupper vmovsd 1152(%rsp,%r15), %xmm0 - call JUMPTARGET(pow) + call JUMPTARGET(__pow_finite) vmovsd %xmm0, 1280(%rsp,%r15) jmp .LBL_2_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S index d3449e3..0bb2008 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sin8_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVeN8v_sin_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_sin #else /* @@ -237,7 +237,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN4v_sin END (_ZGVeN8v_sin_knl) ENTRY (_ZGVeN8v_sin_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN4v_sin #else /* diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S index d37275d..6dfc61e 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos2_core_sse4.S @@ -20,7 +20,7 @@ #include "svml_d_trig_data.h" .text -ENTRY (_ZGVbN2vvv_sincos_sse4) +ENTRY (_ZGVbN2vl8l8_sincos_sse4) /* ALGORITHM DESCRIPTION: @@ -311,4 +311,58 @@ ENTRY (_ZGVbN2vvv_sincos_sse4) movsd %xmm0, 256(%rsp,%r15) jmp .LBL_1_7 +END (_ZGVbN2vl8l8_sincos_sse4) +libmvec_hidden_def(_ZGVbN2vl8l8_sincos_sse4) + +/* vvv version implemented with wrapper to vl8l8 variant. */ +ENTRY (_ZGVbN2vvv_sincos_sse4) +#ifndef __ILP32__ + subq $72, %rsp + .cfi_def_cfa_offset 80 + movdqu %xmm1, 32(%rsp) + lea (%rsp), %rdi + movdqu %xmm2, 48(%rdi) + lea 16(%rsp), %rsi + call HIDDEN_JUMPTARGET(_ZGVbN2vl8l8_sincos_sse4) + movq 32(%rsp), %rdx + movq 48(%rsp), %rsi + movq 40(%rsp), %r8 + movq 56(%rsp), %r10 + movq (%rsp), %rax + movq 16(%rsp), %rcx + movq 8(%rsp), %rdi + movq 24(%rsp), %r9 + movq %rax, (%rdx) + movq %rcx, (%rsi) + movq %rdi, (%r8) + movq %r9, (%r10) + addq $72, %rsp + .cfi_def_cfa_offset 8 + ret +#else + subl $72, %esp + .cfi_def_cfa_offset 80 + leal 48(%rsp), %esi + movaps %xmm1, 16(%esp) + leal 32(%rsp), %edi + movaps %xmm2, (%esp) + call HIDDEN_JUMPTARGET(_ZGVbN2vl8l8_sincos_sse4) + movdqa 16(%esp), %xmm1 + movsd 32(%esp), %xmm0 + movq %xmm1, %rax + movdqa (%esp), %xmm2 + movsd %xmm0, (%eax) + movsd 40(%esp), %xmm0 + pextrd $1, %xmm1, %eax + movsd %xmm0, (%eax) + movsd 48(%esp), %xmm0 + movq %xmm2, %rax + movsd %xmm0, (%eax) + movsd 56(%esp), %xmm0 + pextrd $1, %xmm2, %eax + movsd %xmm0, (%eax) + addl $72, %esp + .cfi_def_cfa_offset 8 + ret +#endif END (_ZGVbN2vvv_sincos_sse4) diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S index 24b57f4..12f6010 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos4_core_avx2.S @@ -20,7 +20,7 @@ #include "svml_d_trig_data.h" .text -ENTRY (_ZGVdN4vvv_sincos_avx2) +ENTRY (_ZGVdN4vl8l8_sincos_avx2) /* ALGORITHM DESCRIPTION: @@ -274,4 +274,100 @@ ENTRY (_ZGVdN4vvv_sincos_avx2) vmovsd %xmm0, 384(%rsp,%r15) jmp .LBL_1_7 +END (_ZGVdN4vl8l8_sincos_avx2) +libmvec_hidden_def(_ZGVdN4vl8l8_sincos_avx2) + +/* vvv version implemented with wrapper to vl8l8 variant. */ +ENTRY (_ZGVdN4vvv_sincos_avx2) +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-32, %rsp + subq $128, %rsp + vmovdqu %ymm1, 64(%rsp) + lea (%rsp), %rdi + vmovdqu %ymm2, 96(%rdi) + lea 32(%rsp), %rsi + call HIDDEN_JUMPTARGET(_ZGVdN4vl8l8_sincos_avx2) + movq 64(%rsp), %rdx + movq 96(%rsp), %rsi + movq 72(%rsp), %r8 + movq 104(%rsp), %r10 + movq (%rsp), %rax + movq 32(%rsp), %rcx + movq 8(%rsp), %rdi + movq 40(%rsp), %r9 + movq %rax, (%rdx) + movq %rcx, (%rsi) + movq 80(%rsp), %rax + movq 112(%rsp), %rcx + movq %rdi, (%r8) + movq %r9, (%r10) + movq 88(%rsp), %rdi + movq 120(%rsp), %r9 + movq 16(%rsp), %r11 + movq 48(%rsp), %rdx + movq 24(%rsp), %rsi + movq 56(%rsp), %r8 + movq %r11, (%rax) + movq %rdx, (%rcx) + movq %rsi, (%rdi) + movq %r8, (%r9) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-32, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x78,0x6 + leal -48(%rbp), %esi + leal -80(%rbp), %edi + subl $104, %esp + vmovaps %xmm1, -96(%ebp) + vmovaps %xmm2, -112(%ebp) + call HIDDEN_JUMPTARGET(_ZGVdN4vl8l8_sincos_avx2) + movl -96(%ebp), %eax + vmovsd -80(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -92(%ebp), %eax + vmovsd -72(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -88(%ebp), %eax + vmovsd -64(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -84(%ebp), %eax + vmovsd -56(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -112(%ebp), %eax + vmovsd -48(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -108(%ebp), %eax + vmovsd -40(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -104(%ebp), %eax + vmovsd -32(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -100(%ebp), %eax + vmovsd -24(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + addl $104, %esp + popq %r10 + .cfi_def_cfa 10, 0 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif END (_ZGVdN4vvv_sincos_avx2) diff --git a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S index 1d9f426..bb8f618 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S @@ -36,9 +36,9 @@ sin(R), sin(R') are approximated by corresponding polynomial. */ .text -ENTRY (_ZGVeN8vvv_sincos_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT -WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos +ENTRY (_ZGVeN8vl8l8_sincos_knl) +#ifndef HAVE_AVX512DQ_ASM_SUPPORT +WRAPPER_IMPL_AVX512_fFF _ZGVdN4vl8l8_sincos #else pushq %rbp cfi_adjust_cfa_offset (8) @@ -304,11 +304,12 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos jmp .LBL_1_7 #endif -END (_ZGVeN8vvv_sincos_knl) +END (_ZGVeN8vl8l8_sincos_knl) +libmvec_hidden_def(_ZGVeN8vl8l8_sincos_knl) -ENTRY (_ZGVeN8vvv_sincos_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT -WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos +ENTRY (_ZGVeN8vl8l8_sincos_skx) +#ifndef HAVE_AVX512DQ_ASM_SUPPORT +WRAPPER_IMPL_AVX512_fFF _ZGVdN4vl8l8_sincos #else pushq %rbp cfi_adjust_cfa_offset (8) @@ -585,6 +586,175 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos jmp .LBL_2_7 #endif +END (_ZGVeN8vl8l8_sincos_skx) +libmvec_hidden_def(_ZGVeN8vl8l8_sincos_skx) + +/* Wrapper between vvv and vl8l8 vector variants. */ +.macro WRAPPER_AVX512_vvv_vl8l8 callee +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-64, %rsp + subq $256, %rsp + /* Encoding for vmovups %zmm1, 128(%rsp). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x4c + .byte 0x24 + .byte 0x02 + lea (%rsp), %rdi + /* Encoding for vmovups %zmm2, 192(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x57 + .byte 0x03 + lea 64(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 128(%rsp), %rdx + movq 136(%rsp), %rsi + movq 144(%rsp), %r8 + movq 152(%rsp), %r10 + movq (%rsp), %rax + movq 8(%rsp), %rcx + movq 16(%rsp), %rdi + movq 24(%rsp), %r9 + movq %rax, (%rdx) + movq %rcx, (%rsi) + movq 160(%rsp), %rax + movq 168(%rsp), %rcx + movq %rdi, (%r8) + movq %r9, (%r10) + movq 176(%rsp), %rdi + movq 184(%rsp), %r9 + movq 32(%rsp), %r11 + movq 40(%rsp), %rdx + movq 48(%rsp), %rsi + movq 56(%rsp), %r8 + movq %r11, (%rax) + movq %rdx, (%rcx) + movq 192(%rsp), %r11 + movq 200(%rsp), %rdx + movq %rsi, (%rdi) + movq %r8, (%r9) + movq 208(%rsp), %rsi + movq 216(%rsp), %r8 + movq 64(%rsp), %r10 + movq 72(%rsp), %rax + movq 80(%rsp), %rcx + movq 88(%rsp), %rdi + movq %r10, (%r11) + movq %rax, (%rdx) + movq 224(%rsp), %r10 + movq 232(%rsp), %rax + movq %rcx, (%rsi) + movq %rdi, (%r8) + movq 240(%rsp), %rcx + movq 248(%rsp), %rdi + movq 96(%rsp), %r9 + movq 104(%rsp), %r11 + movq 112(%rsp), %rdx + movq 120(%rsp), %rsi + movq %r9, (%r10) + movq %r11, (%rax) + movq %rdx, (%rcx) + movq %rsi, (%rdi) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-64, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x78,0x6 + leal -112(%rbp), %esi + leal -176(%rbp), %edi + subl $232, %esp + vmovdqa %ymm1, -208(%ebp) + vmovdqa %ymm2, -240(%ebp) + call HIDDEN_JUMPTARGET(\callee) + vmovdqa -208(%ebp), %xmm0 + vmovq %xmm0, %rax + vmovsd -176(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -168(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movq -200(%ebp), %rax + vmovsd -160(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -152(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movq -192(%ebp), %rax + vmovsd -144(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -136(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movq -184(%ebp), %rax + vmovsd -128(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -120(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + vmovdqa -240(%ebp), %xmm0 + vmovq %xmm0, %rax + vmovsd -112(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -104(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movq -232(%ebp), %rax + vmovsd -96(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -88(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movq -224(%ebp), %rax + vmovsd -80(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -72(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movq -216(%ebp), %rax + vmovsd -64(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + shrq $32, %rax + vmovsd -56(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + addl $232, %esp + popq %r10 + .cfi_def_cfa 10, 0 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + +ENTRY (_ZGVeN8vvv_sincos_knl) +WRAPPER_AVX512_vvv_vl8l8 _ZGVeN8vl8l8_sincos_knl +END (_ZGVeN8vvv_sincos_knl) + +ENTRY (_ZGVeN8vvv_sincos_skx) +WRAPPER_AVX512_vvv_vl8l8 _ZGVeN8vl8l8_sincos_skx END (_ZGVeN8vvv_sincos_skx) .section .rodata, "a" diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S index b39ec3a..ca079a7 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_cosf16_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVeN16v_cosf_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf #else /* @@ -239,7 +239,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf END (_ZGVeN16v_cosf_knl) ENTRY (_ZGVeN16v_cosf_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_cosf #else /* diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S index 44f61a2..42bd670 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf16_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVeN16v_expf_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_expf #else /* @@ -212,14 +212,14 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf cfi_restore_state movzbl %r12b, %r15d vmovss 1156(%rsp,%r15,8), %xmm0 - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) vmovss %xmm0, 1220(%rsp,%r15,8) jmp .LBL_1_8 .LBL_1_12: movzbl %r12b, %r15d vmovss 1152(%rsp,%r15,8), %xmm0 - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) vmovss %xmm0, 1216(%rsp,%r15,8) jmp .LBL_1_7 @@ -227,7 +227,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf END (_ZGVeN16v_expf_knl) ENTRY (_ZGVeN16v_expf_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_expf #else /* @@ -422,7 +422,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf vzeroupper vmovss 1156(%rsp,%r15,8), %xmm0 - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) vmovss %xmm0, 1220(%rsp,%r15,8) jmp .LBL_2_8 @@ -433,7 +433,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_expf vzeroupper vmovss 1152(%rsp,%r15,8), %xmm0 - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) vmovss %xmm0, 1216(%rsp,%r15,8) jmp .LBL_2_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S index d3db509..59933da 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf4_core_sse4.S @@ -195,7 +195,7 @@ ENTRY (_ZGVbN4v_expf_sse4) movzbl %r12b, %r15d movss 196(%rsp,%r15,8), %xmm0 - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) movss %xmm0, 260(%rsp,%r15,8) jmp .LBL_1_8 @@ -204,7 +204,7 @@ ENTRY (_ZGVbN4v_expf_sse4) movzbl %r12b, %r15d movss 192(%rsp,%r15,8), %xmm0 - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) movss %xmm0, 256(%rsp,%r15,8) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S index a80a9ec..54f7500 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_expf8_core_avx2.S @@ -184,7 +184,7 @@ ENTRY(_ZGVdN8v_expf_avx2) vmovss 324(%rsp,%r15,8), %xmm0 vzeroupper - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) vmovss %xmm0, 388(%rsp,%r15,8) jmp .LBL_1_8 @@ -194,7 +194,7 @@ ENTRY(_ZGVdN8v_expf_avx2) vmovss 320(%rsp,%r15,8), %xmm0 vzeroupper - call JUMPTARGET(expf) + call JUMPTARGET(__expf_finite) vmovss %xmm0, 384(%rsp,%r15,8) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S index 8d57e65..046430e 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf16_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVeN16v_logf_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_logf #else /* @@ -197,21 +197,21 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_logf cfi_restore_state movzbl %r12b, %r15d vmovss 1156(%rsp,%r15,8), %xmm0 - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) vmovss %xmm0, 1220(%rsp,%r15,8) jmp .LBL_1_8 .LBL_1_12: movzbl %r12b, %r15d vmovss 1152(%rsp,%r15,8), %xmm0 - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) vmovss %xmm0, 1216(%rsp,%r15,8) jmp .LBL_1_7 #endif END (_ZGVeN16v_logf_knl) ENTRY (_ZGVeN16v_logf_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_logf #else /* @@ -391,7 +391,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_logf vzeroupper vmovss 1156(%rsp,%r15,8), %xmm0 - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) vmovss %xmm0, 1220(%rsp,%r15,8) jmp .LBL_2_8 @@ -402,7 +402,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_logf vzeroupper vmovss 1152(%rsp,%r15,8), %xmm0 - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) vmovss %xmm0, 1216(%rsp,%r15,8) jmp .LBL_2_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S index 22310f1..b989375 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf4_core_sse4.S @@ -177,7 +177,7 @@ ENTRY (_ZGVbN4v_logf_sse4) movzbl %r12b, %r15d movss 196(%rsp,%r15,8), %xmm0 - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) movss %xmm0, 260(%rsp,%r15,8) jmp .LBL_1_8 @@ -186,7 +186,7 @@ ENTRY (_ZGVbN4v_logf_sse4) movzbl %r12b, %r15d movss 192(%rsp,%r15,8), %xmm0 - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) movss %xmm0, 256(%rsp,%r15,8) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S index b69d53f..6d6e97f 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_logf8_core_avx2.S @@ -166,7 +166,7 @@ ENTRY(_ZGVdN8v_logf_avx2) vmovss 324(%rsp,%r15,8), %xmm0 vzeroupper - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) vmovss %xmm0, 388(%rsp,%r15,8) jmp .LBL_1_8 @@ -176,7 +176,7 @@ ENTRY(_ZGVdN8v_logf_avx2) vmovss 320(%rsp,%r15,8), %xmm0 vzeroupper - call JUMPTARGET(logf) + call JUMPTARGET(__logf_finite) vmovss %xmm0, 384(%rsp,%r15,8) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S index 299e6ae..0d8c819 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf16_core_avx512.S @@ -82,7 +82,7 @@ .text ENTRY (_ZGVeN16vv_powf_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf #else pushq %rbp @@ -344,7 +344,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf movzbl %r12b, %r15d vmovss 1156(%rsp,%r15,8), %xmm0 vmovss 1220(%rsp,%r15,8), %xmm1 - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) vmovss %xmm0, 1284(%rsp,%r15,8) jmp .LBL_1_8 @@ -352,14 +352,14 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf movzbl %r12b, %r15d vmovss 1152(%rsp,%r15,8), %xmm0 vmovss 1216(%rsp,%r15,8), %xmm1 - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) vmovss %xmm0, 1280(%rsp,%r15,8) jmp .LBL_1_7 #endif END (_ZGVeN16vv_powf_knl) ENTRY (_ZGVeN16vv_powf_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf #else pushq %rbp @@ -629,7 +629,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf vmovss 1156(%rsp,%r15,8), %xmm1 vzeroupper vmovss 1092(%rsp,%r15,8), %xmm0 - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) vmovss %xmm0, 1220(%rsp,%r15,8) jmp .LBL_2_8 @@ -638,7 +638,7 @@ WRAPPER_IMPL_AVX512_ff _ZGVdN8vv_powf vmovss 1152(%rsp,%r15,8), %xmm1 vzeroupper vmovss 1088(%rsp,%r15,8), %xmm0 - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) vmovss %xmm0, 1216(%rsp,%r15,8) jmp .LBL_2_7 #endif diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S index 04b4e3d..b87ad27 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf4_core_sse4.S @@ -356,7 +356,7 @@ ENTRY (_ZGVbN4vv_powf_sse4) movss 68(%rsp,%r15,8), %xmm0 movss 132(%rsp,%r15,8), %xmm1 - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) movss %xmm0, 196(%rsp,%r15,8) jmp .LBL_1_8 @@ -366,7 +366,7 @@ ENTRY (_ZGVbN4vv_powf_sse4) movss 64(%rsp,%r15,8), %xmm0 movss 128(%rsp,%r15,8), %xmm1 - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) movss %xmm0, 192(%rsp,%r15,8) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S index bfe2229..b094f8e 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_powf8_core_avx2.S @@ -317,7 +317,7 @@ ENTRY(_ZGVdN8vv_powf_avx2) vmovss 132(%rsp,%r15,8), %xmm1 vzeroupper - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) vmovss %xmm0, 196(%rsp,%r15,8) jmp .LBL_1_8 @@ -328,7 +328,7 @@ ENTRY(_ZGVdN8vv_powf_avx2) vmovss 128(%rsp,%r15,8), %xmm1 vzeroupper - call JUMPTARGET(powf) + call JUMPTARGET(__powf_finite) vmovss %xmm0, 192(%rsp,%r15,8) jmp .LBL_1_7 diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S index e375de8..c99d14e 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S @@ -49,9 +49,9 @@ R2 = XOR( RC, SC ). */ .text -ENTRY (_ZGVeN16vvv_sincosf_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT -WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf +ENTRY (_ZGVeN16vl4l4_sincosf_knl) +#ifndef HAVE_AVX512DQ_ASM_SUPPORT +WRAPPER_IMPL_AVX512_fFF _ZGVdN8vl4l4_sincosf #else pushq %rbp cfi_adjust_cfa_offset (8) @@ -267,10 +267,11 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf vmovss %xmm0, 1280(%rsp,%r15,8) jmp .LBL_1_7 #endif -END (_ZGVeN16vvv_sincosf_knl) +END (_ZGVeN16vl4l4_sincosf_knl) +libmvec_hidden_def(_ZGVeN16vl4l4_sincosf_knl) -ENTRY (_ZGVeN16vvv_sincosf_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +ENTRY (_ZGVeN16vl4l4_sincosf_skx) +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf #else pushq %rbp @@ -496,6 +497,307 @@ WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf vmovss %xmm0, 1280(%rsp,%r15,8) jmp .LBL_2_7 #endif +END (_ZGVeN16vl4l4_sincosf_skx) +libmvec_hidden_def(_ZGVeN16vl4l4_sincosf_skx) + +/* Wrapper between vvv and vl4l4 vector variants. */ +.macro WRAPPER_AVX512_vvv_vl4l4 callee +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-64, %rsp + subq $384, %rsp + /* Encoding for vmovups %zmm1, 128(%rsp). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x4c + .byte 0x24 + .byte 0x02 + lea (%rsp), %rdi + /* Encoding for vmovups %zmm2, 192(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x57 + .byte 0x03 + /* Encoding for vmovups %zmm3, 256(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x5f + .byte 0x04 + /* Encoding for vmovups %zmm4, 320(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x67 + .byte 0x05 + lea 64(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 128(%rsp), %rdx + movq 136(%rsp), %rsi + movq 144(%rsp), %r8 + movq 152(%rsp), %r10 + movl (%rsp), %eax + movl 4(%rsp), %ecx + movl 8(%rsp), %edi + movl 12(%rsp), %r9d + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 160(%rsp), %rax + movq 168(%rsp), %rcx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 176(%rsp), %rdi + movq 184(%rsp), %r9 + movl 16(%rsp), %r11d + movl 20(%rsp), %edx + movl 24(%rsp), %esi + movl 28(%rsp), %r8d + movl %r11d, (%rax) + movl %edx, (%rcx) + movq 192(%rsp), %r11 + movq 200(%rsp), %rdx + movl %esi, (%rdi) + movl %r8d, (%r9) + movq 208(%rsp), %rsi + movq 216(%rsp), %r8 + movl 32(%rsp), %r10d + movl 36(%rsp), %eax + movl 40(%rsp), %ecx + movl 44(%rsp), %edi + movl %r10d, (%r11) + movl %eax, (%rdx) + movq 224(%rsp), %r10 + movq 232(%rsp), %rax + movl %ecx, (%rsi) + movl %edi, (%r8) + movq 240(%rsp), %rcx + movq 248(%rsp), %rdi + movl 48(%rsp), %r9d + movl 52(%rsp), %r11d + movl 56(%rsp), %edx + movl 60(%rsp), %esi + movl %r9d, (%r10) + movl %r11d, (%rax) + movq 256(%rsp), %r9 + movq 264(%rsp), %r11 + movl %edx, (%rcx) + movl %esi, (%rdi) + movq 272(%rsp), %rdx + movq 280(%rsp), %rsi + movl 64(%rsp), %r8d + movl 68(%rsp), %r10d + movl 72(%rsp), %eax + movl 76(%rsp), %ecx + movl %r8d, (%r9) + movl %r10d, (%r11) + movq 288(%rsp), %r8 + movq 296(%rsp), %r10 + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 304(%rsp), %rax + movq 312(%rsp), %rcx + movl 80(%rsp), %edi + movl 84(%rsp), %r9d + movl 88(%rsp), %r11d + movl 92(%rsp), %edx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 320(%rsp), %rdi + movq 328(%rsp), %r9 + movl %r11d, (%rax) + movl %edx, (%rcx) + movq 336(%rsp), %r11 + movq 344(%rsp), %rdx + movl 96(%rsp), %esi + movl 100(%rsp), %r8d + movl 104(%rsp), %r10d + movl 108(%rsp), %eax + movl %esi, (%rdi) + movl %r8d, (%r9) + movq 352(%rsp), %rsi + movq 360(%rsp), %r8 + movl %r10d, (%r11) + movl %eax, (%rdx) + movq 368(%rsp), %r10 + movq 376(%rsp), %rax + movl 112(%rsp), %ecx + movl 116(%rsp), %edi + movl 120(%rsp), %r9d + movl 124(%rsp), %r11d + movl %ecx, (%rsi) + movl %edi, (%r8) + movl %r9d, (%r10) + movl %r11d, (%rax) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-64, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x78,0x6 + leal -112(%rbp), %esi + leal -176(%rbp), %edi + subl $296, %esp + /* Encoding for vmovdqa64 %zmm1, -240(%ebp). */ + .byte 0x67 + .byte 0x62 + .byte 0xf1 + .byte 0xfd + .byte 0x48 + .byte 0x7f + .byte 0x8d + .byte 0x10 + .byte 0xff + .byte 0xff + .byte 0xff + /* Encoding for vmovdqa64 %zmm2, -304(%ebp). */ + .byte 0x67 + .byte 0x62 + .byte 0xf1 + .byte 0xfd + .byte 0x48 + .byte 0x7f + .byte 0x95 + .byte 0xd0 + .byte 0xfe + .byte 0xff + .byte 0xff + call HIDDEN_JUMPTARGET(\callee) + movl -240(%ebp), %eax + vmovss -176(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -236(%ebp), %eax + vmovss -172(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -232(%ebp), %eax + vmovss -168(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -228(%ebp), %eax + vmovss -164(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -224(%ebp), %eax + vmovss -160(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -220(%ebp), %eax + vmovss -156(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -216(%ebp), %eax + vmovss -152(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -212(%ebp), %eax + vmovss -148(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -208(%ebp), %eax + vmovss -144(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -204(%ebp), %eax + vmovss -140(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -200(%ebp), %eax + vmovss -136(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -196(%ebp), %eax + vmovss -132(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -192(%ebp), %eax + vmovss -128(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -188(%ebp), %eax + vmovss -124(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -184(%ebp), %eax + vmovss -120(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -180(%ebp), %eax + vmovss -116(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -304(%ebp), %eax + vmovss -112(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -300(%ebp), %eax + vmovss -108(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -296(%ebp), %eax + vmovss -104(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -292(%ebp), %eax + vmovss -100(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -288(%ebp), %eax + vmovss -96(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -284(%ebp), %eax + vmovss -92(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -280(%ebp), %eax + vmovss -88(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -276(%ebp), %eax + vmovss -84(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -272(%ebp), %eax + vmovss -80(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -268(%ebp), %eax + vmovss -76(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -264(%ebp), %eax + vmovss -72(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -260(%ebp), %eax + vmovss -68(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -256(%ebp), %eax + vmovss -64(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -252(%ebp), %eax + vmovss -60(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -248(%ebp), %eax + vmovss -56(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -244(%ebp), %eax + vmovss -52(%ebp), %xmm0 + vmovss %xmm0, (%eax) + addl $296, %esp + popq %r10 + .cfi_def_cfa 10, 0 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + +ENTRY (_ZGVeN16vvv_sincosf_knl) +WRAPPER_AVX512_vvv_vl4l4 _ZGVeN16vl4l4_sincosf_knl +END (_ZGVeN16vvv_sincosf_knl) + +ENTRY (_ZGVeN16vvv_sincosf_skx) +WRAPPER_AVX512_vvv_vl4l4 _ZGVeN16vl4l4_sincosf_skx END (_ZGVeN16vvv_sincosf_skx) .section .rodata, "a" diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S index 562367b..5e8ea8b 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S @@ -20,7 +20,7 @@ #include "svml_s_trig_data.h" .text -ENTRY (_ZGVbN4vvv_sincosf_sse4) +ENTRY (_ZGVbN4vl4l4_sincosf_sse4) /* ALGORITHM DESCRIPTION: @@ -265,4 +265,82 @@ ENTRY (_ZGVbN4vvv_sincosf_sse4) movss %xmm0, 256(%rsp,%r15,8) jmp .LBL_1_7 +END (_ZGVbN4vl4l4_sincosf_sse4) +libmvec_hidden_def(_ZGVbN4vl4l4_sincosf_sse4) + +/* vvv version implemented with wrapper to vl4l4 variant. */ +ENTRY (_ZGVbN4vvv_sincosf_sse4) +#ifndef __ILP32__ + subq $104, %rsp + .cfi_def_cfa_offset 112 + movdqu %xmm1, 32(%rsp) + lea (%rsp), %rdi + movdqu %xmm2, 48(%rdi) + lea 16(%rsp), %rsi + movdqu %xmm3, 48(%rsi) + movdqu %xmm4, 64(%rsi) + call HIDDEN_JUMPTARGET(_ZGVbN4vl4l4_sincosf_sse4) + movq 32(%rsp), %rdx + movq 40(%rsp), %rsi + movq 48(%rsp), %r8 + movq 56(%rsp), %r10 + movl (%rsp), %eax + movl 4(%rsp), %ecx + movl 8(%rsp), %edi + movl 12(%rsp), %r9d + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 64(%rsp), %rax + movq 72(%rsp), %rcx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 80(%rsp), %rdi + movq 88(%rsp), %r9 + movl 16(%rsp), %r11d + movl 20(%rsp), %edx + movl 24(%rsp), %esi + movl 28(%rsp), %r8d + movl %r11d, (%rax) + movl %edx, (%rcx) + movl %esi, (%rdi) + movl %r8d, (%r9) + addq $104, %rsp + .cfi_def_cfa_offset 8 + ret +#else + subl $72, %esp + .cfi_def_cfa_offset 80 + leal 48(%rsp), %esi + movaps %xmm1, 16(%esp) + leal 32(%rsp), %edi + movaps %xmm2, (%esp) + call HIDDEN_JUMPTARGET(_ZGVbN4vl4l4_sincosf_sse4) + movl 16(%esp), %eax + movss 32(%esp), %xmm0 + movss %xmm0, (%eax) + movl 20(%esp), %eax + movss 36(%esp), %xmm0 + movss %xmm0, (%eax) + movl 24(%esp), %eax + movss 40(%esp), %xmm0 + movss %xmm0, (%eax) + movl 28(%esp), %eax + movss 44(%esp), %xmm0 + movss %xmm0, (%eax) + movl (%esp), %eax + movss 48(%esp), %xmm0 + movss %xmm0, (%eax) + movl 4(%esp), %eax + movss 52(%esp), %xmm0 + movss %xmm0, (%eax) + movl 8(%esp), %eax + movss 56(%esp), %xmm0 + movss %xmm0, (%eax) + movl 12(%esp), %eax + movss 60(%esp), %xmm0 + movss %xmm0, (%eax) + addl $72, %esp + .cfi_def_cfa_offset 8 + ret +#endif END (_ZGVbN4vvv_sincosf_sse4) diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S index baf887d..75c28d1 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S @@ -20,7 +20,7 @@ #include "svml_s_trig_data.h" .text -ENTRY(_ZGVdN8vvv_sincosf_avx2) +ENTRY (_ZGVdN8vl4l4_sincosf_avx2) /* ALGORITHM DESCRIPTION: @@ -238,4 +238,152 @@ ENTRY(_ZGVdN8vvv_sincosf_avx2) vmovss %xmm0, 384(%rsp,%r15,8) jmp .LBL_1_7 -END(_ZGVdN8vvv_sincosf_avx2) +END (_ZGVdN8vl4l4_sincosf_avx2) +libmvec_hidden_def(_ZGVdN8vl4l4_sincosf_avx2) + +/* vvv version implemented with wrapper to vl4l4 variant. */ +ENTRY (_ZGVdN8vvv_sincosf_avx2) +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-32, %rsp + subq $192, %rsp + vmovdqu %ymm1, 64(%rsp) + lea (%rsp), %rdi + vmovdqu %ymm2, 96(%rdi) + vmovdqu %ymm3, 128(%rdi) + vmovdqu %ymm4, 160(%rdi) + lea 32(%rsp), %rsi + call HIDDEN_JUMPTARGET(_ZGVdN8vl4l4_sincosf_avx2) + movq 64(%rsp), %rdx + movq 72(%rsp), %rsi + movq 80(%rsp), %r8 + movq 88(%rsp), %r10 + movl (%rsp), %eax + movl 4(%rsp), %ecx + movl 8(%rsp), %edi + movl 12(%rsp), %r9d + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 96(%rsp), %rax + movq 104(%rsp), %rcx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 112(%rsp), %rdi + movq 120(%rsp), %r9 + movl 16(%rsp), %r11d + movl 20(%rsp), %edx + movl 24(%rsp), %esi + movl 28(%rsp), %r8d + movl %r11d, (%rax) + movl %edx, (%rcx) + movq 128(%rsp), %r11 + movq 136(%rsp), %rdx + movl %esi, (%rdi) + movl %r8d, (%r9) + movq 144(%rsp), %rsi + movq 152(%rsp), %r8 + movl 32(%rsp), %r10d + movl 36(%rsp), %eax + movl 40(%rsp), %ecx + movl 44(%rsp), %edi + movl %r10d, (%r11) + movl %eax, (%rdx) + movq 160(%rsp), %r10 + movq 168(%rsp), %rax + movl %ecx, (%rsi) + movl %edi, (%r8) + movq 176(%rsp), %rcx + movq 184(%rsp), %rdi + movl 48(%rsp), %r9d + movl 52(%rsp), %r11d + movl 56(%rsp), %edx + movl 60(%rsp), %esi + movl %r9d, (%r10) + movl %r11d, (%rax) + movl %edx, (%rcx) + movl %esi, (%rdi) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-32, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x78,0x6 + leal -48(%rbp), %esi + leal -80(%rbp), %edi + subl $136, %esp + vmovdqa %ymm1, -112(%ebp) + vmovdqa %ymm2, -144(%ebp) + call HIDDEN_JUMPTARGET(_ZGVdN8vl4l4_sincosf_avx2) + vmovdqa -112(%ebp), %xmm0 + vmovq %xmm0, %rax + vmovss -80(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -76(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + movq -104(%ebp), %rax + vmovss -72(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -68(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + movq -96(%ebp), %rax + vmovss -64(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -60(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + movq -88(%ebp), %rax + vmovss -56(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -52(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + vmovdqa -144(%ebp), %xmm0 + vmovq %xmm0, %rax + vmovss -48(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -44(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + movq -136(%ebp), %rax + vmovss -40(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -36(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + movq -128(%ebp), %rax + vmovss -32(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -28(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + movq -120(%ebp), %rax + vmovss -24(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -20(%ebp), %xmm0 + shrq $32, %rax + vmovss %xmm0, (%eax) + addl $136, %esp + popq %r10 + .cfi_def_cfa 10, 0 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +END (_ZGVdN8vvv_sincosf_avx2) diff --git a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S index 121714f..530d143 100644 --- a/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S +++ b/sysdeps/x86_64/fpu/multiarch/svml_s_sinf16_core_avx512.S @@ -22,7 +22,7 @@ .text ENTRY(_ZGVeN16v_sinf_knl) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf #else /* @@ -243,7 +243,7 @@ WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf END(_ZGVeN16v_sinf_knl) ENTRY (_ZGVeN16v_sinf_skx) -#ifndef HAVE_AVX512_ASM_SUPPORT +#ifndef HAVE_AVX512DQ_ASM_SUPPORT WRAPPER_IMPL_AVX512 _ZGVdN8v_sinf #else /* diff --git a/sysdeps/x86_64/fpu/svml_d_exp2_core.S b/sysdeps/x86_64/fpu/svml_d_exp2_core.S index 9e51103..ecfaf12 100644 --- a/sysdeps/x86_64/fpu/svml_d_exp2_core.S +++ b/sysdeps/x86_64/fpu/svml_d_exp2_core.S @@ -21,7 +21,7 @@ .text ENTRY (_ZGVbN2v_exp) -WRAPPER_IMPL_SSE2 exp +WRAPPER_IMPL_SSE2 __exp_finite END (_ZGVbN2v_exp) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_d_log2_core.S b/sysdeps/x86_64/fpu/svml_d_log2_core.S index 8ea40fe..b3530cd 100644 --- a/sysdeps/x86_64/fpu/svml_d_log2_core.S +++ b/sysdeps/x86_64/fpu/svml_d_log2_core.S @@ -21,7 +21,7 @@ .text ENTRY (_ZGVbN2v_log) -WRAPPER_IMPL_SSE2 log +WRAPPER_IMPL_SSE2 __log_finite END (_ZGVbN2v_log) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_d_pow2_core.S b/sysdeps/x86_64/fpu/svml_d_pow2_core.S index b25515c..593aaf6 100644 --- a/sysdeps/x86_64/fpu/svml_d_pow2_core.S +++ b/sysdeps/x86_64/fpu/svml_d_pow2_core.S @@ -21,7 +21,7 @@ .text ENTRY (_ZGVbN2vv_pow) -WRAPPER_IMPL_SSE2_ff pow +WRAPPER_IMPL_SSE2_ff __pow_finite END (_ZGVbN2vv_pow) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_d_sincos2_core.S b/sysdeps/x86_64/fpu/svml_d_sincos2_core.S index 74afa0a..96ab726 100644 --- a/sysdeps/x86_64/fpu/svml_d_sincos2_core.S +++ b/sysdeps/x86_64/fpu/svml_d_sincos2_core.S @@ -20,8 +20,89 @@ #include "svml_d_wrapper_impl.h" .text -ENTRY (_ZGVbN2vvv_sincos) +ENTRY (_ZGVbN2vl8l8_sincos) WRAPPER_IMPL_SSE2_fFF sincos +END (_ZGVbN2vl8l8_sincos) +libmvec_hidden_def (_ZGVbN2vl8l8_sincos) + +/* SSE2 ISA version as wrapper to scalar (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_SSE2_fFF_vvv callee +#ifndef __ILP32__ + subq $88, %rsp + cfi_adjust_cfa_offset(88) + movaps %xmm0, 64(%rsp) + lea (%rsp), %rdi + movdqa %xmm1, 32(%rdi) + lea 16(%rsp), %rsi + movdqa %xmm2, 32(%rsi) + call JUMPTARGET(\callee) + movsd 72(%rsp), %xmm0 + lea 8(%rsp), %rdi + lea 24(%rsp), %rsi + call JUMPTARGET(\callee) + movq 32(%rsp), %rdx + movq 48(%rsp), %rsi + movq 40(%rsp), %r8 + movq 56(%rsp), %r10 + movq (%rsp), %rax + movq 16(%rsp), %rcx + movq 8(%rsp), %rdi + movq 24(%rsp), %r9 + movq %rax, (%rdx) + movq %rcx, (%rsi) + movq %rdi, (%r8) + movq %r9, (%r10) + addq $88, %rsp + cfi_adjust_cfa_offset(-88) + ret +#else + pushq %rbp + .cfi_def_cfa_offset 16 + .cfi_offset 6, -16 + pushq %rbx + .cfi_def_cfa_offset 24 + .cfi_offset 3, -24 + subl $88, %esp + .cfi_def_cfa_offset 112 + leal 64(%rsp), %esi + movaps %xmm1, 32(%esp) + leal 48(%rsp), %edi + movaps %xmm2, 16(%esp) + movq %rsi, %rbp + movq %rdi, %rbx + movaps %xmm0, (%esp) + call JUMPTARGET(\callee) + movupd 8(%esp), %xmm0 + leal 8(%rbp), %esi + leal 8(%rbx), %edi + call JUMPTARGET(\callee) + movdqa 32(%esp), %xmm1 + movsd 48(%esp), %xmm0 + movq %xmm1, %rax + movdqa 16(%esp), %xmm2 + movsd %xmm0, (%eax) + movsd 56(%esp), %xmm0 + pextrd $1, %xmm1, %eax + movsd %xmm0, (%eax) + movsd 64(%esp), %xmm0 + movq %xmm2, %rax + movsd %xmm0, (%eax) + movsd 72(%esp), %xmm0 + pextrd $1, %xmm2, %eax + movsd %xmm0, (%eax) + addl $88, %esp + .cfi_def_cfa_offset 24 + popq %rbx + .cfi_def_cfa_offset 16 + popq %rbp + .cfi_def_cfa_offset 8 + ret +#endif +.endm + +ENTRY (_ZGVbN2vvv_sincos) +WRAPPER_IMPL_SSE2_fFF_vvv sincos END (_ZGVbN2vvv_sincos) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_d_sincos4_core.S b/sysdeps/x86_64/fpu/svml_d_sincos4_core.S index 2c0b011..088d5ad 100644 --- a/sysdeps/x86_64/fpu/svml_d_sincos4_core.S +++ b/sysdeps/x86_64/fpu/svml_d_sincos4_core.S @@ -20,8 +20,131 @@ #include "svml_d_wrapper_impl.h" .text +ENTRY (_ZGVdN4vl8l8_sincos) +WRAPPER_IMPL_AVX_fFF _ZGVbN2vl8l8_sincos +END (_ZGVdN4vl8l8_sincos) +libmvec_hidden_def (_ZGVdN4vl8l8_sincos) + +/* AVX2 ISA version as wrapper to SSE ISA version (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_AVX2_fFF_vvv callee +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-32, %rsp + subq $160, %rsp + vmovupd %ymm0, 128(%rsp) + lea (%rsp), %rdi + vmovdqu %ymm1, 64(%rdi) + vmovdqu %ymm2, 96(%rdi) + lea 32(%rsp), %rsi + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + vmovupd 144(%rsp), %xmm0 + lea 16(%rsp), %rdi + lea 48(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 64(%rsp), %rdx + movq 96(%rsp), %rsi + movq 72(%rsp), %r8 + movq 104(%rsp), %r10 + movq (%rsp), %rax + movq 32(%rsp), %rcx + movq 8(%rsp), %rdi + movq 40(%rsp), %r9 + movq %rax, (%rdx) + movq %rcx, (%rsi) + movq 80(%rsp), %rax + movq 112(%rsp), %rcx + movq %rdi, (%r8) + movq %r9, (%r10) + movq 88(%rsp), %rdi + movq 120(%rsp), %r9 + movq 16(%rsp), %r11 + movq 48(%rsp), %rdx + movq 24(%rsp), %rsi + movq 56(%rsp), %r8 + movq %r11, (%rax) + movq %rdx, (%rcx) + movq %rsi, (%rdi) + movq %r8, (%r9) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-32, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r12 + leal -80(%rbp), %esi + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x70,0x6 + .cfi_escape 0x10,0xc,0x2,0x76,0x78 + leal -112(%rbp), %edi + movq %rsi, %r12 + pushq %rbx + .cfi_escape 0x10,0x3,0x2,0x76,0x68 + movq %rdi, %rbx + subl $152, %esp + vmovaps %xmm1, -128(%ebp) + vmovaps %xmm2, -144(%ebp) + vmovapd %ymm0, -176(%ebp) + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + leal 16(%r12), %esi + vmovapd -160(%ebp), %xmm0 + leal 16(%rbx), %edi + call HIDDEN_JUMPTARGET(\callee) + movq -128(%ebp), %rax + vmovsd -112(%ebp), %xmm0 + vmovdqa -128(%ebp), %xmm5 + vmovdqa -144(%ebp), %xmm1 + vmovsd %xmm0, (%eax) + vmovsd -104(%ebp), %xmm0 + vpextrd $1, %xmm5, %eax + vmovsd %xmm0, (%eax) + movq -120(%ebp), %rax + vmovsd -96(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + vmovsd -88(%ebp), %xmm0 + vpextrd $3, %xmm5, %eax + vmovsd %xmm0, (%eax) + movq -144(%ebp), %rax + vmovsd -80(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + vmovsd -72(%ebp), %xmm0 + vpextrd $1, %xmm1, %eax + vmovsd %xmm0, (%eax) + movq -136(%ebp), %rax + vmovsd -64(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + vmovsd -56(%ebp), %xmm0 + vpextrd $3, %xmm1, %eax + vmovsd %xmm0, (%eax) + addl $152, %esp + popq %rbx + popq %r10 + .cfi_def_cfa 10, 0 + popq %r12 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + ENTRY (_ZGVdN4vvv_sincos) -WRAPPER_IMPL_AVX_fFF _ZGVbN2vvv_sincos +WRAPPER_IMPL_AVX2_fFF_vvv _ZGVbN2vl8l8_sincos END (_ZGVdN4vvv_sincos) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S b/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S index e4320a9..a60a524 100644 --- a/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S +++ b/sysdeps/x86_64/fpu/svml_d_sincos4_core_avx.S @@ -20,6 +20,124 @@ #include "svml_d_wrapper_impl.h" .text +ENTRY (_ZGVcN4vl8l8_sincos) +WRAPPER_IMPL_AVX_fFF _ZGVbN2vl8l8_sincos +END (_ZGVcN4vl8l8_sincos) + +/* AVX ISA version as wrapper to SSE ISA version (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_AVX_fFF_vvv callee +#ifndef __ILP32__ + pushq %rbp + movq %rsp, %rbp + andq $-32, %rsp + subq $160, %rsp + vmovupd %ymm0, 64(%rsp) + lea (%rsp), %rdi + vmovdqu %xmm1, 96(%rdi) + vmovdqu %xmm2, 112(%rdi) + vmovdqu %xmm3, 128(%rdi) + vmovdqu %xmm4, 144(%rdi) + lea 32(%rsp), %rsi + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + vmovdqu 80(%rsp), %xmm0 + lea 16(%rsp), %rdi + lea 48(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 96(%rsp), %rdx + movq 104(%rsp), %rsi + movq 112(%rsp), %r8 + movq 120(%rsp), %r10 + movq (%rsp), %rax + movq 8(%rsp), %rcx + movq 16(%rsp), %rdi + movq 24(%rsp), %r9 + movq %rax, (%rdx) + movq %rcx, (%rsi) + movq 128(%rsp), %rax + movq 136(%rsp), %rcx + movq %rdi, (%r8) + movq %r9, (%r10) + movq 144(%rsp), %rdi + movq 152(%rsp), %r9 + movq 32(%rsp), %r11 + movq 40(%rsp), %rdx + movq 48(%rsp), %rsi + movq 56(%rsp), %r8 + movq %r11, (%rax) + movq %rdx, (%rcx) + movq %rsi, (%rdi) + movq %r8, (%r9) + movq %rbp, %rsp + popq %rbp + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-32, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r12 + leal -80(%rbp), %esi + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x70,0x6 + .cfi_escape 0x10,0xc,0x2,0x76,0x78 + leal -112(%rbp), %edi + movq %rsi, %r12 + pushq %rbx + .cfi_escape 0x10,0x3,0x2,0x76,0x68 + movq %rdi, %rbx + subl $152, %esp + vmovaps %xmm1, -128(%ebp) + vmovaps %xmm2, -144(%ebp) + vmovapd %ymm0, -176(%ebp) + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + leal 16(%r12), %esi + vmovupd -160(%ebp), %xmm0 + leal 16(%rbx), %edi + call HIDDEN_JUMPTARGET(\callee) + movq -128(%ebp), %rax + vmovsd -112(%ebp), %xmm0 + vmovdqa -128(%ebp), %xmm5 + vmovdqa -144(%ebp), %xmm1 + vmovsd %xmm0, (%eax) + vmovsd -104(%ebp), %xmm0 + vpextrd $1, %xmm5, %eax + vmovsd %xmm0, (%eax) + movq -120(%ebp), %rax + vmovsd -96(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + vmovsd -88(%ebp), %xmm0 + vpextrd $3, %xmm5, %eax + vmovsd %xmm0, (%eax) + movq -144(%ebp), %rax + vmovsd -80(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + vmovsd -72(%ebp), %xmm0 + vpextrd $1, %xmm1, %eax + vmovsd %xmm0, (%eax) + movq -136(%ebp), %rax + vmovsd -64(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + vmovsd -56(%ebp), %xmm0 + vpextrd $3, %xmm1, %eax + vmovsd %xmm0, (%eax) + addl $152, %esp + popq %rbx + popq %r10 + .cfi_def_cfa 10, 0 + popq %r12 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + ENTRY (_ZGVcN4vvv_sincos) -WRAPPER_IMPL_AVX_fFF _ZGVbN2vvv_sincos +WRAPPER_IMPL_AVX_fFF_vvv _ZGVbN2vl8l8_sincos END (_ZGVcN4vvv_sincos) diff --git a/sysdeps/x86_64/fpu/svml_d_sincos8_core.S b/sysdeps/x86_64/fpu/svml_d_sincos8_core.S index 68d490e..7f51ed5 100644 --- a/sysdeps/x86_64/fpu/svml_d_sincos8_core.S +++ b/sysdeps/x86_64/fpu/svml_d_sincos8_core.S @@ -20,6 +20,205 @@ #include "svml_d_wrapper_impl.h" .text +ENTRY (_ZGVeN8vl8l8_sincos) +WRAPPER_IMPL_AVX512_fFF _ZGVdN4vl8l8_sincos +END (_ZGVeN8vl8l8_sincos) + +/* AVX512 ISA version as wrapper to AVX2 ISA version (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_AVX512_fFF_vvv callee +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-64, %rsp + subq $320, %rsp + /* Encoding for vmovups %zmm0, 256(%rsp). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x44 + .byte 0x24 + .byte 0x04 + lea (%rsp), %rdi + /* Encoding for vmovups %zmm1, 128(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x4f + .byte 0x02 + /* Encoding for vmovups %zmm2, 192(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x57 + .byte 0x03 + lea 64(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + vmovdqu 288(%rsp), %ymm0 + lea 32(%rsp), %rdi + lea 96(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 128(%rsp), %rdx + movq 192(%rsp), %rsi + movq 136(%rsp), %r8 + movq 200(%rsp), %r10 + movq (%rsp), %rax + movq 64(%rsp), %rcx + movq 8(%rsp), %rdi + movq 72(%rsp), %r9 + movq %rax, (%rdx) + movq %rcx, (%rsi) + movq 144(%rsp), %rax + movq 208(%rsp), %rcx + movq %rdi, (%r8) + movq %r9, (%r10) + movq 152(%rsp), %rdi + movq 216(%rsp), %r9 + movq 16(%rsp), %r11 + movq 80(%rsp), %rdx + movq 24(%rsp), %rsi + movq 88(%rsp), %r8 + movq %r11, (%rax) + movq %rdx, (%rcx) + movq 160(%rsp), %r11 + movq 224(%rsp), %rdx + movq %rsi, (%rdi) + movq %r8, (%r9) + movq 168(%rsp), %rsi + movq 232(%rsp), %r8 + movq 32(%rsp), %r10 + movq 96(%rsp), %rax + movq 40(%rsp), %rcx + movq 104(%rsp), %rdi + movq %r10, (%r11) + movq %rax, (%rdx) + movq 176(%rsp), %r10 + movq 240(%rsp), %rax + movq %rcx, (%rsi) + movq %rdi, (%r8) + movq 184(%rsp), %rcx + movq 248(%rsp), %rdi + movq 48(%rsp), %r9 + movq 112(%rsp), %r11 + movq 56(%rsp), %rdx + movq 120(%rsp), %rsi + movq %r9, (%r10) + movq %r11, (%rax) + movq %rdx, (%rcx) + movq %rsi, (%rdi) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-64, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r12 + leal -112(%rbp), %esi + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x70,0x6 + .cfi_escape 0x10,0xc,0x2,0x76,0x78 + leal -176(%rbp), %edi + movq %rsi, %r12 + pushq %rbx + .cfi_escape 0x10,0x3,0x2,0x76,0x68 + movq %rdi, %rbx + subl $280, %esp + vmovdqa %ymm1, -208(%ebp) + vmovdqa %ymm2, -240(%ebp) + /* Encoding for vmovapd %zmm0, -304(%ebp). */ + .byte 0x67 + .byte 0x62 + .byte 0xf1 + .byte 0xfd + .byte 0x48 + .byte 0x29 + .byte 0x85 + .byte 0xd0 + .byte 0xfe + .byte 0xff + .byte 0xff + call HIDDEN_JUMPTARGET(\callee) + leal 32(%r12), %esi + vmovupd -272(%ebp), %ymm0 + leal 32(%rbx), %edi + call HIDDEN_JUMPTARGET(\callee) + movl -208(%ebp), %eax + vmovsd -176(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -204(%ebp), %eax + vmovsd -168(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -200(%ebp), %eax + vmovsd -160(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -196(%ebp), %eax + vmovsd -152(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -192(%ebp), %eax + vmovsd -144(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -188(%ebp), %eax + vmovsd -136(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -184(%ebp), %eax + vmovsd -128(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -180(%ebp), %eax + vmovsd -120(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -240(%ebp), %eax + vmovsd -112(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -236(%ebp), %eax + vmovsd -104(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -232(%ebp), %eax + vmovsd -96(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -228(%ebp), %eax + vmovsd -88(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -224(%ebp), %eax + vmovsd -80(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -220(%ebp), %eax + vmovsd -72(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -216(%ebp), %eax + vmovsd -64(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + movl -212(%ebp), %eax + vmovsd -56(%ebp), %xmm0 + vmovsd %xmm0, (%eax) + addl $280, %esp + popq %rbx + popq %r10 + .cfi_def_cfa 10, 0 + popq %r12 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + ENTRY (_ZGVeN8vvv_sincos) -WRAPPER_IMPL_AVX512_fFF _ZGVdN4vvv_sincos +WRAPPER_IMPL_AVX512_fFF_vvv _ZGVdN4vl8l8_sincos END (_ZGVeN8vvv_sincos) diff --git a/sysdeps/x86_64/fpu/svml_s_expf4_core.S b/sysdeps/x86_64/fpu/svml_s_expf4_core.S index 65b5d1a..3901564 100644 --- a/sysdeps/x86_64/fpu/svml_s_expf4_core.S +++ b/sysdeps/x86_64/fpu/svml_s_expf4_core.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVbN4v_expf) -WRAPPER_IMPL_SSE2 expf +WRAPPER_IMPL_SSE2 __expf_finite END (_ZGVbN4v_expf) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_s_logf4_core.S b/sysdeps/x86_64/fpu/svml_s_logf4_core.S index 195f328..fa13933 100644 --- a/sysdeps/x86_64/fpu/svml_s_logf4_core.S +++ b/sysdeps/x86_64/fpu/svml_s_logf4_core.S @@ -22,7 +22,7 @@ .text ENTRY (_ZGVbN4v_logf) -WRAPPER_IMPL_SSE2 logf +WRAPPER_IMPL_SSE2 __logf_finite END (_ZGVbN4v_logf) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_s_powf4_core.S b/sysdeps/x86_64/fpu/svml_s_powf4_core.S index 88fae60..7bb5b3d 100644 --- a/sysdeps/x86_64/fpu/svml_s_powf4_core.S +++ b/sysdeps/x86_64/fpu/svml_s_powf4_core.S @@ -21,7 +21,7 @@ .text ENTRY (_ZGVbN4vv_powf) -WRAPPER_IMPL_SSE2_ff powf +WRAPPER_IMPL_SSE2_ff __powf_finite END (_ZGVbN4vv_powf) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S b/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S index 5cbf10b..aae1adb 100644 --- a/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S +++ b/sysdeps/x86_64/fpu/svml_s_sincosf16_core.S @@ -20,6 +20,339 @@ #include "svml_s_wrapper_impl.h" .text +ENTRY (_ZGVeN16vl4l4_sincosf) +WRAPPER_IMPL_AVX512_fFF _ZGVdN8vl4l4_sincosf +END (_ZGVeN16vl4l4_sincosf) + +/* AVX512 ISA version as wrapper to AVX2 ISA version (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_AVX512_fFF_vvv callee +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-64, %rsp + subq $448, %rsp + /* Encoding for vmovups %zmm0, 384(%rsp). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x44 + .byte 0x24 + .byte 0x06 + lea (%rsp), %rdi + /* Encoding for vmovups %zmm1, 128(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x4f + .byte 0x02 + /* Encoding for vmovups %zmm2, 192(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x57 + .byte 0x03 + /* Encoding for vmovups %zmm3, 256(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x5f + .byte 0x04 + /* Encoding for vmovups %zmm4, 320(%rdi). */ + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x11 + .byte 0x67 + .byte 0x05 + lea 64(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + vmovdqu 416(%rsp), %ymm0 + lea 32(%rsp), %rdi + lea 96(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 128(%rsp), %rdx + movq 136(%rsp), %rsi + movq 144(%rsp), %r8 + movq 152(%rsp), %r10 + movl (%rsp), %eax + movl 4(%rsp), %ecx + movl 8(%rsp), %edi + movl 12(%rsp), %r9d + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 160(%rsp), %rax + movq 168(%rsp), %rcx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 176(%rsp), %rdi + movq 184(%rsp), %r9 + movl 16(%rsp), %r11d + movl 20(%rsp), %edx + movl 24(%rsp), %esi + movl 28(%rsp), %r8d + movl %r11d, (%rax) + movl %edx, (%rcx) + movq 192(%rsp), %r11 + movq 200(%rsp), %rdx + movl %esi, (%rdi) + movl %r8d, (%r9) + movq 208(%rsp), %rsi + movq 216(%rsp), %r8 + movl 32(%rsp), %r10d + movl 36(%rsp), %eax + movl 40(%rsp), %ecx + movl 44(%rsp), %edi + movl %r10d, (%r11) + movl %eax, (%rdx) + movq 224(%rsp), %r10 + movq 232(%rsp), %rax + movl %ecx, (%rsi) + movl %edi, (%r8) + movq 240(%rsp), %rcx + movq 248(%rsp), %rdi + movl 48(%rsp), %r9d + movl 52(%rsp), %r11d + movl 56(%rsp), %edx + movl 60(%rsp), %esi + movl %r9d, (%r10) + movl %r11d, (%rax) + movq 256(%rsp), %r9 + movq 264(%rsp), %r11 + movl %edx, (%rcx) + movl %esi, (%rdi) + movq 272(%rsp), %rdx + movq 280(%rsp), %rsi + movl 64(%rsp), %r8d + movl 68(%rsp), %r10d + movl 72(%rsp), %eax + movl 76(%rsp), %ecx + movl %r8d, (%r9) + movl %r10d, (%r11) + movq 288(%rsp), %r8 + movq 296(%rsp), %r10 + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 304(%rsp), %rax + movq 312(%rsp), %rcx + movl 80(%rsp), %edi + movl 84(%rsp), %r9d + movl 88(%rsp), %r11d + movl 92(%rsp), %edx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 320(%rsp), %rdi + movq 328(%rsp), %r9 + movl %r11d, (%rax) + movl %edx, (%rcx) + movq 336(%rsp), %r11 + movq 344(%rsp), %rdx + movl 96(%rsp), %esi + movl 100(%rsp), %r8d + movl 104(%rsp), %r10d + movl 108(%rsp), %eax + movl %esi, (%rdi) + movl %r8d, (%r9) + movq 352(%rsp), %rsi + movq 360(%rsp), %r8 + movl %r10d, (%r11) + movl %eax, (%rdx) + movq 368(%rsp), %r10 + movq 376(%rsp), %rax + movl 112(%rsp), %ecx + movl 116(%rsp), %edi + movl 120(%rsp), %r9d + movl 124(%rsp), %r11d + movl %ecx, (%rsi) + movl %edi, (%r8) + movl %r9d, (%r10) + movl %r11d, (%rax) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-64, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r12 + leal -112(%rbp), %esi + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x70,0x6 + .cfi_escape 0x10,0xc,0x2,0x76,0x78 + leal -176(%rbp), %edi + movq %rsi, %r12 + pushq %rbx + .cfi_escape 0x10,0x3,0x2,0x76,0x68 + movq %rdi, %rbx + subl $344, %esp + /* Encoding for vmovdqa64 %zmm1, -240(%ebp). */ + .byte 0x67 + .byte 0x62 + .byte 0xf1 + .byte 0xfd + .byte 0x48 + .byte 0x7f + .byte 0x8d + .byte 0x10 + .byte 0xff + .byte 0xff + .byte 0xff + /* Encoding for vmovdqa64 %zmm2, -304(%ebp). */ + .byte 0x67 + .byte 0x62 + .byte 0xf1 + .byte 0xfd + .byte 0x48 + .byte 0x7f + .byte 0x95 + .byte 0xd0 + .byte 0xfe + .byte 0xff + .byte 0xff + /* Encoding for vmovaps %zmm0, -368(%ebp). */ + .byte 0x67 + .byte 0x62 + .byte 0xf1 + .byte 0x7c + .byte 0x48 + .byte 0x29 + .byte 0x85 + .byte 0x90 + .byte 0xfe + .byte 0xff + .byte 0xff + call HIDDEN_JUMPTARGET(\callee) + leal 32(%r12), %esi + vmovups -336(%ebp), %ymm0 + leal 32(%rbx), %edi + call HIDDEN_JUMPTARGET(\callee) + movl -240(%ebp), %eax + vmovss -176(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -236(%ebp), %eax + vmovss -172(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -232(%ebp), %eax + vmovss -168(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -228(%ebp), %eax + vmovss -164(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -224(%ebp), %eax + vmovss -160(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -220(%ebp), %eax + vmovss -156(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -216(%ebp), %eax + vmovss -152(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -212(%ebp), %eax + vmovss -148(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -208(%ebp), %eax + vmovss -144(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -204(%ebp), %eax + vmovss -140(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -200(%ebp), %eax + vmovss -136(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -196(%ebp), %eax + vmovss -132(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -192(%ebp), %eax + vmovss -128(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -188(%ebp), %eax + vmovss -124(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -184(%ebp), %eax + vmovss -120(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -180(%ebp), %eax + vmovss -116(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -304(%ebp), %eax + vmovss -112(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -300(%ebp), %eax + vmovss -108(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -296(%ebp), %eax + vmovss -104(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -292(%ebp), %eax + vmovss -100(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -288(%ebp), %eax + vmovss -96(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -284(%ebp), %eax + vmovss -92(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -280(%ebp), %eax + vmovss -88(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -276(%ebp), %eax + vmovss -84(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -272(%ebp), %eax + vmovss -80(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -268(%ebp), %eax + vmovss -76(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -264(%ebp), %eax + vmovss -72(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -260(%ebp), %eax + vmovss -68(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -256(%ebp), %eax + vmovss -64(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -252(%ebp), %eax + vmovss -60(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -248(%ebp), %eax + vmovss -56(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -244(%ebp), %eax + vmovss -52(%ebp), %xmm0 + vmovss %xmm0, (%eax) + addl $344, %esp + popq %rbx + popq %r10 + .cfi_def_cfa 10, 0 + popq %r12 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + ENTRY (_ZGVeN16vvv_sincosf) -WRAPPER_IMPL_AVX512_fFF _ZGVdN8vvv_sincosf +WRAPPER_IMPL_AVX512_fFF_vvv _ZGVdN8vl4l4_sincosf END (_ZGVeN16vvv_sincosf) diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S b/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S index 1a7d273..0963c39 100644 --- a/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S +++ b/sysdeps/x86_64/fpu/svml_s_sincosf4_core.S @@ -16,13 +16,135 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ - #include <sysdep.h> #include "svml_s_wrapper_impl.h" .text -ENTRY (_ZGVbN4vvv_sincosf) +ENTRY (_ZGVbN4vl4l4_sincosf) WRAPPER_IMPL_SSE2_fFF sincosf +END (_ZGVbN4vl4l4_sincosf) +libmvec_hidden_def (_ZGVbN4vl4l4_sincosf) + +/* SSE2 ISA version as wrapper to scalar (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_SSE2_fFF_vvv callee +#ifndef __ILP32__ + subq $120, %rsp + cfi_adjust_cfa_offset(120) + movaps %xmm0, 96(%rsp) + lea (%rsp), %rdi + movdqa %xmm1, 32(%rdi) + lea 16(%rsp), %rsi + movdqa %xmm2, 32(%rsi) + movdqa %xmm3, 48(%rsi) + movdqa %xmm4, 64(%rsi) + call JUMPTARGET(\callee) + movss 100(%rsp), %xmm0 + lea 4(%rsp), %rdi + lea 20(%rsp), %rsi + call JUMPTARGET(\callee) + movss 104(%rsp), %xmm0 + lea 8(%rsp), %rdi + lea 24(%rsp), %rsi + call JUMPTARGET(\callee) + movss 108(%rsp), %xmm0 + lea 12(%rsp), %rdi + lea 28(%rsp), %rsi + call JUMPTARGET(\callee) + movq 32(%rsp), %rdx + movq 40(%rsp), %rsi + movq 48(%rsp), %r8 + movq 56(%rsp), %r10 + movl (%rsp), %eax + movl 4(%rsp), %ecx + movl 8(%rsp), %edi + movl 12(%rsp), %r9d + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 64(%rsp), %rax + movq 72(%rsp), %rcx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 80(%rsp), %rdi + movq 88(%rsp), %r9 + movl 16(%rsp), %r11d + movl 20(%rsp), %edx + movl 24(%rsp), %esi + movl 28(%rsp), %r8d + movl %r11d, (%rax) + movl %edx, (%rcx) + movl %esi, (%rdi) + movl %r8d, (%r9) + addq $120, %rsp + cfi_adjust_cfa_offset(-120) + ret +#else + pushq %rbp + .cfi_def_cfa_offset 16 + .cfi_offset 6, -16 + pushq %rbx + .cfi_def_cfa_offset 24 + .cfi_offset 3, -24 + subl $88, %esp + .cfi_def_cfa_offset 112 + leal 64(%rsp), %esi + movaps %xmm1, (%esp) + leal 48(%rsp), %edi + movaps %xmm2, 16(%esp) + movq %rsi, %rbp + movq %rdi, %rbx + movaps %xmm0, 32(%esp) + call JUMPTARGET(\callee) + movups 36(%esp), %xmm0 + leal 4(%rbp), %esi + leal 4(%rbx), %edi + call JUMPTARGET(\callee) + movups 40(%esp), %xmm0 + leal 8(%rbp), %esi + leal 8(%rbx), %edi + call JUMPTARGET(\callee) + movups 44(%esp), %xmm0 + leal 12(%rbp), %esi + leal 12(%rbx), %edi + call JUMPTARGET(\callee) + movq (%esp), %rax + movss 48(%esp), %xmm0 + movdqa (%esp), %xmm4 + movdqa 16(%esp), %xmm7 + movss %xmm0, (%eax) + movss 52(%esp), %xmm0 + pextrd $1, %xmm4, %eax + movss %xmm0, (%eax) + movq 8(%esp), %rax + movss 56(%esp), %xmm0 + movss %xmm0, (%eax) + movss 60(%esp), %xmm0 + pextrd $3, %xmm4, %eax + movss %xmm0, (%eax) + movq 16(%esp), %rax + movss 64(%esp), %xmm0 + movss %xmm0, (%eax) + movss 68(%esp), %xmm0 + pextrd $1, %xmm7, %eax + movss %xmm0, (%eax) + movq 24(%esp), %rax + movss 72(%esp), %xmm0 + movss %xmm0, (%eax) + movss 76(%esp), %xmm0 + pextrd $3, %xmm7, %eax + movss %xmm0, (%eax) + addl $88, %esp + .cfi_def_cfa_offset 24 + popq %rbx + .cfi_def_cfa_offset 16 + popq %rbp + .cfi_def_cfa_offset 8 + ret +#endif +.endm + +ENTRY (_ZGVbN4vvv_sincosf) +WRAPPER_IMPL_SSE2_fFF_vvv sincosf END (_ZGVbN4vvv_sincosf) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S b/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S index 74d1dfd..93ac916 100644 --- a/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S +++ b/sysdeps/x86_64/fpu/svml_s_sincosf8_core.S @@ -20,8 +20,179 @@ #include "svml_s_wrapper_impl.h" .text +ENTRY (_ZGVdN8vl4l4_sincosf) +WRAPPER_IMPL_AVX_fFF _ZGVbN4vl4l4_sincosf +END (_ZGVdN8vl4l4_sincosf) +libmvec_hidden_def (_ZGVdN8vl4l4_sincosf) + +/* AVX2 ISA version as wrapper to SSE ISA version (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_AVX2_fFF_vvv callee +#ifndef __ILP32__ + pushq %rbp + cfi_adjust_cfa_offset (8) + cfi_rel_offset (%rbp, 0) + movq %rsp, %rbp + cfi_def_cfa_register (%rbp) + andq $-32, %rsp + subq $224, %rsp + vmovups %ymm0, 192(%rsp) + lea (%rsp), %rdi + vmovdqu %ymm1, 64(%rdi) + vmovdqu %ymm2, 96(%rdi) + vmovdqu %ymm3, 128(%rdi) + vmovdqu %ymm4, 160(%rdi) + lea 32(%rsp), %rsi + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + vmovups 208(%rsp), %xmm0 + lea 16(%rsp), %rdi + lea 48(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 64(%rsp), %rdx + movq 72(%rsp), %rsi + movq 80(%rsp), %r8 + movq 88(%rsp), %r10 + movl (%rsp), %eax + movl 4(%rsp), %ecx + movl 8(%rsp), %edi + movl 12(%rsp), %r9d + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 96(%rsp), %rax + movq 104(%rsp), %rcx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 112(%rsp), %rdi + movq 120(%rsp), %r9 + movl 16(%rsp), %r11d + movl 20(%rsp), %edx + movl 24(%rsp), %esi + movl 28(%rsp), %r8d + movl %r11d, (%rax) + movl %edx, (%rcx) + movq 128(%rsp), %r11 + movq 136(%rsp), %rdx + movl %esi, (%rdi) + movl %r8d, (%r9) + movq 144(%rsp), %rsi + movq 152(%rsp), %r8 + movl 32(%rsp), %r10d + movl 36(%rsp), %eax + movl 40(%rsp), %ecx + movl 44(%rsp), %edi + movl %r10d, (%r11) + movl %eax, (%rdx) + movq 160(%rsp), %r10 + movq 168(%rsp), %rax + movl %ecx, (%rsi) + movl %edi, (%r8) + movq 176(%rsp), %rcx + movq 184(%rsp), %rdi + movl 48(%rsp), %r9d + movl 52(%rsp), %r11d + movl 56(%rsp), %edx + movl 60(%rsp), %esi + movl %r9d, (%r10) + movl %r11d, (%rax) + movl %edx, (%rcx) + movl %esi, (%rdi) + movq %rbp, %rsp + cfi_def_cfa_register (%rsp) + popq %rbp + cfi_adjust_cfa_offset (-8) + cfi_restore (%rbp) + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-32, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r12 + leal -80(%rbp), %esi + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x70,0x6 + .cfi_escape 0x10,0xc,0x2,0x76,0x78 + leal -112(%rbp), %edi + movq %rsi, %r12 + pushq %rbx + .cfi_escape 0x10,0x3,0x2,0x76,0x68 + movq %rdi, %rbx + subl $184, %esp + vmovdqa %ymm1, -144(%ebp) + vmovdqa %ymm2, -176(%ebp) + vmovaps %ymm0, -208(%ebp) + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + leal 16(%r12), %esi + vmovups -192(%ebp), %xmm0 + leal 16(%rbx), %edi + call HIDDEN_JUMPTARGET(\callee) + movl -144(%ebp), %eax + vmovss -112(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -140(%ebp), %eax + vmovss -108(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -136(%ebp), %eax + vmovss -104(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -132(%ebp), %eax + vmovss -100(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -128(%ebp), %eax + vmovss -96(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -124(%ebp), %eax + vmovss -92(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -120(%ebp), %eax + vmovss -88(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -116(%ebp), %eax + vmovss -84(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -176(%ebp), %eax + vmovss -80(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -172(%ebp), %eax + vmovss -76(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -168(%ebp), %eax + vmovss -72(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -164(%ebp), %eax + vmovss -68(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -160(%ebp), %eax + vmovss -64(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -156(%ebp), %eax + vmovss -60(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -152(%ebp), %eax + vmovss -56(%ebp), %xmm0 + vmovss %xmm0, (%eax) + movl -148(%ebp), %eax + vmovss -52(%ebp), %xmm0 + vmovss %xmm0, (%eax) + addl $184, %esp + popq %rbx + popq %r10 + .cfi_def_cfa 10, 0 + popq %r12 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + ENTRY (_ZGVdN8vvv_sincosf) -WRAPPER_IMPL_AVX_fFF _ZGVbN4vvv_sincosf +WRAPPER_IMPL_AVX2_fFF_vvv _ZGVbN4vl4l4_sincosf END (_ZGVdN8vvv_sincosf) #ifndef USE_MULTIARCH diff --git a/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S b/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S index 55b8b2d..cd88195 100644 --- a/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S +++ b/sysdeps/x86_64/fpu/svml_s_sincosf8_core_avx.S @@ -20,6 +20,179 @@ #include "svml_s_wrapper_impl.h" .text -ENTRY(_ZGVcN8vvv_sincosf) -WRAPPER_IMPL_AVX_fFF _ZGVbN4vvv_sincosf -END(_ZGVcN8vvv_sincosf) +ENTRY (_ZGVcN8vl4l4_sincosf) +WRAPPER_IMPL_AVX_fFF _ZGVbN4vl4l4_sincosf +END (_ZGVcN8vl4l4_sincosf) + +/* AVX ISA version as wrapper to SSE ISA version (for vector + function declared with #pragma omp declare simd notinbranch). */ +.macro WRAPPER_IMPL_AVX_fFF_vvv callee +#ifndef __ILP32__ + pushq %rbp + movq %rsp, %rbp + andq $-32, %rsp + subq $224, %rsp + vmovups %ymm0, 64(%rsp) + lea (%rsp), %rdi + vmovdqu %xmm1, 96(%rdi) + vmovdqu %xmm2, 112(%rdi) + vmovdqu %xmm3, 128(%rdi) + vmovdqu %xmm4, 144(%rdi) + vmovdqu %xmm5, 160(%rdi) + lea 32(%rsp), %rsi + vmovdqu %xmm6, 144(%rsi) + vmovdqu %xmm7, 160(%rsi) + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + vmovdqu 80(%rsp), %xmm0 + lea 16(%rsp), %rdi + lea 48(%rsp), %rsi + call HIDDEN_JUMPTARGET(\callee) + movq 96(%rsp), %rdx + movq 104(%rsp), %rsi + movq 112(%rsp), %r8 + movq 120(%rsp), %r10 + movl (%rsp), %eax + movl 4(%rsp), %ecx + movl 8(%rsp), %edi + movl 12(%rsp), %r9d + movl %eax, (%rdx) + movl %ecx, (%rsi) + movq 128(%rsp), %rax + movq 136(%rsp), %rcx + movl %edi, (%r8) + movl %r9d, (%r10) + movq 144(%rsp), %rdi + movq 152(%rsp), %r9 + movl 16(%rsp), %r11d + movl 20(%rsp), %edx + movl 24(%rsp), %esi + movl 28(%rsp), %r8d + movl %r11d, (%rax) + movl %edx, (%rcx) + movq 160(%rsp), %r11 + movq 168(%rsp), %rdx + movl %esi, (%rdi) + movl %r8d, (%r9) + movq 176(%rsp), %rsi + movq 184(%rsp), %r8 + movl 32(%rsp), %r10d + movl 36(%rsp), %eax + movl 40(%rsp), %ecx + movl 44(%rsp), %edi + movl %r10d, (%r11) + movl %eax, (%rdx) + movq 192(%rsp), %r10 + movq 200(%rsp), %rax + movl %ecx, (%rsi) + movl %edi, (%r8) + movq 16(%rbp), %rcx + movq 24(%rbp), %rdi + movl 48(%rsp), %r9d + movl 52(%rsp), %r11d + movl 56(%rsp), %edx + movl 60(%rsp), %esi + movl %r9d, (%r10) + movl %r11d, (%rax) + movl %edx, (%rcx) + movl %esi, (%rdi) + movq %rbp, %rsp + popq %rbp + ret +#else + leal 8(%rsp), %r10d + .cfi_def_cfa 10, 0 + andl $-32, %esp + pushq -8(%r10d) + pushq %rbp + .cfi_escape 0x10,0x6,0x2,0x76,0 + movl %esp, %ebp + pushq %r12 + leal -80(%rbp), %esi + pushq %r10 + .cfi_escape 0xf,0x3,0x76,0x70,0x6 + .cfi_escape 0x10,0xc,0x2,0x76,0x78 + leal -112(%rbp), %edi + movq %rsi, %r12 + pushq %rbx + .cfi_escape 0x10,0x3,0x2,0x76,0x68 + movq %rdi, %rbx + subl $184, %esp + vmovaps %xmm1, -128(%ebp) + vmovaps %xmm2, -144(%ebp) + vmovaps %xmm3, -160(%ebp) + vmovaps %xmm4, -176(%ebp) + vmovaps %ymm0, -208(%ebp) + vzeroupper + call HIDDEN_JUMPTARGET(\callee) + leal 16(%r12), %esi + vmovups -192(%ebp), %xmm0 + leal 16(%rbx), %edi + call HIDDEN_JUMPTARGET(\callee) + movq -128(%ebp), %rax + vmovss -112(%ebp), %xmm0 + vmovdqa -128(%ebp), %xmm7 + vmovdqa -144(%ebp), %xmm3 + vmovss %xmm0, (%eax) + vmovss -108(%ebp), %xmm0 + vpextrd $1, %xmm7, %eax + vmovss %xmm0, (%eax) + movq -120(%ebp), %rax + vmovss -104(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -100(%ebp), %xmm0 + vpextrd $3, %xmm7, %eax + vmovdqa -160(%ebp), %xmm7 + vmovss %xmm0, (%eax) + movq -144(%ebp), %rax + vmovss -96(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -92(%ebp), %xmm0 + vpextrd $1, %xmm3, %eax + vmovss %xmm0, (%eax) + movq -136(%ebp), %rax + vmovss -88(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -84(%ebp), %xmm0 + vpextrd $3, %xmm3, %eax + vmovss %xmm0, (%eax) + movq -160(%ebp), %rax + vmovss -80(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -76(%ebp), %xmm0 + vpextrd $1, %xmm7, %eax + vmovss %xmm0, (%eax) + movq -152(%ebp), %rax + vmovss -72(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -68(%ebp), %xmm0 + vpextrd $3, %xmm7, %eax + vmovss %xmm0, (%eax) + movq -176(%ebp), %rax + vmovss -64(%ebp), %xmm0 + vmovdqa -176(%ebp), %xmm3 + vmovss %xmm0, (%eax) + vmovss -60(%ebp), %xmm0 + vpextrd $1, %xmm3, %eax + vmovss %xmm0, (%eax) + movq -168(%ebp), %rax + vmovss -56(%ebp), %xmm0 + vmovss %xmm0, (%eax) + vmovss -52(%ebp), %xmm0 + vpextrd $3, %xmm3, %eax + vmovss %xmm0, (%eax) + addl $184, %esp + popq %rbx + popq %r10 + .cfi_def_cfa 10, 0 + popq %r12 + popq %rbp + leal -8(%r10), %esp + .cfi_def_cfa 7, 8 + ret +#endif +.endm + +ENTRY (_ZGVcN8vvv_sincosf) +WRAPPER_IMPL_AVX_fFF_vvv _ZGVbN4vl4l4_sincosf +END (_ZGVcN8vvv_sincosf) diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c new file mode 100644 index 0000000..fc2ffea --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c @@ -0,0 +1 @@ +#include "test-double-libmvec-sincos-main.c" diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c new file mode 100644 index 0000000..896f1bc --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx.c @@ -0,0 +1 @@ +#include "test-double-libmvec-sincos.c" diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c new file mode 100644 index 0000000..fc2ffea --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c @@ -0,0 +1 @@ +#include "test-double-libmvec-sincos-main.c" diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c new file mode 100644 index 0000000..896f1bc --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2.c @@ -0,0 +1 @@ +#include "test-double-libmvec-sincos.c" diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c new file mode 100644 index 0000000..fc2ffea --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c @@ -0,0 +1 @@ +#include "test-double-libmvec-sincos-main.c" diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c new file mode 100644 index 0000000..896f1bc --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512.c @@ -0,0 +1 @@ +#include "test-double-libmvec-sincos.c" diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c new file mode 100644 index 0000000..afa3615 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c @@ -0,0 +1,43 @@ +/* Test for vector sincos ABI. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math.h> + +#define N 1000 +double x[N], s[N], c[N]; +double* s_ptrs[N]; +double* c_ptrs[N]; + +int +test_sincos_abi (void) +{ + int i; + + for(i = 0; i < N; i++) + { + x[i] = i / 3; + s_ptrs[i] = &s[i]; + c_ptrs[i] = &c[i]; + } + +#pragma omp simd + for(i = 0; i < N; i++) + sincos (x[i], s_ptrs[i], c_ptrs[i]); + + return 0; +} diff --git a/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c new file mode 100644 index 0000000..90ff9a9 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-libmvec-sincos.c @@ -0,0 +1,44 @@ +/* Test for vector sincos ABI. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math-tests-arch.h> + +extern int test_sincos_abi (void); + +int arch_check = 1; + +static void +check_arch (void) +{ + CHECK_ARCH_EXT; + arch_check = 0; +} + +static int +do_test (void) +{ + check_arch (); + + if (arch_check) + return 77; + + return test_sincos_abi (); +} + +#define TEST_FUNCTION do_test () +#include "../../../test-skeleton.c" diff --git a/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c index a9d1597..375582e 100644 --- a/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c +++ b/sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c @@ -17,13 +17,17 @@ <http://www.gnu.org/licenses/>. */ #include "test-double-vlen2.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #define VEC_TYPE __m128d VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVbN2v_cos) VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVbN2v_sin) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVbN2vvv_sincos) VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVbN2v_log) VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVbN2v_exp) VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVbN2vv_pow) + +#define VEC_INT_TYPE __m128i + +VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVbN2vvv_sincos) diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c index eb6a531..00b7d4e 100644 --- a/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c +++ b/sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c @@ -17,6 +17,7 @@ <http://www.gnu.org/licenses/>. */ #include "test-double-vlen4.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #undef VEC_SUFF @@ -26,7 +27,14 @@ VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVdN4v_cos) VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVdN4v_sin) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVdN4vvv_sincos) VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVdN4v_log) VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVdN4v_exp) VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVdN4vv_pow) + +#ifndef __ILP32__ +# define VEC_INT_TYPE __m256i +#else +# define VEC_INT_TYPE __m128i +#endif + +VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVdN4vvv_sincos) diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c index 52b81da..51ddbfa 100644 --- a/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c +++ b/sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c @@ -17,13 +17,21 @@ <http://www.gnu.org/licenses/>. */ #include "test-double-vlen4.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #define VEC_TYPE __m256d VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVcN4v_cos) VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVcN4v_sin) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVcN4vvv_sincos) VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVcN4v_log) VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVcN4v_exp) VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVcN4vv_pow) + +#define VEC_INT_TYPE __m128i + +#ifndef __ILP32__ +VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincos), _ZGVcN4vvv_sincos) +#else +VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVcN4vvv_sincos) +#endif diff --git a/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c b/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c index c10bb9c..5460b6b 100644 --- a/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c +++ b/sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c @@ -17,13 +17,21 @@ <http://www.gnu.org/licenses/>. */ #include "test-double-vlen8.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #define VEC_TYPE __m512d VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVeN8v_cos) VECTOR_WRAPPER (WRAPPER_NAME (sin), _ZGVeN8v_sin) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincos), _ZGVeN8vvv_sincos) VECTOR_WRAPPER (WRAPPER_NAME (log), _ZGVeN8v_log) VECTOR_WRAPPER (WRAPPER_NAME (exp), _ZGVeN8v_exp) VECTOR_WRAPPER_ff (WRAPPER_NAME (pow), _ZGVeN8vv_pow) + +#ifndef __ILP32__ +# define VEC_INT_TYPE __m512i +#else +# define VEC_INT_TYPE __m256i +#endif + +VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincos), _ZGVeN8vvv_sincos) diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c new file mode 100644 index 0000000..558e2ac --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c @@ -0,0 +1 @@ +#include "test-float-libmvec-sincosf-main.c" diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c new file mode 100644 index 0000000..5b45f0a --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx.c @@ -0,0 +1 @@ +#include "test-float-libmvec-sincosf.c" diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c new file mode 100644 index 0000000..558e2ac --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c @@ -0,0 +1 @@ +#include "test-float-libmvec-sincosf-main.c" diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c new file mode 100644 index 0000000..5b45f0a --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2.c @@ -0,0 +1 @@ +#include "test-float-libmvec-sincosf.c" diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c new file mode 100644 index 0000000..558e2ac --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c @@ -0,0 +1 @@ +#include "test-float-libmvec-sincosf-main.c" diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c new file mode 100644 index 0000000..5b45f0a --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512.c @@ -0,0 +1 @@ +#include "test-float-libmvec-sincosf.c" diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c index 4a479b1..271468f 100644 --- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c @@ -1,7 +1,6 @@ -/* Compute positive difference, sparc 32-bit+v9+vis3. - Copyright (C) 2013-2016 Free Software Foundation, Inc. +/* Test for vector sincosf ABI. + Copyright (C) 2016 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David S. Miller <davem@davemloft.net>. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -17,18 +16,27 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <sysdep.h> - -ENTRY(__fdim_vis3) - movwtos %o0, %f0 - movwtos %o1, %f1 - movwtos %o2, %f2 - movwtos %o3, %f3 - fcmpd %f0, %f2 - fbug 1f - nop - fzero %f0 - fnegd %f0, %f2 -1: retl - fsubd %f0, %f2, %f0 -END(__fdim_vis3) +#include <math.h> + +#define N 1000 +float x[N], s[N], c[N]; +float *s_ptrs[N]; +float *c_ptrs[N]; + +int +test_sincosf_abi (void) +{ + int i; + for(i = 0; i < N; i++) + { + x[i] = i / 3; + s_ptrs[i] = &s[i]; + c_ptrs[i] = &c[i]; + } + +#pragma omp simd + for(i = 0; i < N; i++) + sincosf (x[i], s_ptrs[i], c_ptrs[i]); + + return 0; +} diff --git a/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c new file mode 100644 index 0000000..da57cca --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c @@ -0,0 +1,44 @@ +/* Test for vector sincosf ABI. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <math-tests-arch.h> + +extern int test_sincosf_abi (void); + +int arch_check = 1; + +static void +check_arch (void) +{ + CHECK_ARCH_EXT; + arch_check = 0; +} + +static int +do_test (void) +{ + check_arch (); + + if (arch_check) + return 77; + + return test_sincosf_abi (); +} + +#define TEST_FUNCTION do_test () +#include "../../../test-skeleton.c" diff --git a/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c index dc09e4a..f3bf7dc 100644 --- a/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c +++ b/sysdeps/x86_64/fpu/test-float-vlen16-wrappers.c @@ -17,13 +17,21 @@ <http://www.gnu.org/licenses/>. */ #include "test-float-vlen16.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #define VEC_TYPE __m512 VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVeN16v_cosf) VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVeN16v_sinf) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVeN16vvv_sincosf) VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVeN16v_logf) VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVeN16v_expf) VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVeN16vv_powf) + +#define VEC_INT_TYPE __m512i + +#ifndef __ILP32__ +VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVeN16vvv_sincosf) +#else +VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincosf), _ZGVeN16vvv_sincosf) +#endif diff --git a/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c index 0bb9818..4060f94 100644 --- a/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c +++ b/sysdeps/x86_64/fpu/test-float-vlen4-wrappers.c @@ -17,13 +17,21 @@ <http://www.gnu.org/licenses/>. */ #include "test-float-vlen4.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #define VEC_TYPE __m128 VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVbN4v_cosf) VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVbN4v_sinf) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVbN4vvv_sincosf) VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVbN4v_logf) VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVbN4v_expf) VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVbN4vv_powf) + +#define VEC_INT_TYPE __m128i + +#ifndef __ILP32__ +VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVbN4vvv_sincosf) +#else +VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincosf), _ZGVbN4vvv_sincosf) +#endif diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c index 4985ac2..d1fc432 100644 --- a/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c +++ b/sysdeps/x86_64/fpu/test-float-vlen8-avx2-wrappers.c @@ -17,6 +17,7 @@ <http://www.gnu.org/licenses/>. */ #include "test-float-vlen8.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #undef VEC_SUFF @@ -26,7 +27,17 @@ VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVdN8v_cosf) VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVdN8v_sinf) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVdN8vvv_sincosf) VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVdN8v_logf) VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVdN8v_expf) VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVdN8vv_powf) + +/* Redefinition of wrapper to be compatible with _ZGVdN8vvv_sincosf. */ +#undef VECTOR_WRAPPER_fFF + +#define VEC_INT_TYPE __m256i + +#ifndef __ILP32__ +VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVdN8vvv_sincosf) +#else +VECTOR_WRAPPER_fFF_2 (WRAPPER_NAME (sincosf), _ZGVdN8vvv_sincosf) +#endif diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c b/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c index 9cc2883..99b462a 100644 --- a/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c +++ b/sysdeps/x86_64/fpu/test-float-vlen8-wrappers.c @@ -17,13 +17,21 @@ <http://www.gnu.org/licenses/>. */ #include "test-float-vlen8.h" +#include "test-math-vector-sincos.h" #include <immintrin.h> #define VEC_TYPE __m256 VECTOR_WRAPPER (WRAPPER_NAME (cosf), _ZGVcN8v_cosf) VECTOR_WRAPPER (WRAPPER_NAME (sinf), _ZGVcN8v_sinf) -VECTOR_WRAPPER_fFF (WRAPPER_NAME (sincosf), _ZGVcN8vvv_sincosf) VECTOR_WRAPPER (WRAPPER_NAME (logf), _ZGVcN8v_logf) VECTOR_WRAPPER (WRAPPER_NAME (expf), _ZGVcN8v_expf) VECTOR_WRAPPER_ff (WRAPPER_NAME (powf), _ZGVcN8vv_powf) + +#define VEC_INT_TYPE __m128i + +#ifndef __ILP32__ +VECTOR_WRAPPER_fFF_4 (WRAPPER_NAME (sincosf), _ZGVcN8vvv_sincosf) +#else +VECTOR_WRAPPER_fFF_3 (WRAPPER_NAME (sincosf), _ZGVcN8vvv_sincosf) +#endif diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/multiarch/ifunc-impl-list.c index 449b046..a443e41 100644 --- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c +++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c @@ -48,7 +48,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, /* Support sysdeps/x86_64/multiarch/memmove_chk.c. */ IFUNC_IMPL (i, name, __memmove_chk, -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __memmove_chk_avx512_no_vzeroupper) @@ -58,7 +57,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __memmove_chk_avx512_unaligned_erms) -#endif IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_ARCH_FEATURE (AVX_Usable), __memmove_chk_avx_unaligned) @@ -84,7 +82,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memmove, HAS_ARCH_FEATURE (AVX_Usable), __memmove_avx_unaligned_erms) -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, memmove, HAS_ARCH_FEATURE (AVX512F_Usable), __memmove_avx512_no_vzeroupper) @@ -94,7 +91,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memmove, HAS_ARCH_FEATURE (AVX512F_Usable), __memmove_avx512_unaligned_erms) -#endif IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), __memmove_ssse3_back) IFUNC_IMPL_ADD (array, i, memmove, HAS_CPU_FEATURE (SSSE3), @@ -117,7 +113,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_ARCH_FEATURE (AVX2_Usable), __memset_chk_avx2_unaligned_erms) -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __memset_chk_avx512_unaligned_erms) @@ -127,7 +122,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, __memset_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __memset_chk_avx512_no_vzeroupper) -#endif ) /* Support sysdeps/x86_64/multiarch/memset.S. */ @@ -143,7 +137,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memset, HAS_ARCH_FEATURE (AVX2_Usable), __memset_avx2_unaligned_erms) -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, memset, HAS_ARCH_FEATURE (AVX512F_Usable), __memset_avx512_unaligned_erms) @@ -153,7 +146,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memset, HAS_ARCH_FEATURE (AVX512F_Usable), __memset_avx512_no_vzeroupper) -#endif ) /* Support sysdeps/x86_64/multiarch/stpncpy.S. */ @@ -311,7 +303,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, #ifdef SHARED /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */ IFUNC_IMPL (i, name, __memcpy_chk, -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __memcpy_chk_avx512_no_vzeroupper) @@ -321,7 +312,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __memcpy_chk_avx512_unaligned_erms) -#endif IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_ARCH_FEATURE (AVX_Usable), __memcpy_chk_avx_unaligned) @@ -351,7 +341,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, __memcpy_ssse3_back) IFUNC_IMPL_ADD (array, i, memcpy, HAS_CPU_FEATURE (SSSE3), __memcpy_ssse3) -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, memcpy, HAS_ARCH_FEATURE (AVX512F_Usable), __memcpy_avx512_no_vzeroupper) @@ -361,7 +350,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memcpy, HAS_ARCH_FEATURE (AVX512F_Usable), __memcpy_avx512_unaligned_erms) -#endif IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2_unaligned) IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2_unaligned_erms) @@ -369,7 +357,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */ IFUNC_IMPL (i, name, __mempcpy_chk, -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __mempcpy_chk_avx512_no_vzeroupper) @@ -379,7 +366,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_ARCH_FEATURE (AVX512F_Usable), __mempcpy_chk_avx512_unaligned_erms) -#endif IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_ARCH_FEATURE (AVX_Usable), __mempcpy_chk_avx_unaligned) @@ -399,7 +385,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, /* Support sysdeps/x86_64/multiarch/mempcpy.S. */ IFUNC_IMPL (i, name, mempcpy, -#ifdef HAVE_AVX512_ASM_SUPPORT IFUNC_IMPL_ADD (array, i, mempcpy, HAS_ARCH_FEATURE (AVX512F_Usable), __mempcpy_avx512_no_vzeroupper) @@ -409,7 +394,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, mempcpy, HAS_ARCH_FEATURE (AVX512F_Usable), __mempcpy_avx512_unaligned_erms) -#endif IFUNC_IMPL_ADD (array, i, mempcpy, HAS_ARCH_FEATURE (AVX_Usable), __mempcpy_avx_unaligned) diff --git a/sysdeps/x86_64/multiarch/memcpy.S b/sysdeps/x86_64/multiarch/memcpy.S index df7fbac..b867759 100644 --- a/sysdeps/x86_64/multiarch/memcpy.S +++ b/sysdeps/x86_64/multiarch/memcpy.S @@ -32,7 +32,6 @@ ENTRY(__new_memcpy) lea __memcpy_erms(%rip), %RAX_LP HAS_ARCH_FEATURE (Prefer_ERMS) jnz 2f -# ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 1f lea __memcpy_avx512_no_vzeroupper(%rip), %RAX_LP @@ -43,7 +42,6 @@ ENTRY(__new_memcpy) jnz 2f lea __memcpy_avx512_unaligned(%rip), %RAX_LP ret -# endif 1: lea __memcpy_avx_unaligned(%rip), %RAX_LP HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load) jz L(Fast_Unaligned_Load) diff --git a/sysdeps/x86_64/multiarch/memcpy_chk.S b/sysdeps/x86_64/multiarch/memcpy_chk.S index 11f1310..9d92c8a 100644 --- a/sysdeps/x86_64/multiarch/memcpy_chk.S +++ b/sysdeps/x86_64/multiarch/memcpy_chk.S @@ -30,7 +30,6 @@ ENTRY(__memcpy_chk) .type __memcpy_chk, @gnu_indirect_function LOAD_RTLD_GLOBAL_RO_RDX -# ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 1f lea __memcpy_chk_avx512_no_vzeroupper(%rip), %RAX_LP @@ -41,7 +40,6 @@ ENTRY(__memcpy_chk) jnz 2f lea __memcpy_chk_avx512_unaligned(%rip), %RAX_LP ret -# endif 1: lea __memcpy_chk_avx_unaligned(%rip), %RAX_LP HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load) jz L(Fast_Unaligned_Load) diff --git a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S index 5b8ff57..664b74d 100644 --- a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S +++ b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S @@ -18,7 +18,7 @@ #include <sysdep.h> -#if defined HAVE_AVX512_ASM_SUPPORT && IS_IN (libc) +#if IS_IN (libc) # include "asm-syntax.h" diff --git a/sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S index f9af6fd..aac1515 100644 --- a/sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memmove-avx512-unaligned-erms.S @@ -1,4 +1,4 @@ -#if defined HAVE_AVX512_ASM_SUPPORT && IS_IN (libc) +#if IS_IN (libc) # define VEC_SIZE 64 # define VEC(i) zmm##i # define VMOVNT vmovntdq diff --git a/sysdeps/x86_64/multiarch/memmove.S b/sysdeps/x86_64/multiarch/memmove.S index 8e1c6ac..ff5e041 100644 --- a/sysdeps/x86_64/multiarch/memmove.S +++ b/sysdeps/x86_64/multiarch/memmove.S @@ -30,7 +30,6 @@ ENTRY(__libc_memmove) lea __memmove_erms(%rip), %RAX_LP HAS_ARCH_FEATURE (Prefer_ERMS) jnz 2f -# ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 1f lea __memmove_avx512_no_vzeroupper(%rip), %RAX_LP @@ -41,7 +40,6 @@ ENTRY(__libc_memmove) jnz 2f lea __memmove_avx512_unaligned(%rip), %RAX_LP ret -# endif 1: lea __memmove_avx_unaligned(%rip), %RAX_LP HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load) jz L(Fast_Unaligned_Load) diff --git a/sysdeps/x86_64/multiarch/memmove_chk.S b/sysdeps/x86_64/multiarch/memmove_chk.S index cd639b8..7f86120 100644 --- a/sysdeps/x86_64/multiarch/memmove_chk.S +++ b/sysdeps/x86_64/multiarch/memmove_chk.S @@ -29,7 +29,6 @@ ENTRY(__memmove_chk) .type __memmove_chk, @gnu_indirect_function LOAD_RTLD_GLOBAL_RO_RDX -# ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 1f lea __memmove_chk_avx512_no_vzeroupper(%rip), %RAX_LP @@ -40,7 +39,6 @@ ENTRY(__memmove_chk) jnz 2f lea __memmove_chk_avx512_unaligned(%rip), %RAX_LP ret -# endif 1: lea __memmove_chk_avx_unaligned(%rip), %RAX_LP HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load) jz L(Fast_Unaligned_Load) diff --git a/sysdeps/x86_64/multiarch/mempcpy.S b/sysdeps/x86_64/multiarch/mempcpy.S index 4011a1a..5197068 100644 --- a/sysdeps/x86_64/multiarch/mempcpy.S +++ b/sysdeps/x86_64/multiarch/mempcpy.S @@ -32,7 +32,6 @@ ENTRY(__mempcpy) lea __mempcpy_erms(%rip), %RAX_LP HAS_ARCH_FEATURE (Prefer_ERMS) jnz 2f -# ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 1f lea __mempcpy_avx512_no_vzeroupper(%rip), %RAX_LP @@ -43,7 +42,6 @@ ENTRY(__mempcpy) jnz 2f lea __mempcpy_avx512_unaligned(%rip), %RAX_LP ret -# endif 1: lea __mempcpy_avx_unaligned(%rip), %RAX_LP HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load) jz L(Fast_Unaligned_Load) diff --git a/sysdeps/x86_64/multiarch/mempcpy_chk.S b/sysdeps/x86_64/multiarch/mempcpy_chk.S index 80f460f..9e49f6f 100644 --- a/sysdeps/x86_64/multiarch/mempcpy_chk.S +++ b/sysdeps/x86_64/multiarch/mempcpy_chk.S @@ -30,7 +30,6 @@ ENTRY(__mempcpy_chk) .type __mempcpy_chk, @gnu_indirect_function LOAD_RTLD_GLOBAL_RO_RDX -# ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 1f lea __mempcpy_chk_avx512_no_vzeroupper(%rip), %RAX_LP @@ -41,7 +40,6 @@ ENTRY(__mempcpy_chk) jnz 2f lea __mempcpy_chk_avx512_unaligned(%rip), %RAX_LP ret -# endif 1: lea __mempcpy_chk_avx_unaligned(%rip), %RAX_LP HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load) jz L(Fast_Unaligned_Load) diff --git a/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S index eab8c5a..9687df0 100644 --- a/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S +++ b/sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S @@ -18,7 +18,7 @@ #include <sysdep.h> -#if defined HAVE_AVX512_ASM_SUPPORT && IS_IN (libc) +#if IS_IN (libc) #include "asm-syntax.h" #ifndef MEMSET diff --git a/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S index f1b3cb2..a5ec349 100644 --- a/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memset-avx512-unaligned-erms.S @@ -1,4 +1,4 @@ -#if defined HAVE_AVX512_ASM_SUPPORT && IS_IN (libc) +#if IS_IN (libc) # define VEC_SIZE 64 # define VEC(i) zmm##i # define VMOVU vmovdqu64 diff --git a/sysdeps/x86_64/multiarch/memset.S b/sysdeps/x86_64/multiarch/memset.S index 2b964a0..96e9934 100644 --- a/sysdeps/x86_64/multiarch/memset.S +++ b/sysdeps/x86_64/multiarch/memset.S @@ -41,7 +41,6 @@ ENTRY(memset) jnz L(AVX512F) lea __memset_avx2_unaligned(%rip), %RAX_LP L(AVX512F): -# ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 2f lea __memset_avx512_no_vzeroupper(%rip), %RAX_LP @@ -51,7 +50,6 @@ L(AVX512F): HAS_CPU_FEATURE (ERMS) jnz 2f lea __memset_avx512_unaligned(%rip), %RAX_LP -# endif 2: ret END(memset) #endif diff --git a/sysdeps/x86_64/multiarch/memset_chk.S b/sysdeps/x86_64/multiarch/memset_chk.S index 8517cfc..2efe6ed 100644 --- a/sysdeps/x86_64/multiarch/memset_chk.S +++ b/sysdeps/x86_64/multiarch/memset_chk.S @@ -38,7 +38,6 @@ ENTRY(__memset_chk) jnz L(AVX512F) lea __memset_chk_avx2_unaligned(%rip), %RAX_LP L(AVX512F): -#ifdef HAVE_AVX512_ASM_SUPPORT HAS_ARCH_FEATURE (AVX512F_Usable) jz 2f lea __memset_chk_avx512_no_vzeroupper(%rip), %RAX_LP @@ -48,7 +47,6 @@ L(AVX512F): HAS_CPU_FEATURE (ERMS) jnz 2f lea __memset_chk_avx512_unaligned(%rip), %RAX_LP -#endif 2: ret END(__memset_chk) diff --git a/test-skeleton.c b/test-skeleton.c index d9bf989..5a90c65 100644 --- a/test-skeleton.c +++ b/test-skeleton.c @@ -346,8 +346,10 @@ main (int argc, char *argv[]) unsigned int timeoutfactor = 1; pid_t termpid; +#ifndef TEST_NO_MALLOPT /* Make uses of freed and uninitialized memory known. */ mallopt (M_PERTURB, 42); +#endif #ifdef STDOUT_UNBUFFERED setbuf (stdout, NULL); @@ -1,4 +1,4 @@ /* This file just defines the current version number of libc. */ #define RELEASE "development" -#define VERSION "2.23.90" +#define VERSION "2.24.90" diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index e413416..9686fcd 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -24,7 +24,8 @@ #if !defined __need_mbstate_t && !defined __need_wint_t # define _WCHAR_H 1 -# include <features.h> +# define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION +# include <bits/libc-header-start.h> #endif #ifdef _WCHAR_H @@ -574,10 +575,12 @@ extern wchar_t *wcpcpy (wchar_t *__restrict __dest, extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) __THROW; +#endif /* Wide character I/O functions. */ +#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces a wide character string. */ extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW; |