glibc/sysdeps/ieee754/ldbl-opt
Joseph Myers 90f0ac10a7 Add fmaximum, fminimum functions
C2X adds new <math.h> functions for floating-point maximum and
minimum, corresponding to the new operations that were added in IEEE
754-2019 because of concerns about the old operations not being
associative in the presence of signaling NaNs.  fmaximum and fminimum
handle NaNs like most <math.h> functions (any NaN argument means the
result is a quiet NaN).  fmaximum_num and fminimum_num handle both
quiet and signaling NaNs the way fmax and fmin handle quiet NaNs (if
one argument is a number and the other is a NaN, return the number),
but still raise "invalid" for a signaling NaN argument, making them
exceptions to the normal rule that a function with a floating-point
result raising "invalid" also returns a quiet NaN.  fmaximum_mag,
fminimum_mag, fmaximum_mag_num and fminimum_mag_num are corresponding
functions returning the argument with greatest or least absolute
value.  All these functions also treat +0 as greater than -0.  There
are also corresponding <tgmath.h> type-generic macros.

Add these functions to glibc.  The implementations use type-generic
templates based on those for fmax, fmin, fmaxmag and fminmag, and test
inputs are based on those for those functions with appropriate
adjustments to the expected results.  The RISC-V maintainers might
wish to add optimized versions of fmaximum_num and fminimum_num (for
float and double), since RISC-V (F extension version 2.2 and later)
provides instructions corresponding to those functions - though it
might be at least as useful to add architecture-independent built-in
functions to GCC and teach the RISC-V back end to expand those
functions inline, which is what you generally want for functions that
can be implemented with a single instruction.

