aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS7
-rw-r--r--manual/arith.texi19
-rw-r--r--math/Makefile6
-rw-r--r--math/Versions9
-rw-r--r--math/auto-libm-test-out-narrow-sqrt4485
-rw-r--r--math/bits/mathcalls-narrow.h3
-rwxr-xr-xmath/gen-tgmath-tests.py5
-rw-r--r--math/libm-test-driver.c18
-rw-r--r--math/libm-test-narrow-sqrt.inc56
-rw-r--r--math/math-narrow.h145
-rw-r--r--math/math.h6
-rw-r--r--math/tgmath.h56
-rw-r--r--math/w_sqrt_compat.c6
-rw-r--r--math/w_sqrt_template.c8
-rw-r--r--math/w_sqrtl_compat.c4
-rw-r--r--sysdeps/generic/math-narrow-alias.h135
-rw-r--r--sysdeps/generic/math-type-macros-double.h5
-rw-r--r--sysdeps/generic/math-type-macros-float.h4
-rw-r--r--sysdeps/generic/math-type-macros-float128.h5
-rw-r--r--sysdeps/generic/math-type-macros-ldouble.h5
-rw-r--r--sysdeps/generic/math-type-macros.h7
-rw-r--r--sysdeps/i386/fpu/w_sqrt.c2
-rw-r--r--sysdeps/i386/fpu/w_sqrt_compat.c2
-rw-r--r--sysdeps/ia64/fpu/e_sqrt.S1
-rw-r--r--sysdeps/ia64/fpu/libm-symbols.h1
-rw-r--r--sysdeps/ieee754/dbl-64/s_f32xsqrtf64.c1
-rw-r--r--sysdeps/ieee754/dbl-64/s_fsqrt.c34
-rw-r--r--sysdeps/ieee754/float128/float128_private.h5
-rw-r--r--sysdeps/ieee754/float128/s_f32sqrtf128.c6
-rw-r--r--sysdeps/ieee754/float128/s_f64sqrtf128.c10
-rw-r--r--sysdeps/ieee754/float128/s_f64xsqrtf128.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_dsqrtl.c37
-rw-r--r--sysdeps/ieee754/ldbl-128/s_f64xsqrtf128.c38
-rw-r--r--sysdeps/ieee754/ldbl-128/s_fsqrtl.c33
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/Versions4
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_dsqrtl.c28
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/s_fsqrtl.c28
-rw-r--r--sysdeps/ieee754/ldbl-96/s_dsqrtl.c33
-rw-r--r--sysdeps/ieee754/ldbl-96/s_fsqrtl.c31
-rw-r--r--sysdeps/ieee754/ldbl-opt/Makefile4
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dsqrt.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fsqrt.c28
-rw-r--r--sysdeps/ieee754/soft-fp/s_dsqrtl.c67
-rw-r--r--sysdeps/ieee754/soft-fp/s_fsqrt.c54
-rw-r--r--sysdeps/ieee754/soft-fp/s_fsqrtl.c53
-rw-r--r--sysdeps/mach/hurd/i386/libm.abilist13
-rw-r--r--sysdeps/powerpc/fpu/libm-test-ulps3
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/multiarch/float128-ifunc-macros.h2
-rw-r--r--sysdeps/powerpc/powerpc64/le/fpu/multiarch/float128-ifunc.h6
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/arc/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/csky/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/i386/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist15
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv32/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libm.abilist6
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libm.abilist13
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist13
79 files changed, 5736 insertions, 92 deletions
diff --git a/NEWS b/NEWS
index 5b014fabbf..838381f562 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,13 @@ Major new features:
in various downstream distributions. The locale is not built into
glibc, and must be installed.
+* <math.h> functions that round their results to a narrower type, and
+ corresponding <tgmath.h> macros, are added from TS 18661-1:2014, TS
+ 18661-3:2015 and draft ISO C2X:
+
+ - fsqrt, fsqrtl, dsqrtl and corresponding fMsqrtfN, fMsqrtfNx,
+ fMxsqrtfN and fMxsqrtfNx functions.
+
Deprecated and removed features, and other changes affecting compatibility:
[Add deprecations, removals and changes affecting compatibility here]
diff --git a/manual/arith.texi b/manual/arith.texi
index 75eaf67fe7..edf1fd71f8 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -2270,6 +2270,25 @@ function without any intermediate rounding to the type of the
arguments.
@end deftypefun
+@deftypefun float fsqrt (double @var{x})
+@deftypefunx float fsqrtl (long double @var{x})
+@deftypefunx double dsqrtl (long double @var{x})
+@deftypefunx _FloatM fMsqrtfN (_Float@var{N} @var{x})
+@deftypefunx _FloatM fMsqrtfNx (_Float@var{N}x @var{x})
+@deftypefunx _FloatMx fMxsqrtfN (_Float@var{N} @var{x})
+@deftypefunx _FloatMx fMxsqrtfNx (_Float@var{N}x @var{x})
+@standards{TS 18661-1:2014, math.h}
+@standardsx{fMsqrtfN, TS 18661-3:2015, math.h}
+@standardsx{fMsqrtfNx, TS 18661-3:2015, math.h}
+@standardsx{fMxsqrtfN, TS 18661-3:2015, math.h}
+@standardsx{fMxsqrtfNx, TS 18661-3:2015, math.h}
+@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
+These functions, from TS 18661-1:2014 and TS 18661-3:2015, return the
+square root of @var{x}, rounded once to the return type of the
+function without any intermediate rounding to the type of the
+arguments.
+@end deftypefun
+
@node Complex Numbers
@section Complex Numbers
@pindex complex.h
diff --git a/math/Makefile b/math/Makefile
index ceb1eb2085..987e9841f9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -91,7 +91,7 @@ libm-compat-calls = \
w_lgammaF_r_compat w_lgammaF_compat2 w_expF_compat \
w_lgamma_compatF k_standardF
-libm-narrow-fns = add div mul sub
+libm-narrow-fns = add div mul sqrt sub
libm-narrow-types-basic = s_fF s_f32xFf64
libm-narrow-types-ldouble-yes = s_fFl s_dFl
libm-narrow-types-float128-yes = s_f32Ff128 s_f64Ff128 s_f64xFf128
@@ -299,7 +299,7 @@ libm-test-funcs-noauto = canonicalize ceil cimag conj copysign cproj creal \
significand totalorder totalordermag trunc ufromfp \
ufromfpx compat_totalorder compat_totalordermag
libm-test-funcs-compat = compat_totalorder compat_totalordermag
-libm-test-funcs-narrow = add div mul sub
+libm-test-funcs-narrow = add div mul sqrt sub
libm-test-funcs-all = $(libm-test-funcs-auto) $(libm-test-funcs-noauto)
libm-test-c-auto = $(foreach f,$(libm-test-funcs-auto),libm-test-$(f).c)
libm-test-c-noauto = $(foreach f,$(libm-test-funcs-noauto),libm-test-$(f).c)
@@ -664,6 +664,7 @@ CFLAGS-s_ctanh.c += -fno-builtin-ctanhl
CFLAGS-s_dadd.c += -fno-builtin-daddl
CFLAGS-s_ddiv.c += -fno-builtin-ddivl
CFLAGS-s_dmul.c += -fno-builtin-dmull
+CFLAGS-s_dsqrt.c += -fno-builtin-dsqrtl
CFLAGS-s_dsub.c += -fno-builtin-dsubl
CFLAGS-s_erf.c += -fno-builtin-erfl
CFLAGS-s_erfc.c += -fno-builtin-erfcl
@@ -687,6 +688,7 @@ CFLAGS-s_fmul.c += -fno-builtin-fmull
CFLAGS-s_frexp.c += -fno-builtin-frexpl
CFLAGS-s_fromfp.c += -fno-builtin-fromfpl
CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxl
+CFLAGS-s_fsqrt.c += -fno-builtin-fsqrtl
CFLAGS-s_fsub.c += -fno-builtin-fsubl
CFLAGS-s_gamma.c += -fno-builtin-gammal
CFLAGS-s_getpayload.c += -fno-builtin-getpayloadl
diff --git a/math/Versions b/math/Versions
index 5b3c321490..b121b454cd 100644
--- a/math/Versions
+++ b/math/Versions
@@ -593,4 +593,13 @@ libm {
GLIBC_2.32 {
exp10f;
}
+ GLIBC_2.35 {
+ # Functions not involving _Float64x or _Float128, for all configurations.
+ fsqrt; fsqrtl; dsqrtl;
+ f32sqrtf32x; f32sqrtf64; f32xsqrtf64;
+ # Functions involving _Float64x or _Float128, for some configurations.
+ f32sqrtf64x; f32sqrtf128;
+ f32xsqrtf64x; f32xsqrtf128; f64sqrtf64x; f64sqrtf128;