glibc/sysdeps/ieee754/ldbl-96
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
..
bits Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
include/bits Add canonicalize, canonicalizef, canonicalizel. 2016-10-26 23:14:31 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_acoshl.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_asinl.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_atanhl.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
e_coshl.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
e_gammal_r.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_hypotl.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_j0l.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_j1l.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_jnl.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_lgammal_r.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
e_rem_pio2l.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_sinhl.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
gamma_product.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gamma_productl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
k_cosl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
k_sinl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
k_tanl.c Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
ldbl2mpn.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
lgamma_negl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
lgamma_product.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
lgamma_productl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
math_ldbl.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpn2ldbl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
printf_fphex.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_asinhl.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
s_cbrtl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_copysignl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_cosl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_daddl.c Add narrowing add functions. 2018-02-10 02:08:43 +00:00
s_dsubl.c Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
s_erfl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_faddl.c Add narrowing add functions. 2018-02-10 02:08:43 +00:00
s_fma.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fmal.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_frexpl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_fromfpl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_fromfpl_main.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fromfpxl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_fsubl.c Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
s_getpayloadl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_iscanonicall.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_issignalingl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_llrintl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_llroundl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_lrintl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_lroundl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_modfl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_nexttoward.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
s_nexttowardf.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
s_nextupl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_remquol.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_roundevenl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_roundl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_scalblnl.c Fix ldbl-96 scalblnl underflowing results (bug 17803). 2015-01-12 23:02:14 +00:00
s_setpayloadl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_setpayloadl_main.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_setpayloadsigl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_signbitl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_sincosl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_sinl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_tanhl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_tanl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_totalorderl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_totalordermagl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_ufromfpl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
s_ufromfpxl.c Use libm_alias_ldouble for ldbl-96 functions. 2017-10-05 21:13:40 +00:00
strtod_nan_ldouble.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
strtold_l.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
t_sincosl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
test-canonical-ldbl-96.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
test-totalorderl-ldbl-96.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
x2y2m1.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
x2y2m1l.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00