Tested for x86_64 and x86, and with build-many-glibcs.py.
2021-09-28 23:31:35 +00:00
..
bits Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Makefile Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
Versions
configure
configure.ac configure: Replaced obsolete AC_TRY_COMPILE 2021-06-04 10:16:00 -03:00
libm-alias-double.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
libm-alias-ldouble.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
math_ldbl_opt.c
math_ldbl_opt.h
nldbl-acos.c
nldbl-acosh.c
nldbl-asin.c
nldbl-asinh.c
nldbl-asprintf.c
nldbl-asprintf_chk.c
nldbl-atan.c
nldbl-atan2.c
nldbl-atanh.c
nldbl-cabs.c
nldbl-cacos.c
nldbl-cacosh.c
nldbl-canonicalize.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-carg.c
nldbl-casin.c
nldbl-casinh.c
nldbl-catan.c
nldbl-catanh.c
nldbl-cbrt.c
nldbl-ccos.c
nldbl-ccosh.c
nldbl-ceil.c
nldbl-cexp.c
nldbl-cimag.c
nldbl-clog.c
nldbl-clog10.c
nldbl-compat.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
nldbl-compat.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
nldbl-conj.c
nldbl-copysign.c
nldbl-cos.c
nldbl-cosh.c
nldbl-cpow.c
nldbl-cproj.c
nldbl-creal.c
nldbl-csin.c
nldbl-csinh.c
nldbl-csqrt.c
nldbl-ctan.c
nldbl-ctanh.c
nldbl-dadd.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-ddiv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-dfma.c Add narrowing fma functions 2021-09-22 21:25:31 +00:00
nldbl-dmul.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-dprintf.c
nldbl-dprintf_chk.c
nldbl-dsqrt.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
nldbl-dsub.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-erf.c
nldbl-erfc.c
nldbl-exp.c
nldbl-exp2.c
nldbl-exp10.c
nldbl-expm1.c
nldbl-fabs.c
nldbl-fadd.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-fdim.c
nldbl-fdiv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-ffma.c Add narrowing fma functions 2021-09-22 21:25:31 +00:00
nldbl-finite.c
nldbl-floor.c
nldbl-fma.c
nldbl-fmax.c
nldbl-fmaximum.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fmaximum_mag.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fmaximum_mag_num.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fmaximum_num.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fmaxmag.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-fmin.c
nldbl-fminimum.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fminimum_mag.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fminimum_mag_num.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fminimum_num.c Add fmaximum, fminimum functions 2021-09-28 23:31:35 +00:00
nldbl-fminmag.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-fmod.c
nldbl-fmul.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-fprintf.c
nldbl-fprintf_chk.c
nldbl-frexp.c
nldbl-fromfp.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-fromfpx.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-fscanf.c
nldbl-fsqrt.c Add narrowing square root functions 2021-09-10 20:56:22 +00:00
nldbl-fsub.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-fwprintf.c
nldbl-fwprintf_chk.c
nldbl-fwscanf.c
nldbl-gamma.c
nldbl-getpayload.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-hypot.c
nldbl-ilogb.c
nldbl-iovfscanf.c
nldbl-isinf.c
nldbl-isnan.c
nldbl-isoc99_fscanf.c
nldbl-isoc99_fwscanf.c
nldbl-isoc99_scanf.c
nldbl-isoc99_sscanf.c
nldbl-isoc99_swscanf.c
nldbl-isoc99_vfscanf.c
nldbl-isoc99_vfwscanf.c
nldbl-isoc99_vscanf.c
nldbl-isoc99_vsscanf.c
nldbl-isoc99_vswscanf.c
nldbl-isoc99_vwscanf.c
nldbl-isoc99_wscanf.c
nldbl-j0.c
nldbl-j1.c
nldbl-jn.c
nldbl-ldexp.c
nldbl-lgamma.c
nldbl-lgamma_r.c
nldbl-llogb.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-llrint.c
nldbl-llround.c
nldbl-log.c
nldbl-log1p.c
nldbl-log2.c
nldbl-log10.c
nldbl-logb.c
nldbl-lrint.c
nldbl-lround.c
nldbl-modf.c
nldbl-nan.c
nldbl-nearbyint.c
nldbl-nextafter.c
nldbl-nextdown.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-nexttoward.c
nldbl-nexttowardf.c
nldbl-nextup.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-obstack_printf.c
nldbl-obstack_printf_chk.c
nldbl-obstack_vprintf.c
nldbl-obstack_vprintf_chk.c
nldbl-pow.c
nldbl-printf.c
nldbl-printf_chk.c
nldbl-printf_fp.c
nldbl-printf_size.c
nldbl-qecvt.c
nldbl-qecvt_r.c
nldbl-qfcvt.c
nldbl-qfcvt_r.c
nldbl-qgcvt.c
nldbl-remainder.c
nldbl-remquo.c
nldbl-rint.c
nldbl-round.c
nldbl-roundeven.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-scalb.c
nldbl-scalbln.c
nldbl-scalbn.c
nldbl-scanf.c
nldbl-setpayload.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-setpayloadsig.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-signbit.c
nldbl-significand.c
nldbl-sin.c
nldbl-sincos.c
nldbl-sinh.c
nldbl-snprintf.c
nldbl-snprintf_chk.c
nldbl-sprintf.c
nldbl-sprintf_chk.c
nldbl-sqrt.c
nldbl-sscanf.c
nldbl-strfmon.c
nldbl-strfmon_l.c
nldbl-strfroml.c
nldbl-strtold.c
nldbl-strtold_l.c
nldbl-strtoldint.c
nldbl-swprintf.c
nldbl-swprintf_chk.c
nldbl-swscanf.c
nldbl-syslog.c
nldbl-syslog_chk.c
nldbl-tan.c
nldbl-tanh.c
nldbl-tgamma.c
nldbl-totalorder.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-totalordermag.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-trunc.c
nldbl-ufromfp.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-ufromfpx.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nldbl-vasprintf.c
nldbl-vasprintf_chk.c
nldbl-vdprintf.c
nldbl-vdprintf_chk.c
nldbl-vfprintf.c
nldbl-vfprintf_chk.c
nldbl-vfscanf.c
nldbl-vfwprintf.c
nldbl-vfwprintf_chk.c
nldbl-vfwscanf.c
nldbl-vprintf.c
nldbl-vprintf_chk.c
nldbl-vscanf.c
nldbl-vsnprintf.c
nldbl-vsnprintf_chk.c
nldbl-vsprintf.c
nldbl-vsprintf_chk.c
nldbl-vsscanf.c
nldbl-vswprintf.c
nldbl-vswprintf_chk.c
nldbl-vswscanf.c
nldbl-vsyslog.c
nldbl-vsyslog_chk.c
nldbl-vwprintf.c
nldbl-vwprintf_chk.c
nldbl-vwscanf.c
nldbl-wcstold.c
nldbl-wcstold_l.c
nldbl-wcstoldint.c
nldbl-wprintf.c
nldbl-wprintf_chk.c
nldbl-wscanf.c
nldbl-y0.c
nldbl-y1.c
nldbl-yn.c
s_clog10.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_clog10l.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_copysign.c
s_finite.c
s_frexp.c
s_isinf.c
s_isnan.c
s_ldexp.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_ldexpl.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
s_modf.c
s_nextafter.c
s_nexttowardfd.c
test-narrow-macros-ldbl-64.c
test-nldbl-redirect.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
test-redirection-ldbl-64.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
w_exp10_compat.c
w_exp10l_compat.c
w_lgamma_compat.c
w_lgamma_compatl.c
w_remainder_compat.c
w_remainderl_compat.c
w_scalb_compat.c Add a generic scalb implementation 2020-02-14 08:24:56 -06:00
w_scalbl_compat.c Add a generic scalb implementation 2020-02-14 08:24:56 -06:00