Go to file
Wilco Dijkstra c3d466cba1 Remove slow paths from pow
Remove the slow paths from pow.  Like several other double precision math
functions, pow is exactly rounded.  This is not required from math functions
and causes major overheads as it requires multiple fallbacks using higher
precision arithmetic if a result is close to 0.5ULP.  Ridiculous slowdowns
of up to 100000x have been reported when the highest precision path triggers.

All GLIBC math tests pass on AArch64 and x64 (with ULP of pow set to 1).
The worst case error is ~0.506ULP.  A simple test over a few hundred million
values shows pow is 10% faster on average.  This fixes BZ #13932.

	[BZ #13932]
	* sysdeps/ieee754/dbl-64/uexp.h (err_1): Remove.
	* benchtests/pow-inputs: Update comment for slow path cases.
	* manual/probes.texi (slowpow_p10): Delete removed probe.
	(slowpow_p10): Likewise.
	* math/Makefile: Remove halfulp.c and slowpow.c.
	* sysdeps/aarch64/libm-test-ulps: Set ULP of pow to 1.
	* sysdeps/generic/math_private.h (__exp1): Remove error argument.
	(__halfulp): Remove.
	(__slowpow): Remove.
	* sysdeps/i386/fpu/halfulp.c: Delete file.
	* sysdeps/i386/fpu/slowpow.c: Likewise.
	* sysdeps/ia64/fpu/halfulp.c: Likewise.
	* sysdeps/ia64/fpu/slowpow.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_exp.c (__exp1): Remove error argument,
	improve comments and add error analysis.
	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Add error analysis.
	(power1): Remove function:
	(log1): Remove error argument, add error analysis.
	(my_log2): Remove function.
	* sysdeps/ieee754/dbl-64/halfulp.c: Delete file.
	* sysdeps/ieee754/dbl-64/slowpow.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/halfulp.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/slowpow.c: Likewise.
	* sysdeps/powerpc/power4/fpu/Makefile: Remove CPPFLAGS-slowpow.c.
	* sysdeps/x86_64/fpu/libm-test-ulps: Set ULP of pow to 1.
	* sysdeps/x86_64/fpu/multiarch/Makefile: Remove slowpow-fma.c,
	slowpow-fma4.c, halfulp-fma.c, halfulp-fma4.c.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c (__slowpow): Remove define.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c (__slowpow): Likewise.
	* sysdeps/x86_64/fpu/multiarch/halfulp-fma.c: Delete file.
	* sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/slowpow-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c: Likewise.
2018-02-12 10:47:09 +00:00
argp
assert Fix uninitialized variable in assert_perror (bug 22761) 2018-02-05 11:06:15 +01:00
benchtests Remove slow paths from pow 2018-02-12 10:47:09 +00:00
bits Post-cleanup 2: minimize _G_config.h. 2018-02-07 10:10:32 -05:00
catgets
ChangeLog.old
conform Don't install libio.h or _G_config.h. 2018-02-07 10:07:31 -05:00
crypt crypt: Fix badsalttest test (Bug 22765) 2018-02-01 00:02:49 -08:00
csu Post-cleanup 2: minimize _G_config.h. 2018-02-07 10:10:32 -05:00
ctype
debug
dirent
dlfcn
elf Add elf.h NT_* macros from Linux 4.15 (bug 14890). 2018-02-06 00:37:17 +00:00
gmon
gnulib
grp
gshadow
hesiod
hurd hurd: Fix preprocessor indentation 2018-01-29 23:00:17 +01:00
iconv
iconvdata
include Add build infrastructure for narrowing libm functions. 2018-02-09 21:18:52 +00:00
inet
intl
io Revert "hurd: Fix building io/tst-fchownat.c" 2018-01-28 19:13:20 +01:00
libidn
libio Post-cleanup 2: minimize _G_config.h. 2018-02-07 10:10:32 -05:00
locale Fix -Os strcoll, wcscoll, build (bug 21313). 2018-02-07 13:36:14 +00:00
localedata hr_HR: Add alternative month names (bug 10871). 2018-01-30 12:48:17 +01:00
login
mach hurd: Add expected ABI lists 2018-01-29 22:07:44 +01:00
malloc [BZ #22830] malloc_stats: restore cancellation for stderr correctly. 2018-02-10 16:24:17 -05:00
manual Remove slow paths from pow 2018-02-12 10:47:09 +00:00
math Remove slow paths from pow 2018-02-12 10:47:09 +00:00
mathvec
misc Fix -Os gnu_dev_* linknamespace, localplt issues (bug 15105, bug 19463). 2018-02-07 14:57:31 +00:00
nis libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
nptl Revert Intel CET changes to __jmp_buf_tag (Bug 22743) 2018-01-25 23:43:46 -08:00
nptl_db
nscd nscd: don't unconditionally use PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP 2018-02-11 18:22:11 +01:00
nss nss: Adjust tests to use nss_files only 2018-01-30 14:26:31 +01:00
po Update translations from the Translation Project 2018-01-17 22:00:50 +00:00
posix Define char16_t, char32_t consistently with uint_least16_t, uint_least32_t (bug 17979). 2018-02-07 20:33:55 +00:00
pwd
resolv hurd: fix warning 2018-01-27 16:43:16 +01:00
resource
rt
scripts Use MPFR 4.0.1 in build-many-glibcs.py. 2018-02-07 17:38:13 +00:00
setjmp
shadow
signal
socket
soft-fp Do not use packed structures in soft-fp. 2018-02-01 20:44:49 +00:00
stdio-common Remove some unnecessary redefinitions of std symbols. 2018-02-05 19:58:01 -05:00
stdlib hurd: Fix build 2018-02-04 14:02:36 +01:00
streams
string Unify and simplify bits/byteswap.h, bits/byteswap-16.h headers (bug 14508, bug 15512, bug 17082, bug 20530). 2018-02-06 21:55:08 +00:00
sunrpc
support support: Preserve errno in write_message, TEST_VERIFY and other checks 2018-01-12 13:35:01 +01:00
sysdeps Remove slow paths from pow 2018-02-12 10:47:09 +00:00
sysvipc
termios
time time: Reference CLOCKS_PER_SEC in clock comment [BZ #22735] 2018-02-02 11:59:31 +01:00
timezone
wcsmbs Define char16_t, char32_t consistently with uint_least16_t, uint_least32_t (bug 17979). 2018-02-07 20:33:55 +00:00
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4 LIBC_SLIBDIR_RTLDDIR: substitute arguments in single quotes 2018-01-25 17:20:28 +01:00
ChangeLog Remove slow paths from pow 2018-02-12 10:47:09 +00:00
config.h.in Add RISC-V entries to config.h.in 2018-01-29 10:24:57 -08:00
config.make.in
configure
configure.ac
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL Fix typo in the previous commit 2018-01-31 23:13:00 +00:00
libc-abis
libof-iterator.mk
LICENSES
MAINTAINERS
Makeconfig
Makefile
Makefile.in
Makerules Allow make-link-multidir to make subdirectories 2018-01-06 23:35:46 -08:00
NEWS Add narrowing add functions. 2018-02-10 02:08:43 +00:00
o-iterator.mk
README Skeleton documentation for the RISC-V port 2018-01-29 10:22:26 -08:00
Rules
shlib-versions
test-skeleton.c
version.h Open master branch for glibc 2.28 development 2018-02-01 17:18:19 +00:00

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.  The current
GNU/Hurd support requires out-of-tree patches that will eventually be
incorporated into an official GNU C Library release.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arm-*-linux-gnueabi
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu
	tilegx-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see http://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at http://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see http://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.