Go to file
Joseph Myers 8d3f9e85cf Add narrowing subtract functions.
This patch adds the narrowing subtract functions from TS 18661-1 to
glibc's libm: fsub, fsubl, dsubl, f32subf64, f32subf32x, f32xsubf64
for all configurations; f32subf64x, f32subf128, f64subf64x,
f64subf128, f32xsubf64x, f32xsubf128, f64xsubf128 for configurations
with _Float64x and _Float128; __nldbl_dsubl for ldbl-opt.

The changes are essentially the same as for the narrowing add
functions, so the description of those generally applies to this patch
as well.

Tested for x86_64, x86, mips64 (all three ABIs, both hard and soft
float) and powerpc, and with build-many-glibcs.py.

	* math/Makefile (libm-narrow-fns): Add sub.
	(libm-test-funcs-narrow): Likewise.
	* math/Versions (GLIBC_2.28): Add narrowing subtract functions.
	* math/bits/mathcalls-narrow.h (sub): Use __MATHCALL_NARROW.
	* math/gen-auto-libm-tests.c (test_functions): Add sub.
	* math/math-narrow.h (CHECK_NARROW_SUB): New macro.
	(NARROW_SUB_ROUND_TO_ODD): Likewise.
	(NARROW_SUB_TRIVIAL): Likewise.
	* sysdeps/ieee754/float128/float128_private.h (__fsubl): New
	macro.
	(__dsubl): Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fsub and
	dsub.
	(CFLAGS-nldbl-dsub.c): New variable.
	(CFLAGS-nldbl-fsub.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/Versions (GLIBC_2.28): Add
	__nldbl_dsubl.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl_dsubl): New
	prototype.
	* manual/arith.texi (Misc FP Arithmetic): Document fsub, fsubl,
	dsubl, fMsubfN, fMsubfNx, fMxsubfN and fMxsubfNx.
	* math/auto-libm-test-in: Add tests of sub.
	* math/auto-libm-test-out-narrow-sub: New generated file.
	* math/libm-test-narrow-sub.inc: New file.
	* sysdeps/i386/fpu/s_f32xsubf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_f32xsubf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fsub.c: Likewise.
	* sysdeps/ieee754/float128/s_f32subf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64subf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64xsubf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_dsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_f64xsubf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_dsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_dsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-dsub.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-fsub.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_dsubl.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fsub.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fsubl.c: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
	* sysdeps/mach/hurd/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.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/riscv/rv64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2018-03-20 00:34:52 +00:00
