glibc/sysdeps/unix/sysv/linux/s390/s390-32
Joseph Myers d8742dd82f Add narrowing add functions.
This patch adds the narrowing add functions from TS 18661-1 to glibc's
libm: fadd, faddl, daddl, f32addf64, f32addf32x, f32xaddf64 for all
configurations; f32addf64x, f32addf128, f64addf64x, f64addf128,
f32xaddf64x, f32xaddf128, f64xaddf128 for configurations with
_Float64x and _Float128; __nldbl_daddl for ldbl-opt.  As discussed for
the build infrastructure patch, tgmath.h support is deliberately
deferred, and FP_FAST_* macros are not applicable without optimized
function implementations.

Function implementations are added for all relevant pairs of formats
(including certain cases of a format and itself where more than one
type has that format).  The main implementations use round-to-odd, or
a trivial computation in the case where both formats are the same or
where the wider format is IBM long double (in which case we don't
attempt to be correctly rounding).  The sysdeps/ieee754/soft-fp
implementations use soft-fp, and are used automatically for
configurations without exceptions and rounding modes by virtue of
existing Implies files.  As previously discussed, optimized versions
for particular architectures are possible, but not included.

i386 gets a special version of f32xaddf64 to avoid problems with
double rounding (similar to the existing fdim version), since this
function must round just once without an intermediate rounding to long
double.  (No such special version is needed for any other function,
because the nontrivial functions use round-to-odd, which does the
intermediate computation with the rounding mode set to round-to-zero,
and double rounding is OK except in round-to-nearest mode, so is OK
for that intermediate round-to-zero computation.)  mul and div will
need slightly different special versions for i386 (using round-to-odd
on long double instead of precision control) because of the
possibility of inexact intermediate results in the subnormal range for
double.

To reduce duplication among the different function implementations,
math-narrow.h gets macros CHECK_NARROW_ADD, NARROW_ADD_ROUND_TO_ODD
and NARROW_ADD_TRIVIAL.

In the trivial cases and for any architecture-specific optimized
implementations, the overhead of the errno setting might be
significant, but I think that's best handled through compiler built-in
functions rather than providing separate no-errno versions in glibc
(and likewise there are no __*_finite entry points for these function
provided, __*_finite effectively being no-errno versions at present in
most cases).

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

	* math/Makefile (libm-narrow-fns): Add add.
	(libm-test-funcs-narrow): Likewise.
	* math/Versions (GLIBC_2.28): Add narrowing add functions.
	* math/bits/mathcalls-narrow.h (add): Use __MATHCALL_NARROW .
	* math/gen-auto-libm-tests.c (test_functions): Add add.
	* math/math-narrow.h (CHECK_NARROW_ADD): New macro.
	(NARROW_ADD_ROUND_TO_ODD): Likewise.
	(NARROW_ADD_TRIVIAL): Likewise.
	* sysdeps/ieee754/float128/float128_private.h (__faddl): New
	macro.
	(__daddl): Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fadd and
	dadd.
	(CFLAGS-nldbl-dadd.c): New variable.
	(CFLAGS-nldbl-fadd.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/Versions (GLIBC_2.28): Add
	__nldbl_daddl.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl_daddl): New
	prototype.
	* manual/arith.texi (Misc FP Arithmetic): Document fadd, faddl,
	daddl, fMaddfN, fMaddfNx, fMxaddfN and fMxaddfNx.
	* math/auto-libm-test-in: Add tests of add.
	* math/auto-libm-test-out-narrow-add: New generated file.
	* math/libm-test-narrow-add.inc: New file.
	* sysdeps/i386/fpu/s_f32xaddf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_f32xaddf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fadd.c: Likewise.
	* sysdeps/ieee754/float128/s_f32addf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64addf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64xaddf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_daddl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_f64xaddf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_faddl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_daddl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_faddl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_daddl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_faddl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-dadd.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-fadd.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_daddl.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fadd.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_faddl.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-02-10 02:08:43 +00:00
..
____longjmp_chk.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
__makecontext_ret.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
alphasort64.c
c++-types.data S390: Consolidate nptl/ subdirectories under linux/... 2014-06-26 09:34:34 -07:00
clone.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fxstat.c
fxstatat.c * io/Makefile (routines): Add fstatat, fstatat64, fxstatat, fxstatat64, 2005-11-11 20:02:07 +00:00
getcontext.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getdents64.c
getutent_r.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutent.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutid_r.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutid.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutline_r.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutline.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutmp.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutxent.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutxid.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
getutxline.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
glob64-lstat-compat.c posix: Add compat glob symbol to not follow dangling symbols 2017-09-25 18:04:16 -07:00
jmp_buf-macros.h Add jmp_buf-macros.h 2017-11-09 05:10:03 -08:00
ld.abilist ld.so: Remove __libc_memalign 2016-11-30 16:23:58 +01:00
libBrokenLocale.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libc.abilist copy_file_range: New function to copy file data 2017-12-22 10:55:40 +01:00
libcrypt.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libdl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libm.abilist Add narrowing add functions. 2018-02-10 02:08:43 +00:00
libnsl.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libpthread.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libresolv.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
librt.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libthread_db.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
libutil.abilist Simplify the abilist format 2015-11-06 13:58:53 +01:00
lockf64.c
login32.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
login.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
lxstat.c
makecontext.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Makefile Build divdi3 only for architecture that required it 2017-04-06 15:14:34 -03:00
oldglob.c posix: Fix compat glob code on s390 and alpha 2017-09-13 09:24:12 -03:00
posix_fadvise64.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
profil-counter.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pututxline.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
readdir64_r.c
readdir64.c
register-dump.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
scandir64.c
setcontext.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
swapcontext.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
syscall.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
syscalls.list Consolidate Linux setrlimit and getrlimit implementation 2016-11-17 15:54:22 -02:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sysdep.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
updwtmp.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
updwtmpx.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utmp32.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utmp32.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utmp-compat.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utmp-convert.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utmpx32.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utmpx32.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utmpx-convert.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Versions Revert {send,sendm,recv,recvm}msg conformance changes 2016-06-10 11:58:16 -03:00
versionsort64.c
vfork.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
xstat.c