about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Add sysdeps/ieee754/soft-fp.Joseph Myers2017-12-1233-39/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default sysdeps/ieee754 fma implementations rely on exceptions and rounding modes to achieve correct results through internal use of round-to-odd. Thus, glibc configurations without support for exceptions and rounding modes instead need to use implementations of fma based on soft-fp. At present, this is achieved via having implementation files in soft-fp/ that are #included by sysdeps files for each glibc configuration that needs them. In general this means such a configuration has its own s_fma.c and s_fmaf.c. TS 18661-1 adds functions that do an operation (+ - * / sqrt fma) on arguments wider than the return type, with a single rounding of the infinite-precision result to that return type. These are also naturally implemented using round-to-odd on platforms with hardware support for rounding modes and exceptions but lacking hardware support for these narrowing operations themselves. (Platforms that have direct hardware support for such narrowing operations include at least ia64, and Power ISA 2.07 or later, which I think means POWER8 or later.) So adding the remaining TS 18661-1 functions would mean at least six narrowing function implementations (fadd fsub fmul fdiv ffma fsqrt), with aliases for other types and further implementations in some configurations, that need to be overridden for configurations lacking hardware exceptions and rounding modes. Requiring all such configurations (currently seven of them) to have their own source files for all those functions seems undesirable. Thus, this patch adds a directory sysdeps/ieee754/soft-fp to contain libm function implementations based on soft-fp. This directory is then used via Implies from all the configurations that need it, so no more files need adding to every such configuration when adding more functions with soft-fp implementations. A configuration can still selectively #include a particular file from this directory if desired; thus, the MIPS #include of the fmal implementation is retained, since that's appropriate even for hard float (because long double is always implementated in software for MIPS64, so the soft-fp implementation of fmal is better than the ldbl-128 one). This also provides additional motivation for my recent patch removing --with-fp / --without-fp: previously there was no need for correct use of --without-fp for no-FPU ARM or SH3, and now we have autodetection nofpu/ sysdeps directories can be used by this patch for those configurations without imposing any new requirements on how glibc is configured. (The mips64/*/fpu/s_fma.c files added by this patch are needed to keep the dbl-64 version of fma for double, rather than the ldbl-128 one, used in that case.) Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. * soft-fp/fmadf4.c: Move to .... * sysdeps/ieee754/soft-fp/s_fma.c: ... here. * soft-fp/fmasf4.c: Move to .... * sysdeps/ieee754/soft-fp/s_fmaf.c: ... here. * soft-fp/fmatf4.c: Move to .... * sysdeps/ieee754/soft-fp/s_fmal.c: ... here. * sysdeps/ieee754/soft-fp/Makefile: New file. * sysdeps/arm/preconfigure.ac: Define with_fp_cond. * sysdeps/arm/preconfigure: Regenerated. * sysdeps/arm/nofpu/Implies: New file. * sysdeps/arm/s_fma.c: Remove file. * sysdeps/arm/s_fmaf.c: Likewise. * sysdeps/m68k/coldfire/nofpu/Implies: New file. * sysdeps/m68k/coldfire/nofpu/s_fma.c: Remove file. * sysdeps/m68k/coldfire/nofpu/s_fmaf.c: Likewise. * sysdeps/microblaze/Implies: Add ieee754/soft-fp. * sysdeps/microblaze/s_fma.c: Remove file. * sysdeps/microblaze/s_fmaf.c: Likewise. * sysdeps/mips/mips32/nofpu/Implies: New file. * sysdeps/mips/mips64/n32/fpu/s_fma.c: Likewise. * sysdeps/mips/mips64/n32/nofpu/Implies: Likewise. * sysdeps/mips/mips64/n64/fpu/s_fma.c: Likewise. * sysdeps/mips/mips64/n64/nofpu/Implies: Likewise. * sysdeps/mips/ieee754/s_fma.c: Remove file. * sysdeps/mips/ieee754/s_fmaf.c: Likewise. * sysdeps/mips/ieee754/s_fmal.c: Update include for move of fmal implementation. * sysdeps/nios2/Implies: Add ieee754/soft-fp. * sysdeps/nios2/s_fma.c: Remove file. * sysdeps/nios2/s_fmaf.c: Likewise. * sysdeps/sh/nofpu/Implies: New file. * sysdeps/sh/s_fma.c: Remove file. * sysdeps/sh/s_fmaf.c: Likewise. * sysdeps/tile/Implies: Add ieee754/soft-fp. * sysdeps/tile/s_fma.c: Remove file. * sysdeps/tile/s_fmaf.c: Likewise.
* x86-64: Add cosf with FMAH.J. Lu2017-12-126-4/+47
| | | | | | | | | | | | | | | | | | On Skylake, bench-cosf reports performance improvement: Before After Improvement max 135.362 94.552 43% min 8.532 7.688 11% mean 17.1446 11.8128 45% * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_cosf-sse2 and s_cosf-fma. (CFLAGS-s_cosf-fma.c): New. * sysdeps/x86_64/fpu/multiarch/s_cosf-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/s_cosf-sse2.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_cosf.c: Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use memcpy instead of strncpy in nscd/nscd.h to fix build problem with ToT GCCSteve Ellcey2017-12-122-1/+5
| | | | * nscd/nscd.h (init_traced_file): Change strncpy to memcpy.
* libio: Free backup area when it not required (BZ#22415)Adhemerval Zanella2017-12-125-2/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some libio operations fail to correctly free the backup area (created by _IO_{w}default_pbackfail on unget{w}c) resulting in either invalid buffer free operations or memory leaks. For instance, on the example provided by BZ#22415 a following fputc after a fseek to rewind the stream issues an invalid free on the buffer. It is because although _IO_file_overflow correctly (from fputc) correctly calls _IO_free_backup_area, the _IO_new_file_seekoff (called by fseek) updates the FILE internal pointers without first free the backup area (resulting in invalid values in the internal pointers). The wide version also shows an issue, but instead of accessing invalid pointers it leaks the backup memory on fseek/fputwc operation. Checked on x86_64-linux-gnu and i686-linux-gnu. * libio/Makefile (tests): Add tst-bz22415. (tst-bz22415-ENV): New rule. (generated): Add tst-bz22415.mtrace and tst-bz22415.check. (tests-special): Add tst-bz22415-mem.out. ($(objpfx)tst-bz22415-mem.out): New rule. * libio/fileops.c (_IO_new_file_seekoff): Call _IO_free_backup_area in case of a successful seek operation. * libio/wfileops.c (_IO_wfile_seekoff): Likewise. (_IO_wfile_overflow): Call _IO_free_wbackup_area in case a write buffer is required. * libio/tst-bz22415.c: New test.
* Update IA64 libm-test-ulpsAdhemerval Zanella2017-12-122-26/+1918
| | | | | | | | Ran on Itanium Processor 9020, GCC 7.2.1. * sysdeps/ia64/fpu/libm-test-ulps: Update. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* ia64: Add ipc_priv.h header to set __IPC_64 to zeroJames Clarke2017-12-122-0/+26
| | | | | | | | | | | | When running strace, IPC_64 was set in the command, but ia64 is an architecture where CONFIG_ARCH_WANT_IPC_PARSE_VERSION *isn't* set in the kernel, so ipc_parse_version just returns IPC_64 without clearing the IPC_64 bit in the command. * sysdeps/unix/sysv/linux/ia64/ipc_priv.h: New file defining __IPC_64 to 0 to avoid IPC_64 being set. Signed-off-by: James Clarke <jrtc27@jrtc27.com>
* [BZ #22593] Fix nextafter and nexttoward declarationSzabolcs Nagy2017-12-122-2/+8
| | | | | | | | These functions set errno and thus the const attribute was wrong. [BZ #22593] * math/bits/mathcalls.h (nextafter): Remove const. (nexttoward): Likewise.
* Remove --with-fp / --without-fp.Joseph Myers2017-12-1212-66/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a configure option --without-fp that specifies that nofpu sysdeps directories should be used instead of fpu directories. For most glibc configurations, this option is of no use: either there is no valid nofpu variant of that configuration, or there are no fpu or nofpu sysdeps directories for that processor and so the option does nothing. For a few configurations, if you are using a soft-float compiler this option is required, and failing to use it generally results in compilation errors from inline asm using unavailable floating-point instructions. We're moving away from --with-cpu to configuring glibc based on how the compiler generates code, and it is natural to do so for --without-fp as well; in most cases the soft-float and hard-float ABIs are incompatible so you have no hope of building a working glibc with an inappropriately configured compiler or libgcc. This patch eliminates --without-fp, replacing it entirely by automatic configuration based on the compiler. Configurations for which this is relevant (coldfire / mips / powerpc32 / sh) define a variable with_fp_cond in their preconfigure fragments (under the same conditions under which those fragments do anything); this is a preprocessor conditional which the toplevel configure script then uses in a test to determine which sysdeps directories to use. The config.make with-fp variable remains. It's used only by powerpc (sysdeps/powerpc/powerpc32/Makefile) to add -mhard-float to various flags variables. For powerpc, -mcpu= options can imply use of soft-float. That could be an issue if you want to build for e.g. 476fp, but are using --with-cpu=476 because there isn't a 476fp sysdeps directory. If in future we eliminate --with-cpu and replace it entirely by testing the compiler, it would be natural at that point to eliminate that code as well (as the user should then just use a compiler defaulting to 476fp and the 476 sysdeps directory would be used automatically). Tested for x86_64, and tested with build-many-glibcs.py that installed shared libraries are unchanged by this patch. * configure.ac (--with-fp): Remove configure option. (with_fp_cond): New variable. (libc_cv_with_fp): New configure test. Use this variable instead of with_fp. * configure: Regenerated. * config.make.in (with-fp): Use @libc_cv_with_fp@. * manual/install.texi (Configuring and compiling): Remove --without-fp. * INSTALL: Regenerated. * sysdeps/m68k/preconfigure (with_fp_cond): Define for ColdFire. * sysdeps/mips/preconfigure (with_fp_cond): Define. * sysdeps/powerpc/preconfigure (with_fp_cond): Define for 32-bit. * sysdeps/sh/preconfigure (with_fp_cond): Define. * scripts/build-many-glibcs.py (Context.add_all_configs): Do not use --without-fp to configure glibc.
* manual: Fix a typo in locale.texi.Rical Jasan2017-12-122-1/+5
| | | | * manual/locale.texi (nl_langinfo): Fix a typo.
* manual/conf.texi: add a missing underscore in front of SC_SSIZE_MAX [BZ #22588]Aurelien Jarno2017-12-122-1/+6
| | | | | Changelog: * manual/conf.texi (SC_SSIZE_MAX): Rename into _SC_SSIZE_MAX.
* Replace = with += in CFLAGS-xxx.c/CPPFLAGS-xxx.cH.J. Lu2017-12-1134-496/+984
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace = with += in CFLAGS-xxx.c and CPPFLAGS-xxx.c to allow Makefile under sysdeps to define CFLAGS-xx.c and CPPFLAGS-xxx.c. * argp/Makefile (CFLAGS-argp-help.c): Replace = with +=. (CFLAGS-argp-parse.c): Likewise. (CFLAGS-argp-fmtstream.c): Likewise. * crypt/Makefile (CPPFLAGS-sha256-crypt.c): Likewise. (CPPFLAGS-sha512-crypt.c): Likewise. (CPPFLAGS-md5-crypt.c): Likewise. * debug/Makefile (CFLAGS-stack_chk_fail.c): Likewise. (CFLAGS-stack_chk_fail_local.c): Likewise. (CFLAGS-backtrace.c): Likewise. (CFLAGS-sprintf_chk.c): Likewise. (CFLAGS-snprintf_chk.c): Likewise. (CFLAGS-vsprintf_chk.c): Likewise. (CFLAGS-vsnprintf_chk.c): Likewise. (CFLAGS-asprintf_chk.c): Likewise. (CFLAGS-vasprintf_chk.c): Likewise. (CFLAGS-obprintf_chk.c): Likewise. (CFLAGS-dprintf_chk.c): Likewise. (CFLAGS-vdprintf_chk.c): Likewise. (CFLAGS-printf_chk.c): Likewise. (CFLAGS-fprintf_chk.c): Likewise. (CFLAGS-vprintf_chk.c): Likewise. (CFLAGS-vfprintf_chk.c): Likewise. (CFLAGS-gets_chk.c): Likewise. (CFLAGS-fgets_chk.c): Likewise. (CFLAGS-fgets_u_chk.c): Likewise. (CFLAGS-fread_chk.c): Likewise. (CFLAGS-fread_u_chk.c): Likewise. (CFLAGS-swprintf_chk.c): Likewise. (CFLAGS-vswprintf_chk.c): Likewise. (CFLAGS-wprintf_chk.c): Likewise. (CFLAGS-fwprintf_chk.c): Likewise. (CFLAGS-vwprintf_chk.c): Likewise. (CFLAGS-vfwprintf_chk.c): Likewise. (CFLAGS-fgetws_chk.c): Likewise. (CFLAGS-fgetws_u_chk.c): Likewise. (CFLAGS-read_chk.c): Likewise. (CFLAGS-pread_chk.c): Likewise. (CFLAGS-pread64_chk.c): Likewise. (CFLAGS-recv_chk.c): Likewise. (CFLAGS-recvfrom_chk.c): Likewise. (CFLAGS-tst-longjmp_chk.c): Likewise. (CPPFLAGS-tst-longjmp_chk.c): Likewise. (CFLAGS-tst-longjmp_chk2.c): Likewise. (CPPFLAGS-tst-longjmp_chk2.c): Likewise. (CFLAGS-tst-longjmp_chk3.c): Likewise. (CPPFLAGS-tst-longjmp_chk3.c): Likewise. (CFLAGS-tst-chk1.c): Likewise. (CFLAGS-tst-chk2.c): Likewise. (CFLAGS-tst-chk3.c): Likewise. (CFLAGS-tst-chk4.cc): Likewise. (CFLAGS-tst-chk5.cc): Likewise. (CFLAGS-tst-chk6.cc): Likewise. (CFLAGS-tst-lfschk1.c): Likewise. (CFLAGS-tst-lfschk2.c): Likewise. (CFLAGS-tst-lfschk3.c): Likewise. (CFLAGS-tst-lfschk4.cc): Likewise. (CFLAGS-tst-lfschk5.cc): Likewise. (CFLAGS-tst-lfschk6.cc): Likewise. (CFLAGS-tst-ssp-1.c): Likewise. * dirent/Makefile (CFLAGS-scandir.c): Likewise. (CFLAGS-scandir64.c): Likewise. (CFLAGS-scandir-tail.c): Likewise. (CFLAGS-scandir64-tail.c): Likewise. * elf/Makefile (CPPFLAGS-dl-tunables.c): Likewise. (CFLAGS-dl-tunables.c): Likewise. (CFLAGS-dl-runtime.c): Likewise. (CFLAGS-dl-lookup.c): Likewise. (CFLAGS-dl-iterate-phdr.c): Likewise. (CFLAGS-vismain.c): Likewise. (CFLAGS-tst-linkall-static.c): Likewise. (CFLAGS-tst-linkall-static.c): Likewise. (CPPFLAGS-dl-load.c): Likewise. (CFLAGS-ldconfig.c): Likewise. (CFLAGS-dl-cache.c): Likewise. (CFLAGS-cache.c): Likewise. (CFLAGS-rtld.c): Likewise. (CFLAGS-multiload.c): Likewise. (CFLAGS-filtmod1.c): Likewise. (CFLAGS-tst-align.c): Likewise. (CFLAGS-tst-align2.c): Likewise. (CFLAGS-tst-alignmod.c): Likewise. (CFLAGS-tst-alignmod2.c): Likewise. (CPPFLAGS-tst-execstack.c): Likewise. (CFLAGS-tst-ptrguard1-static.c): Likewise. (CFLAGS-tst-latepthreadmod.c): Likewise. * grp/Makefile (CFLAGS-getgrgid_r.c): Likewise. (CFLAGS-getgrnam_r.c): Likewise. (CFLAGS-getgrent_r.c): Likewise. (CFLAGS-getgrent.c): Likewise. (CFLAGS-fgetgrent.c): Likewise. (CFLAGS-fgetgrent_r.c): Likewise. (CFLAGS-putgrent.c): Likewise. (CFLAGS-initgroups.c): Likewise. (CFLAGS-getgrgid.c): Likewise. * gshadow/Makefile (CFLAGS-getsgent_r.c): Likewise. (CFLAGS-getsgent.c): Likewise. (CFLAGS-fgetsgent.c): Likewise. (CFLAGS-fgetsgent_r.c): Likewise. (CFLAGS-putsgent.c): Likewise. (CFLAGS-getsgnam.c): Likewise. (CFLAGS-getsgnam_r.c): Likewise. * iconv/Makefile (CFLAGS-iconv_prog.c): Likewise. (CFLAGS-iconv_charmap.c): Likewise. (CFLAGS-dummy-repertoire.c): Likewise. (CFLAGS-charmap.c): Likewise. (CFLAGS-linereader.c): Likewise. (CFLAGS-simple-hash.c): Likewise. (CFLAGS-gconv_conf.c): Likewise. (CFLAGS-iconvconfig.c): Likewise. * inet/Makefile (CFLAGS-gethstbyad_r.c): Likewise. (CFLAGS-gethstbyad.c): Likewise. (CFLAGS-gethstbynm_r.c): Likewise. (CFLAGS-gethstbynm.c): Likewise. (CFLAGS-gethstbynm2_r.c): Likewise. (CFLAGS-gethstbynm2.c): Likewise. (CFLAGS-gethstent_r.c): Likewise. (CFLAGS-gethstent.c): Likewise. (CFLAGS-rcmd.c): Likewise. (CFLAGS-getnetbynm_r.c): Likewise. (CFLAGS-getnetbynm.c): Likewise. (CFLAGS-getnetbyad_r.c): Likewise. (CFLAGS-getnetbyad.c): Likewise. (CFLAGS-getnetent_r.c): Likewise. (CFLAGS-getnetent.c): Likewise. (CFLAGS-getaliasent_r.c): Likewise. (CFLAGS-getaliasent.c): Likewise. (CFLAGS-getrpcent_r.c): Likewise. (CFLAGS-getrpcent.c): Likewise. (CFLAGS-getservent_r.c): Likewise. (CFLAGS-getservent.c): Likewise. (CFLAGS-getprtent_r.c): Likewise. (CFLAGS-getprtent.c): Likewise. (CFLAGS-either_ntoh.c): Likewise. (CFLAGS-either_hton.c): Likewise. (CFLAGS-getnetgrent.c): Likewise. (CFLAGS-getnetgrent_r.c): Likewise. (CFLAGS-tst-checks-posix.c): Likewise. (CFLAGS-tst-sockaddr.c): Likewise. * intl/Makefile (CFLAGS-tst-gettext.c): Likewise. (CFLAGS-tst-translit.c): Likewise. (CFLAGS-tst-gettext2.c): Likewise. (CFLAGS-tst-codeset.c): Likewise. (CFLAGS-tst-gettext3.c): Likewise. (CFLAGS-tst-gettext4.c): Likewise. (CFLAGS-tst-gettext5.c): Likewise. (CFLAGS-tst-gettext6.c): Likewise. * io/Makefile (CFLAGS-open.c): Likewise. (CFLAGS-open64.c): Likewise. (CFLAGS-creat.c): Likewise. (CFLAGS-creat64.c): Likewise. (CFLAGS-fcntl.c): Likewise. (CFLAGS-poll.c): Likewise. (CFLAGS-ppoll.c): Likewise. (CFLAGS-lockf.c): Likewise. (CFLAGS-statfs.c): Likewise. (CFLAGS-fstatfs.c): Likewise. (CFLAGS-statvfs.c): Likewise. (CFLAGS-fstatvfs.c): Likewise. (CFLAGS-fts.c): Likewise. (CFLAGS-fts64.c): Likewise. (CFLAGS-ftw.c): Likewise. (CFLAGS-ftw64.c): Likewise. (CFLAGS-lockf.c): Likewise. (CFLAGS-posix_fallocate.c): Likewise. (CFLAGS-posix_fallocate64.c): Likewise. (CFLAGS-fallocate.c): Likewise. (CFLAGS-fallocate64.c): Likewise. (CFLAGS-read.c): Likewise. (CFLAGS-write.c): Likewise. (CFLAGS-test-stat.c): Likewise. (CFLAGS-test-lfs.c): Likewise. * libio/Makefile (CFLAGS-fileops.c): Likewise. (CFLAGS-fputc.c): Likewise. (CFLAGS-fputwc.c): Likewise. (CFLAGS-freopen64.c): Likewise. (CFLAGS-freopen.c): Likewise. (CFLAGS-fseek.c): Likewise. (CFLAGS-fseeko64.c): Likewise. (CFLAGS-fseeko.c): Likewise. (CFLAGS-ftello64.c): Likewise. (CFLAGS-ftello.c): Likewise. (CFLAGS-fwide.c): Likewise. (CFLAGS-genops.c): Likewise. (CFLAGS-getc.c): Likewise. (CFLAGS-getchar.c): Likewise. (CFLAGS-getwc.c): Likewise. (CFLAGS-getwchar.c): Likewise. (CFLAGS-iofclose.c): Likewise. (CFLAGS-iofflush.c): Likewise. (CFLAGS-iofgetpos64.c): Likewise. (CFLAGS-iofgetpos.c): Likewise. (CFLAGS-iofgets.c): Likewise. (CFLAGS-iofgetws.c): Likewise. (CFLAGS-iofputs.c): Likewise. (CFLAGS-iofputws.c): Likewise. (CFLAGS-iofread.c): Likewise. (CFLAGS-iofsetpos64.c): Likewise. (CFLAGS-iofsetpos.c): Likewise. (CFLAGS-ioftell.c): Likewise. (CFLAGS-iofwrite.c): Likewise. (CFLAGS-iogetdelim.c): Likewise. (CFLAGS-iogetline.c): Likewise. (CFLAGS-iogets.c): Likewise. (CFLAGS-iogetwline.c): Likewise. (CFLAGS-ioputs.c): Likewise. (CFLAGS-ioseekoff.c): Likewise. (CFLAGS-ioseekpos.c): Likewise. (CFLAGS-iosetbuffer.c): Likewise. (CFLAGS-iosetvbuf.c): Likewise. (CFLAGS-ioungetc.c): Likewise. (CFLAGS-ioungetwc.c): Likewise. (CFLAGS-oldfileops.c): Likewise. (CFLAGS-oldiofclose.c): Likewise. (CFLAGS-oldiofgetpos64.c): Likewise. (CFLAGS-oldiofgetpos.c): Likewise. (CFLAGS-oldiofsetpos64.c): Likewise. (CFLAGS-oldiofsetpos.c): Likewise. (CFLAGS-peekc.c): Likewise. (CFLAGS-putc.c): Likewise. (CFLAGS-putchar.c): Likewise. (CFLAGS-putwc.c): Likewise. (CFLAGS-putwchar.c): Likewise. (CFLAGS-rewind.c): Likewise. (CFLAGS-wfileops.c): Likewise. (CFLAGS-wgenops.c): Likewise. (CFLAGS-oldiofopen.c): Likewise. (CFLAGS-iofopen.c): Likewise. (CFLAGS-iofopen64.c): Likewise. (CFLAGS-oldtmpfile.c): Likewise. (CFLAGS-tst_putwc.c): Likewise. * locale/Makefile (CFLAGS-md5.c): Likewise. (CFLAGS-charmap.c): Likewise. (CFLAGS-locfile.c): Likewise. (CFLAGS-charmap-dir.c): Likewise. * login/Makefile (CFLAGS-grantpt.c): Likewise. (CFLAGS-getpt.c): Likewise. (CFLAGS-pt_chown.c): Likewise. * malloc/Makefile (CFLAGS-mcheck-init.c): Likewise. (CFLAGS-obstack.c): Likewise. * math/Makefile (CFLAGS-test-tgmath3.c): Likewise. (CFLAGS-test-double-vlen4-wrappers.c): Likewise. (CFLAGS-test-double-vlen8-wrappers.c): Likewise. (CFLAGS-test-float-vlen8-wrappers.c): Likewise. (CFLAGS-test-float-vlen16-wrappers.c): Likewise. (CFLAGS-test-tgmath.c): Likewise. (CFLAGS-test-tgmath2.c): Likewise. (CFLAGS-test-tgmath-ret.c): Likewise. (CFLAGS-test-powl.c): Likewise. (CFLAGS-test-snan.c): Likewise. (CFLAGS-test-signgam-finite.c): Likewise. (CFLAGS-test-signgam-finite-c99.c): Likewise. (CFLAGS-test-signgam-finite-c11.c): Likewise. (CFLAGS-test-signgam-uchar.c): Likewise. (CFLAGS-test-signgam-uchar-init.c): Likewise. (CFLAGS-test-signgam-uchar-static.c): Likewise. (CFLAGS-test-signgam-uchar-init-static.c): Likewise. (CFLAGS-test-signgam-uint.c): Likewise. (CFLAGS-test-signgam-uint-init.c): Likewise. (CFLAGS-test-signgam-uint-static.c): Likewise. (CFLAGS-test-signgam-uint-init-static.c): Likewise. (CFLAGS-test-signgam-ullong.c): Likewise. (CFLAGS-test-signgam-ullong-init.c): Likewise. (CFLAGS-test-signgam-ullong-static.c): Likewise. (CFLAGS-test-signgam-ullong-init-static.c): Likewise. (CFLAGS-test-math-cxx11.cc): Likewise. (CFLAGS-test-math-isinff.cc): Likewise. (CFLAGS-test-math-iszero.cc): Likewise. (CFLAGS-test-math-issignaling.cc): Likewise. (CFLAGS-test-math-iscanonical.cc): Likewise. (CFLAGS-test-iszero-excess-precision.c): Likewise. (CFLAGS-test-iseqsig-excess-precision.c): Likewise. (CFLAGS-test-flt-eval-method.c): Likewise. (CFLAGS-test-fe-snans-always-signal.c): Likewise. (CFLAGS-test-finite-macros.c): Likewise. * misc/Makefile (CFLAGS-select.c): Likewise. (CFLAGS-tsearch.c): Likewise. (CFLAGS-lsearch.c): Likewise. (CFLAGS-pselect.c): Likewise. (CFLAGS-readv.c): Likewise. (CFLAGS-writev.c): Likewise. (CFLAGS-preadv.c): Likewise. (CFLAGS-preadv64.c): Likewise. (CFLAGS-pwritev.c): Likewise. (CFLAGS-pwritev64.c): Likewise. (CFLAGS-preadv2.c): Likewise. (CFLAGS-preadv64v2.c): Likewise. (CFLAGS-pwritev2.c): Likewise. (CFLAGS-pwritev64v2.c): Likewise. (CFLAGS-usleep.c): Likewise. (CFLAGS-syslog.c): Likewise. (CFLAGS-error.c): Likewise. (CFLAGS-getpass.c): Likewise. (CFLAGS-mkstemp.c): Likewise. (CFLAGS-mkstemp64.c): Likewise. (CFLAGS-getsysstats.c): Likewise. (CFLAGS-getusershell.c): Likewise. (CFLAGS-err.c): Likewise. (CFLAGS-tst-tsearch.c): Likewise. (CFLAGS-msync.c): Likewise. (CFLAGS-fdatasync.c): Likewise. (CFLAGS-fsync.c): Likewise. * nptl/Makefile (CFLAGS-nptl-init.c): Likewise. (CFLAGS-unwind.c): Likewise. (CFLAGS-unwind-forcedunwind.c): Likewise. (CFLAGS-pthread_cancel.c): Likewise. (CFLAGS-pthread_setcancelstate.c): Likewise. (CFLAGS-pthread_setcanceltype.c): Likewise. (CFLAGS-cancellation.c): Likewise. (CFLAGS-libc-cancellation.c): Likewise. (CFLAGS-pthread_exit.c): Likewise. (CFLAGS-forward.c): Likewise. (CFLAGS-pthread_testcancel.c): Likewise. (CFLAGS-pthread_join.c): Likewise. (CFLAGS-pthread_timedjoin.c): Likewise. (CFLAGS-pthread_once.c): Likewise. (CFLAGS-pthread_cond_wait.c): Likewise. (CFLAGS-sem_wait.c): Likewise. (CFLAGS-sem_timedwait.c): Likewise. (CFLAGS-fcntl.c): Likewise. (CFLAGS-lockf.c): Likewise. (CFLAGS-pread.c): Likewise. (CFLAGS-pread64.c): Likewise. (CFLAGS-pwrite.c): Likewise. (CFLAGS-pwrite64.c): Likewise. (CFLAGS-wait.c): Likewise. (CFLAGS-waitpid.c): Likewise. (CFLAGS-sigwait.c): Likewise. (CFLAGS-msgrcv.c): Likewise. (CFLAGS-msgsnd.c): Likewise. (CFLAGS-tcdrain.c): Likewise. (CFLAGS-open.c): Likewise. (CFLAGS-open64.c): Likewise. (CFLAGS-pause.c): Likewise. (CFLAGS-recv.c): Likewise. (CFLAGS-send.c): Likewise. (CFLAGS-accept.c): Likewise. (CFLAGS-sendto.c): Likewise. (CFLAGS-connect.c): Likewise. (CFLAGS-recvfrom.c): Likewise. (CFLAGS-recvmsg.c): Likewise. (CFLAGS-sendmsg.c): Likewise. (CFLAGS-close.c): Likewise. (CFLAGS-read.c): Likewise. (CFLAGS-write.c): Likewise. (CFLAGS-nanosleep.c): Likewise. (CFLAGS-sigsuspend.c): Likewise. (CFLAGS-msync.c): Likewise. (CFLAGS-fdatasync.c): Likewise. (CFLAGS-fsync.c): Likewise. (CFLAGS-pt-system.c): Likewise. (CFLAGS-tst-cleanup2.c): Likewise. (CFLAGS-tst-cleanupx2.c): Likewise. (CFLAGS-flockfile.c): Likewise. (CFLAGS-ftrylockfile.c): Likewise. (CFLAGS-funlockfile.c): Likewise. (CFLAGS-tst-initializers1.c): Likewise. (CFLAGS-tst-initializers1-c89.c): Likewise. (CFLAGS-tst-initializers1-c99.c): Likewise. (CFLAGS-tst-initializers1-c11.c): Likewise. (CFLAGS-tst-initializers1-gnu89.c): Likewise. (CFLAGS-tst-initializers1-gnu99.c): Likewise. (CFLAGS-tst-initializers1-gnu11.c): Likewise. * nscd/Makefile (CFLAGS-nscd_getpw_r.c): Likewise. (CFLAGS-nscd_getgr_r.c): Likewise. (CFLAGS-nscd_gethst_r.c): Likewise. (CFLAGS-nscd_getai.c): Likewise. (CFLAGS-nscd_initgroups.c): Likewise. * posix/Makefile (CFLAGS-getaddrinfo.c): Likewise. (CFLAGS-pause.c): Likewise. (CFLAGS-pread.c): Likewise. (CFLAGS-pread64.c): Likewise. (CFLAGS-pwrite.c): Likewise. (CFLAGS-pwrite64.c): Likewise. (CFLAGS-sleep.c): Likewise. (CFLAGS-wait.c): Likewise. (CFLAGS-waitid.c): Likewise. (CFLAGS-waitpid.c): Likewise. (CFLAGS-getopt.c): Likewise. (CFLAGS-wordexp.c): Likewise. (CFLAGS-sysconf.c): Likewise. (CFLAGS-pathconf.c): Likewise. (CFLAGS-fpathconf.c): Likewise. (CFLAGS-spawn.c): Likewise. (CFLAGS-spawnp.c): Likewise. (CFLAGS-spawni.c): Likewise. (CFLAGS-glob.c): Likewise. (CFLAGS-glob64.c): Likewise. (CFLAGS-getconf.c): Likewise. (CFLAGS-nanosleep.c): Likewise. * pwd/Makefile (CFLAGS-getpwent_r.c): Likewise. (CFLAGS-getpwent.c): Likewise. (CFLAGS-getpw.c): Likewise. (CFLAGS-fgetpwent_r.c): Likewise. * resolv/Makefile (CFLAGS-res_hconf.c): Likewise. * rt/Makefile (CFLAGS-aio_suspend.c): Likewise. (CFLAGS-mq_timedreceive.c): Likewise. (CFLAGS-mq_timedsend.c): Likewise. (CFLAGS-clock_nanosleep.c): Likewise. (CFLAGS-librt-cancellation.c): Likewise. * shadow/Makefile (CFLAGS-getspent_r.c): Likewise. (CFLAGS-getspent.c): Likewise. (CFLAGS-fgetspent.c): Likewise. (CFLAGS-fgetspent_r.c): Likewise. (CFLAGS-putspent.c): Likewise. (CFLAGS-getspnam.c): Likewise. (CFLAGS-getspnam_r.c): Likewise. * signal/Makefile (CFLAGS-sigpause.c): Likewise. (CFLAGS-sigsuspend.c): Likewise. (CFLAGS-sigtimedwait.c): Likewise. (CFLAGS-sigwait.c): Likewise. (CFLAGS-sigwaitinfo.c): Likewise. (CFLAGS-sigreturn.c): Likewise. * stdio-common/Makefile (CFLAGS-vfprintf.c): Likewise. (CFLAGS-vfwprintf.c): Likewise. (CFLAGS-tmpfile.c): Likewise. (CFLAGS-tmpfile64.c): Likewise. (CFLAGS-tempname.c): Likewise. (CFLAGS-psignal.c): Likewise. (CFLAGS-vprintf.c): Likewise. (CFLAGS-cuserid.c): Likewise. (CFLAGS-errlist.c): Likewise. (CFLAGS-siglist.c): Likewise. (CFLAGS-scanf15.c): Likewise. (CFLAGS-scanf17.c): Likewise. * stdlib/Makefile (CFLAGS-bsearch.c): Likewise. (CFLAGS-msort.c): Likewise. (CFLAGS-qsort.c): Likewise. (CFLAGS-system.c): Likewise. (CFLAGS-fmtmsg.c): Likewise. (CFLAGS-strfmon.c): Likewise. (CFLAGS-strfmon_l.c): Likewise. (CFLAGS-strfromd.c): Likewise. (CFLAGS-strfromf.c): Likewise. (CFLAGS-strfroml.c): Likewise. (CFLAGS-tst-bsearch.c): Likewise. (CFLAGS-tst-qsort.c): Likewise. (CFLAGS-tst-makecontext2.c): Likewise. * sunrpc/Makefile (CFLAGS-xbootparam_prot.c): Likewise. (CFLAGS-xnlm_prot.c): Likewise. (CFLAGS-xrstat.c): Likewise. (CFLAGS-xyppasswd.c): Likewise. (CFLAGS-xklm_prot.c): Likewise. (CFLAGS-xrex.c): Likewise. (CFLAGS-xsm_inter.c): Likewise. (CFLAGS-xmount.c): Likewise. (CFLAGS-xrusers.c): Likewise. (CFLAGS-xspray.c): Likewise. (CFLAGS-xnfs_prot.c): Likewise. (CFLAGS-xrquota.c): Likewise. (CFLAGS-xkey_prot.c): Likewise. (CFLAGS-auth_unix.c): Likewise. (CFLAGS-key_call.c): Likewise. (CFLAGS-pmap_rmt.c): Likewise. (CFLAGS-clnt_perr.c): Likewise. (CFLAGS-openchild.c): Likewise. * sysvipc/Makefile (CFLAGS-msgrcv.c): Likewise. (CFLAGS-msgsnd.c): Likewise. * termios/Makefile (CFLAGS-tcdrain.c): Likewise. * time/Makefile (CFLAGS-tzfile.c): Likewise. (CFLAGS-tzset.c): Likewise. (CFLAGS-getdate.c): Likewise. (CFLAGS-test_time.c): Likewise. (CPPFLAGS-tst-tzname.c): Likewise. * timezone/Makefile (CFLAGS-zdump.c): Likewise. (CFLAGS-zic.c): Likewise. * wcsmbs/Makefile (CFLAGS-wcwidth.c): Likewise. (CFLAGS-wcswidth.c): Likewise. (CFLAGS-wcstol.c): Likewise. (CFLAGS-wcstoul.c): Likewise. (CFLAGS-wcstoll.c): Likewise. (CFLAGS-wcstoull.c): Likewise. (CFLAGS-wcstod.c): Likewise. (CFLAGS-wcstold.c): Likewise. (CFLAGS-wcstof128.c): Likewise. (CFLAGS-wcstof.c): Likewise. (CFLAGS-wcstol_l.c): Likewise. (CFLAGS-wcstoul_l.c): Likewise. (CFLAGS-wcstoll_l.c): Likewise. (CFLAGS-wcstoull_l.c): Likewise. (CFLAGS-wcstod_l.c): Likewise. (CFLAGS-wcstold_l.c): Likewise. (CFLAGS-wcstof128_l.c): Likewise. (CFLAGS-wcstof_l.c): Likewise. (CPPFLAGS-tst-wchar-h.c): Likewise. (CPPFLAGS-wcstold_l.c): Likewise. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
* New generic cosfPaul Clarke2017-12-112-40/+218
| | | | | | | | The same logic used in s_cosf.S version for x86 and powerpc is used to create a generic s_cosf.c, so there is no performance improvement in x86_64 and powerpc64. * sysdeps/ieee754/flt-32/s_cosf.c: New implementation.
* powerpc: POWER8 memcpy optimization for cached memoryAdhemerval Zanella2017-12-1113-13/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On POWER8, unaligned memory accesses to cached memory has little impact on performance as opposed to its ancestors. It is disabled by default and will only be available when the tunable glibc.tune.cached_memopt is set to 1. __memcpy_power8_cached __memcpy_power7 ============================================================ max-size=4096: 33325.70 ( 12.65%) 38153.00 max-size=8192: 32878.20 ( 11.17%) 37012.30 max-size=16384: 33782.20 ( 11.61%) 38219.20 max-size=32768: 33296.20 ( 11.30%) 37538.30 max-size=65536: 33765.60 ( 10.53%) 37738.40 * manual/tunables.texi (Hardware Capability Tunables): Document glibc.tune.cached_memopt. * sysdeps/powerpc/cpu-features.c: New file. * sysdeps/powerpc/cpu-features.h: New file. * sysdeps/powerpc/dl-procinfo.c [!IS_IN(ldconfig)]: Add _dl_powerpc_cpu_features. * sysdeps/powerpc/dl-tunables.list: New file. * sysdeps/powerpc/ldsodefs.h: Include cpu-features.h. * sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h (INIT_ARCH): Initialize use_aligned_memopt. * sysdeps/powerpc/powerpc64/dl-machine.h [defined(SHARED && IS_IN(rtld))]: Restrict dl_platform_init availability and initialize CPU features used by tunables. * sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines): Add memcpy-power8-cached. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Add __memcpy_power8_cached. * sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S: New file. Reviewed-by: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
* string: Replace = with += in CFLAGS-xxx.cH.J. Lu2017-12-112-9/+21
| | | | | | | | | | | | | | | Replace = with += in CFLAGS-xxx.c to allow Makefile under sysdeps to define CFLAGS-xx.c. * string/Makefile (CFLAGS-inl-tester.c): Replace = with +=. (CFLAGS-noinl-tester.c): Likewise. (CFLAGS-tst-strlen.c): Likewise. (CFLAGS-stratcliff.c): Likewise. (CFLAGS-test-ffs.c): Likewise. (CFLAGS-tst-inlcall.c): Likewise. (CFLAGS-tst-xbzero-opt.c): Likewise. (CFLAGS-memcpy.c): Likewise. (CFLAGS-wordcopy.c): Likewise.
* S390: Add CFI rule in _dl_runtime_resolve[_vx] for unwinding.Stefan Liebler2017-12-113-25/+30
| | | | | | | | | | | | | | | | | | | In _dl_runtime_resolve[_vx], unwinding fails after the new stack frame is created as there is no CFI rule for r15. This is also observeable in GDB: Backtrace stopped: previous frame inner to this frame (corrupt stack?) Therefore this patch is now storing r15 on stack and is using cfi_offset rule. The stmg/lmg instruction is used to store/load r14 and r15 with one instruction. On 64bit, the offsets of the fprs have moved to store r15 directly after r14. On 31bit, the r14/r15 is now stored between the other gprs and fprs as the space wasn't used. ChangeLog: * sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_resolve): Store r15 on stack and add cfi rule. * sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_resolve): Likewise.
* elf/rtld.c (init_tls): Add missing new line to the _dl_fatal_printf call [BZ ↵Aurelien Jarno2017-12-102-1/+7
| | | | | | | | #22577] Changelog: * elf/rtld.c (init_tls): Add missing new line to the _dl_fatal_printf call.
* x86-64: Add sinf with FMAH.J. Lu2017-12-076-3/+47
| | | | | | | | | | | | | | | | On Skylake, bench-sinf reports performance improvement: Before After Improvement max 153.996 100.094 54% min 8.546 6.852 25% mean 18.1223 11.802 54% * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines): Add s_sinf-sse2 and s_sinf-fma. (CFLAGS-s_sinf-fma.c): New. * sysdeps/x86_64/fpu/multiarch/s_sinf-fma.c: New file. * sysdeps/x86_64/fpu/multiarch/s_sinf-sse2.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_sinf.c: Likewise.
* x86-64: Remove sysdeps/x86_64/fpu/s_sinf.SH.J. Lu2017-12-072-559/+4
| | | | | | | | | | | On Ivy Bridge, bench-sinf reports performance improvement: s_sinf.S s_sinf.c Improvement max 91.521 86.148 6% min 14.061 11.265 25% mean 23.3758 23.3344 0.2% * sysdeps/x86_64/fpu/s_sinf.S: Removed.
* Fix ctanh (0 + i NaN), ctanh (0 + i Inf) (bug 22568, DR#471).Joseph Myers2017-12-075-14/+30
| | | | | | | | | | | | | | | | | | | As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should return 0 + i NaN (with "invalid" exception in the second case but not the first), not NaN + i NaN. This has corresponding implications for ctan since its special cases are defined by ctan (z) = -i ctanh (iz). This patch implements these cases for ctanh and ctan, updating tests accordingly. Tested for x86_64. [BZ #22568] * math/s_ctan_template.c (M_DECL_FUNC (__ctan)): Set imaginary part of result to imaginary part of argument if it is zero and the real part of the argument is not finite. * math/s_ctanh_template.c (M_DECL_FUNC (__ctanh)): Set real part of result to real part of argument if it is zero and the imaginary part of the argument is not finite.
* lt_LT locale: Base collation on copy "iso14651_t1" [BZ #22524]Mike FABIAN2017-12-074-2061/+139
| | | | | | | | | [BZ #22524] * localedata/Makefile: Add lt_LT.UTF-8 to test-input and to the list of locales to be built for testing. * localedata/lt_LT.UTF-8.in: New file for testing the collation. * localedata/locales/lt_LT (LC_COLLATE): Use “copy "iso14651_t1"” and build the collation rules upon that.
* Add _Float32 function aliases.Joseph Myers2017-12-0764-122/+3052
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch concludes filling out TS 18661-3 support for different types by adding *f32 function aliases of float functions to support _Float32. As with _Float64 and _Float32x, this is supported for all glibc configurations. As with the previous such patches there are some x86 ulps updates because of inline functions present for float but not for _Float32. The patch also has the usual bits/floatn-common.h update, symbol versions, ABI baselines updates, test enablement and documentation. Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * bits/floatn-common.h (__HAVE_FLOAT32): Define to 1. * manual/math.texi (Mathematics): Document support for _Float32. * math/Makefile (test-types): Add float32. * math/Versions (GLIBC_2.27): Add _Float32 functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* Support defining strtof32, wcstof32 aliases.Joseph Myers2017-12-063-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for defining strtof32, wcstof32, strtof32_l and wcstof32_l functions as aliases of the corresponding float functions when _Float32 support is enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float32 changes. * stdlib/strtof.c: Include <bits/floatn.h> [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * stdlib/strtof_l.c: Include <bits/floatn.h> [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR].
* Support defining strfromf32 alias.Joseph Myers2017-12-062-0/+20
| | | | | | | | | | | | This patch adds support for defining strfromf32 as an alias of strfromf when _Float32 support is enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float32 changes. * stdlib/strfromf.c: Include <bits/floatn.h>. [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strfromf32): Define and later undefine as macro and define as weak alias.
* Add header for _Float32 testing.Joseph Myers2017-12-062-0/+39
| | | | | | | | | | | This patch adds the header required for testing _Float32 function aliases, using float ulps. The corresponding makefile support will be included in the main patch that enables those aliases. In conjunction with other _Float32 changes, tested for x86_64 and with build-many-glibcs.py. * math/test-float32.h: New file.
* Support _Float32 in libm_alias_float.Joseph Myers2017-12-062-2/+15
| | | | | | | | | | | | | | This patch makes the libm_alias_float macro support creating _Float32 aliases, in preparation for enabling glibc support for that type. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float32 changes. * sysdeps/generic/libm-alias-float.h: Include <bits/floatn.h>. [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (libm_alias_float_other_r): Create f32 alias. (libm_alias_float_r): Use semicolon before call to libm_alias_float_other_r.
* Correct some ia64 libm_alias_float_other calls.Joseph Myers2017-12-064-3/+10
| | | | | | | | | | | | | | | | | This patch corrects three ia64 libm_alias_float_other calls so they generate the intended _Float32 aliases when such aliases are enabled. Tested with build-many-glibcs.py for ia64-linux-gnu (that installed stripped shared libraries are unchanged when applied to current sources, and that this enables compilation tests to pass when used in conjunction with other _Float32 patches). * sysdeps/ia64/fpu/e_exp2f.S (__exp2f): Use exp2 not __exp2 as second argument to libm_alias_float_other. * sysdeps/ia64/fpu/e_log2f.S (__log2f): Use log2 not __log2 as second argument to libm_alias_float_other. * sysdeps/ia64/fpu/e_powf.S (__powf): Use pow not __pow as second argument to libm_alias_float_other.
* Make cacosh (0 + iNaN) return NaN + i pi/2 (bug 22561, DR#471).Joseph Myers2017-12-063-3/+19
| | | | | | | | | | | | | | | | | | As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 + iNaN) should return NaN +/- i pi/2, not NaN + iNaN. This patch fixes the code accordingly. The test has hardcoded the result with positive sign of the imaginary part (with an associated comment), since the unspecified sign for a result other than 0 or infinity isn't currently supported by the test infrastructure. Tested for x86_64. [BZ #22561] * math/s_cacosh_template.c (M_DECL_FUNC (__cacosh)): Use pi/2 for real part of result for argument 0 + i * NaN. * math/libm-test-cacosh.inc (cacosh_test_data): Update expected results for tests of 0 + i * NaN.
* Update Alpha libm-test-ulpsAdhemerval Zanella2017-12-062-2/+12
| | | | | | * sysdeps/alpha/fpu/libm-test-ulps: Update. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Sparc ulp update.David S. Miller2017-12-062-0/+11
| | | | | * sysdeps/sparc/fpu/libm-test-ulps: Update exp_{downward,towardzero,upward} ulps.
* Don't make local variables static in ldbl-96 j1l.Joseph Myers2017-12-062-1/+4
| | | | | | | | | | | | | | | | | | | | | | | The ldbl-96 implementation of j1l has some function-local variables that are declared static for no apparent reason (this dates back to the first addition of that file). Any vaguely recent compiler, probably including any that are supported for building glibc, optimizes away the "static" here, as the values of the variables on entry to the function are dead. So there is not actually a user-visible bug here at present (but with any compilers that didn't optimize away the static at all, possibly building with less or no optimization, so that the function stored intermediate values to and then loaded them from the variables, there would have been a thread-safety issue). But the "static" clearly doesn't belong there and might potentially make things unsafe were compilation without optimization to be supported in future, so this patch removes it. Tested for x86_64. * sysdeps/ieee754/ldbl-96/e_j1l.c (qone): Don't make local variables static.
* Make some ldbl-128, ldbl-128ibm arrays const.Joseph Myers2017-12-065-8/+19
| | | | | | | | | | | | | | | | | | | | I noticed that an x86_64 build of libm unexpectedly contained more non-constant data than an older version (before _Float128 support) did. The problem is non-const arrays in the ldbl-128 j0l and j1l implementations; this patch makes those arrays, and the corresponding ldbl-128ibm ones, const. Tested for x86_64, and tested compilation for powerpc with build-many-glibcs.py. * sysdeps/ieee754/ldbl-128/e_j0l.c (Y0_2N): Make const. (Y0_2D): Likewise. * sysdeps/ieee754/ldbl-128/e_j1l.c (Y0_2N): Likewise. (Y0_2D): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_j0l.c (Y0_2N): Likewise. (Y0_2D): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_j1l.c (Y0_2N): Likewise. (Y0_2D): Likewise.
* hsb_DE locale: Base collation on copy "iso14651_t1" [BZ #22515]Mike FABIAN2017-12-064-2075/+133
| | | | | | | | | [BZ #22515] * localedata/Makefile: Add hsb_DE.UTF-8 to test-input and to the list of locales to be built for testing. * localedata/hsb_DE.UTF-8.in: New file for testing the collation. * localedata/locales/hsb_DE (LC_COLLATE): Use “copy "iso14651_t1"” and build the collation rules upon that.
* Add references to CVE-2017-17426Florian Weimer2017-12-062-0/+6
|
* Update NEWS to add sinf optimizationRajalakshmi Srinivasaraghavan2017-12-062-1/+5
|
* Add _Float64, _Float32x function aliases.Joseph Myers2017-12-0664-23/+5914
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch continues filling out TS 18661-3 support by adding *f64 and *f32x function aliases, supporting _Float64 and _Float32x, as aliases for double functions. These types are supported for all glibc configurations. The API corresponds exactly to that for _Float128 and _Float64x. _Float32 aliases to float functions remain to be added in subsequent patches to complete this process (then there are a few miscellaneous functions in TS 18661-3 to implement that aren't simply versions of existing functions for new types). The patch enables the feature in bits/floatn-common.h, adds symbol versions and documentation with updates to ABI baselines, and arranges for the libm functions for the new types to be tested. As with the _Float64x changes there are some x86 ulps updates because of header inlines not used for the new types (and one other change to the non-multiarch libm-test-ulps, which I suppose comes from using a different compiler version / configuration from when it was last regenerated). Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * bits/floatn-common.h (__HAVE_FLOAT64): Define to 1. (__HAVE_FLOAT32X): Likewise. * manual/math.texi (Mathematics): Document support for _Float64 and _Float32x. * math/Makefile (test-types): Add float64 and float32x. * math/Versions (GLIBC_2.27): Add _Float64 and _Float32x functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* Use long double not double for _Float64 with old GCC if values the same.Joseph Myers2017-12-052-9/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If double, long double and _Float64 all have the same set of values, TS 18661-3 requires the usual arithmetic conversions on long double and _Float64 to produce _Float64. For this to be the case when building with a compiler without a distinct _Float64 type, _Float64 must be a typedef for long double, not for double. (_Float32x, however, must be double in such a case, not long double, because the usual arithmetic conversions on _Float32x and double must produce double.) This patch adjusts the fallback definition of _Float64 and associated macros accordingly in that case, to fix the build of test-tgmath3 with GCC 6 for such a configuration. Tested in conjunction with _Float64 changes with build-many-glibcs.py for arm-linux-gnueabi, to make sure the issue with test-tgmath3 is fixed. Also tested for x86_64. * bits/floatn-common.h: Include <bits/long-double.h>. [__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus) && __NO_LONG_DOUBLE_MATH] (__f64): Use suffix 'l'. [__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus) && __NO_LONG_DOUBLE_MATH] (__CFLOAT64): Use _Complex long double. [__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus) && __NO_LONG_DOUBLE_MATH] (_Float64): Use long double. [__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH] (__builtin_huge_valf64): Use __builtin_huge_vall. [__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH] (__builtin_inff64): Use __builtin_infl. [__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH] (__builtin_nanf64): Use __builtin_nanl. [__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH] (__builtin_nansf64): Use __builtin_nansl.
* Add elision tunablesRogerio Alves2017-12-0526-94/+357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds several new tunables to control the behavior of elision on supported platforms[1]. Since elision now depends on tunables, we should always *compile* with elision enabled, and leave the code disabled, but available for runtime selection. This gives us *much* better compile-time testing of the existing code to avoid bit-rot[2]. Tested on ppc, ppc64, ppc64le, s390x and x86_64. [1] This part of the patch was initially proposed by Paul Murphy but was "staled" because the framework have changed since the patch was originally proposed: https://patchwork.sourceware.org/patch/10342/ [2] This part of the patch was inititally proposed as a RFC by Carlos O'Donnell. Make sense to me integrate this on the patch: https://sourceware.org/ml/libc-alpha/2017-05/msg00335.html * elf/dl-tunables.list: Add elision parameters. * manual/tunables.texi: Add entries about elision tunable. * sysdeps/unix/sysv/linux/powerpc/elision-conf.c: Add callback functions to dynamically enable/disable elision. Add multiple callbacks functions to set elision parameters. Deleted __libc_enable_secure check. * sysdeps/unix/sysv/linux/s390/elision-conf.c: Likewise. * sysdeps/unix/sysv/linux/x86/elision-conf.c: Likewise. * configure: Regenerated. * configure.ac: Option enable_lock_elision was deleted. * config.h.in: ENABLE_LOCK_ELISION flag was deleted. * config.make.in: Remove references to enable_lock_elision. * manual/install.texi: Elision configure option was removed. * INSTALL: Regenerated to remove enable_lock_elision. * nptl/Makefile: Disable elision so it can verify error case for destroying a mutex. * sysdeps/powerpc/nptl/elide.h: Cleanup ENABLE_LOCK_ELISION check. Deleted macros for the case when ENABLE_LOCK_ELISION was not defined. * sysdeps/s390/configure: Regenerated. * sysdeps/s390/configure.ac: Remove references to enable_lock_elision.. * nptl/tst-mutex8.c: Deleted all #ifndef ENABLE_LOCK_ELISION from the test. * sysdeps/powerpc/powerpc32/sysdep.h: Deleted all ENABLE_LOCK_ELISION checks. * sysdeps/powerpc/powerpc64/sysdep.h: Likewise. * sysdeps/powerpc/sysdep.h: Likewise. * sysdeps/s390/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/force-elision.h: Likewise. * sysdeps/unix/sysv/linux/s390/elision-conf.h: Likewise. * sysdeps/unix/sysv/linux/s390/force-elision.h: Likewise. * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/s390/Makefile: Remove references to enable-lock-elision. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* Support defining strtof64, strtof32x, wcstof64, wcstof32x aliases.Joseph Myers2017-12-053-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for defining strtof64, strtof32x, wcstof64, wcstof32x and the corresponding _l functions as aliases of the corresponding double functions when _Float64 and _Float32x support is enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float64 / _Float32x changes. * stdlib/strtod.c: Include <bits/floatn.h>. (BUILD_DOUBLE): New macro. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strtof64): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (wcstof64): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strtof32x): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (wcstof32x): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * stdlib/strtod_l.c: Include <bits/floatn.h>. (BUILD_DOUBLE): New macro. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strtof64_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (wcstof64_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strtof32x_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (wcstof32x_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR].
* math: Use sign as double for reduced case in sinfAdhemerval Zanella2017-12-052-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch avoid an extra floating point to integer conversion in reduced internal function for generic sinf by defining the sign as double instead of integers. There is no much difference on Haswell with GCC 7.2.1: Before After min 9.11 9.108 mean 21.982 21.9224 However H.J. Lu reported gains on Skylake: Before: "sinf": { "": { "duration": 3.4044e+10, "iterations": 1.9942e+09, "max": 141.106, "min": 7.704, "mean": 17.0715 } } After: "sinf": { "": { "duration": 3.40665e+10, "iterations": 2.03199e+09, "max": 95.994, "min": 7.704, "mean": 16.765 } } Checked on x86_64-linux-gnu. * sysdeps/ieee754/flt-32/s_sinf.c (ones): Define as double. (reduced): Use ones as double instead of integer.
* [PATCH] fix sinf(NAN)Szabolcs Nagy2017-12-052-3/+7
| | | | | | | | | sinf(NAN) should not signal invalid fp exception so use isless instead of < where NAN is compared. this makes the sinf tests pass on aarch64. * sysdeps/ieee754/flt-32/s_sinf.c (sinf): Use isless.
* Support defining strfromf64, strfromf32x aliases.Joseph Myers2017-12-052-0/+31
| | | | | | | | | | | | | | This patch adds support for defining strfromf64 and strfromf32x aliases of strfromd when the corresponding types are enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float64 / _Float32x changes. * stdlib/strfromd.c: Include <bits/floatn.h>. [__HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strfromf64): Define and later undefine as macro and define as weak alias. [__HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strfromf32x): Likewise.
* Add headers for _Float64, _Float32x testing.Joseph Myers2017-12-053-0/+77
| | | | | | | | | | | | | | | This patch adds the headers required for testing _Float64 and _Float32x function aliases (using double ulps). The corresponding makefile support will be included in the patch that actually adds those aliases; there doesn't seem much point in adding makefile conditionals for testing something that will be available unconditionally. In conjunction with other _Float64 / _Float32x changes, test for x86_64 and with build-many-glibcs.py. * math/test-float32x.h: New file. * math/test-float64.h: Likewise.
* Support _Float64, _Float32x in libm_alias_double.Joseph Myers2017-12-053-4/+55
| | | | | | | | | | | | | | | | | | | | | | | This patch makes the libm_alias_double macros support creating _Float64 and _Float32x aliases, in preparation for enabling glibc support for those types. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float64 / _Float32x changes. * sysdeps/generic/libm-alias-double.h: Include <bits/floatn.h>. (libm_alias_double_other_r_f64): New macro. (libm_alias_double_other_r_f32x): Likewise. (libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and libm_alias_double_other_r_f32x. (libm_alias_double_r): Use semicolon before call to libm_alias_double_other_r. * sysdeps/ieee754/ldbl-opt/libm-alias-double.h: Include <bits/floatn.h>. (libm_alias_double_other_r_f64): New macro. (libm_alias_double_other_r_f32x): Likewise. (libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and libm_alias_double_other_r_f32x.
* s_sinf.c: Replace floor with simple castsH.J. Lu2017-12-052-6/+12
| | | | | | | | | | | | | | | | | | | | Since s_sinf.c either assigns the return value of floor to integer or passes double converted from integer to floor, this patch replaces floor with simple casts. Also since long == int for 32-bit targets, we can use long instead of int to avoid 64-bit integer for 64-bit targets. On Skylake, bench-sinf reports performance improvement: Before After Improvement max 130.566 129.564 30% min 7.704 7.706 0% mean 21.8188 19.1363 30% * sysdeps/ieee754/flt-32/s_sinf.c (reduced): Replace long with int. (SINF_FUNC): Likewise. Replace floor with simple casts.
* tilegx: tag __insn_OP builtin issue with gcc bugzilla #Chris Metcalf2017-12-051-1/+2
|
* et_EE locale: Base collation on iso14651_t1 [BZ #22517]Mike FABIAN2017-12-054-2067/+100
| | | | | | | | | [BZ #22517] * localedata/Makefile: Add et_EE.UTF-8 to test-input and to the list of locales to be built for testing. * localedata/et_EE.UTF-8.in: New file for testing the collation. * localedata/locales/et_EE (LC_COLLATE): Use “copy "iso14651_t1"” and build the collation rules upon that.
* tilegx: work around vector insn bug in gccChris Metcalf2017-12-0510-25/+64
| | | | | | | | Avoid an issue in gcc where some of the vector (aka SIMD) ops will sometimes end up getting wrongly optimized out. We use these instructions in many of the string implementations. If/when we have an upstreamed fix for this problem in gcc we can conditionalize the use of the extended assembly workaround in glibc.
* Linux: Implement interfaces for memory protection keysFlorian Weimer2017-12-0550-4/+1179
| | | | | | | | | | | | | | | | This adds system call wrappers for pkey_alloc, pkey_free, pkey_mprotect, and x86-64 implementations of pkey_get and pkey_set, which abstract over the PKRU CPU register and hide the actual number of memory protection keys supported by the CPU. pkey_mprotect with a -1 key is implemented using mprotect, so it will work even if the kernel does not support the pkey_mprotect system call. The system call wrapers use unsigned int instead of unsigned long for parameters, so that no special treatment for x32 is needed. The flags argument is currently unused, and the access rights bit mask is limited to two bits by the current PKRU register layout anyway. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* support/tst-test_compare: Fix 32-bit/64-bit expected output mismatchFlorian Weimer2017-12-052-2/+9
| | | | | | The use of a long type resulted in test output differences between 32-bit and 64-bit architectures, causing the test to fail on 32-bit architectures.
* Use libm_alias_float for powerpc.Joseph Myers2017-12-0575-83/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes powerpc libm function implementations use libm_alias_float to define function aliases. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged for all its hard-float powerpc configurations. * sysdeps/powerpc/fpu/s_cosf.c: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_fabs.S: Include <libm-alias-float.h>. (fabsf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_fmaf.S: Include <libm-alias-float.h>. (fmaf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_rintf.c: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/powerpc/fpu/s_sinf.c: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float. * sysdeps/powerpc/power5+/fpu/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/powerpc/power7/fpu/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_lround.S: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_rintf.S: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float.