argp Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
assert Fix uninitialized variable in assert_perror (bug 22761) 2018-02-05 11:06:15 +01:00
benchtests Undefine attribute_hidden to fix benchtests 2018-03-19 10:53:14 +00:00
bits hurd: Fix includability of <hurd/signal.h> in all standards 2018-03-05 22:50:29 +01:00
catgets intl/tst-gettext: fix failure with newest msgfmt 2018-02-18 18:16:05 +01:00
ChangeLog.old Add missing reference to bug 21654 2017-10-07 13:14:36 +02:00
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 Use libc_hidden_* for tolower, toupper (bug 15105). 2018-02-23 13:54:53 +00:00
debug Remove _IO_file_flags define. 2018-02-21 14:22:50 -05:00
dirent Define _DIRENT_MATCHES_DIRENT64 regardless 2018-03-05 18:10:04 -03:00
dlfcn Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
elf Add SHT_X86_64_UNWIND to elf.h (bug 20079). 2018-03-19 18:08:48 +00:00
gmon Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gnulib Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
grp Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gshadow Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
hesiod Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
hurd hurd: Fix build with latest htl 2018-03-19 01:32:39 +01:00
iconv Fix s390 -Os iconv build. 2018-03-05 21:46:55 +00:00
iconvdata Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
include Add support for sqrt asm redirects 2018-03-15 19:21:35 +00:00
inet Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
intl intl/tst-gettext: fix failure with newest msgfmt 2018-02-18 18:16:05 +01:00
io Add missing start-of-file descriptive comment. 2018-03-06 09:21:04 +01:00
libidn Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
libio [BZ 1190] Make EOF sticky in stdio. 2018-03-13 08:31:56 -04:00
locale Fix two more -Os strcoll / wcscoll build failures. 2018-02-27 16:55:42 +00:00
localedata cs_CZ locale: Add alternative month names (bug 22963). 2018-03-15 01:21:02 +01:00
login Update copyright dates not handled by scripts/update-copyrights. 2018-01-01 00:41:16 +00:00
mach hurd: Fix copyright years 2018-03-18 18:33:37 +01:00
malloc malloc: harden removal from unsorted list 2018-03-14 16:25:57 -04:00
manual Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
math Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
mathvec Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
misc Add missing start-of-file descriptive comment. 2018-03-06 09:21:04 +01:00
nis libnsl: Turn remaining symbols into compat symbols [BZ #22701] 2018-01-29 17:42:30 +01:00
nptl nptl: Fix tst-cancel4 sendto tests 2018-03-05 18:09:08 -03:00
nptl_db nptl_db: Remove stale match_pid' parameter from iterate_thread_list' 2018-03-01 16:10:05 +00:00
nscd Fix multiple definitions of __nss_*_database (bug 22918) 2018-03-03 17:44:24 +01:00
nss Fix multiple definitions of __nss_*_database (bug 22918) 2018-03-03 17:44:24 +01:00
po Update translations from the Translation Project 2018-03-12 13:24:46 +00:00
posix Fix multiple definitions of __nss_*_database (bug 22918) 2018-03-03 17:44:24 +01:00
pwd Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
resolv hurd: fix warning 2018-01-27 16:43:16 +01:00
resource resource/tst-getrlimit.c: Add copyright header 2018-01-05 20:34:10 +01:00
rt Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
scripts hurd: Fix inclusion of mach headers in all standards 2018-03-04 02:53:09 +01:00
setjmp Remove hidden __libc_longjmp 2018-03-10 09:27:20 -08:00
shadow Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
signal Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
socket Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
soft-fp Do not use packed structures in soft-fp. 2018-02-01 20:44:49 +00:00
stdio-common Remove miscellaneous debris from libio. 2018-02-21 14:39:54 -05:00
stdlib Separate out error_t definition 2018-03-04 17:27:58 +01:00
streams Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
string Fix another -Os strcoll build issue. 2018-02-26 18:38:01 +00:00
sunrpc Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
support [BZ 1190] Make EOF sticky in stdio. 2018-03-13 08:31:56 -04:00
sysdeps Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
sysvipc Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
termios Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
time Fix -Os getc_unlocked linknamespace, localplt issues (bug 15105, bug 19463). 2018-02-21 18:01:11 +00:00
timezone Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
wcsmbs [BZ 1190] Make EOF sticky in stdio. 2018-03-13 08:31:56 -04:00
wctype Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
.gitattributes Assume __NR_openat is always defined 2016-03-23 23:35:08 +01:00
.gitignore Add *.pyc to .gitignore 2015-05-18 15:26:26 +05:30
abi-tags Remove the bulk of the NaCl port. 2017-05-20 08:09:10 -04:00
aclocal.m4 LIBC_SLIBDIR_RTLDDIR: substitute arguments in single quotes 2018-01-25 17:20:28 +01:00
ChangeLog Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
config.h.in Add RISC-V entries to config.h.in 2018-01-29 10:24:57 -08:00
config.make.in Pass -no-pie to GCC only if GCC defaults to PIE [BZ #22614] 2017-12-18 12:24:38 -08:00
configure Pass -no-pie to GCC only if GCC defaults to PIE [BZ #22614] 2017-12-18 12:24:38 -08:00
configure.ac Pass -no-pie to GCC only if GCC defaults to PIE [BZ #22614] 2017-12-18 12:24:38 -08:00
COPYING Update to latest versions of GPL-2.0 and LGPL-2.1 2013-09-09 12:52:48 +10:00
COPYING.LIB Update to latest versions of GPL-2.0 and LGPL-2.1 2013-09-09 12:52:48 +10:00
extra-lib.mk Rename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk. 2017-05-09 07:06:29 -04:00
gen-locales.mk Improve gen-locales.mk and gen-locale.sh to make test files with @ options work 2018-02-27 17:01:57 +01:00
INSTALL Document use of CC and CFLAGS in more detail (bug 20980, bug 21234). 2018-02-15 23:48:47 +00:00
libc-abis A few more archs have IFUNC support. 2010-03-17 02:43:12 -07:00
libof-iterator.mk Rename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk. 2017-05-09 07:06:29 -04:00
LICENSES Expand LICENSES file. 2012-12-05 21:56:15 +00:00
MAINTAINERS Add MAINTAINERS 2017-05-11 13:38:30 -04:00
Makeconfig Add support for sqrt asm redirects 2018-03-15 19:21:35 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Makefile.in New make target to only build benchmark binaries 2016-04-20 10:23:28 +05:30
Makerules Define GEN_AS_CONST_HEADERS when generating header files [BZ #22792] 2018-02-23 11:29:39 -08:00
NEWS Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
o-iterator.mk Fri Mar 17 12:58:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> 1995-03-17 18:42:51 +00:00
README Skeleton documentation for the RISC-V port 2018-01-29 10:22:26 -08:00
Rules Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
shlib-versions Extend NSS test suite 2017-07-17 15:52:44 -04:00
test-skeleton.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
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.