summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-opt
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:01:57 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:01:57 +0000
commitcab56836b146bc129f1ad43f0393d95a9deca63a (patch)
tree4f4e655319bbac78fca170da05275c127429b460 /sysdeps/ieee754/ldbl-opt
parent04ac1241a4cd004872282c2c82ec37fa33925292 (diff)
parent82dd75a7f436a19047325d62182590c9f9e23a78 (diff)
Merge branch 't/tls' into refs/top-bases/t/tls-threadvar
Diffstat (limited to 'sysdeps/ieee754/ldbl-opt')
-rw-r--r--sysdeps/ieee754/ldbl-opt/Makefile37
-rw-r--r--sysdeps/ieee754/ldbl-opt/Versions6
-rw-r--r--sysdeps/ieee754/ldbl-opt/bits/long-double.h24
-rw-r--r--sysdeps/ieee754/ldbl-opt/cabs.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cabsl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/carg.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cargl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cimag.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/cimagl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/conj.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/conjl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/creal.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/creall.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/libm-alias-double.h72
-rw-r--r--sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h69
-rw-r--r--sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h3
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-compat.c10
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-compat.h22
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dadd.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dmul.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-dsub.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fadd.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fmul.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-fsub.c28
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-llogb.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c27
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-nextup.c27
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-pow10.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c4
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c26
-rw-r--r--sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c2
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_asinh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_atan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacos.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacosh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cacosl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casin.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_casinl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catan.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_catanl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cbrt.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccos.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccosh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccoshl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ccosl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ceil.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cexp.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cexpl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog10.c31
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clog10l.c40
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_clogl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_copysign.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cpow.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cpowl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cproj.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_cprojl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csin.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csinl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csqrt.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_csqrtl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctan.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanh.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanhl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ctanl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_erf.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_expm1.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fabs.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdim.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdiml.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_floor.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fma.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmal.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmax.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmaxl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fmin.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fminl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_frexp.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexp.c31
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_ldexpl.c37
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_llrint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_llround.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_log1p.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_logb.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_lrint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_lround.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_modf.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nanl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nearbyint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nextafter.c3
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_remquo.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_rint.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_round.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_scalbln.c9
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_scalbn.c9
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_significand.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_significandl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_sin.c14
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_sincos.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_tan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_tanh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_trunc.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c1
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acos.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acosh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acoshl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_acosl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_asin.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_asinl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atan2.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atan2l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atanh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_atanhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_cosh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_coshl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10_compat.c8
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c17
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_fmod.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_fmodl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_hypot.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_hypotl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_ilogb.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_ilogbl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j0.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j0l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j1.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_j1l.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_jn.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_jnl.c6
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_lgamma_r.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_lgammal_r.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log10.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log10l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log2.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_log2l.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_logl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_pow.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_powl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainder_compat.c (renamed from sysdeps/ieee754/ldbl-opt/w_remainder.c)3
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainderl.c7
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c19
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalb_compat.c (renamed from sysdeps/ieee754/ldbl-opt/w_scalb.c)2
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c (renamed from sysdeps/ieee754/ldbl-opt/w_scalbl.c)2
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sinh.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sinhl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sqrt.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_sqrtl.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_tgamma.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/w_tgammal.c5
179 files changed, 1042 insertions, 783 deletions
diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
index 53091e410c..ef790adc77 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -24,11 +24,12 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
vdprintf_chk obstack_printf_chk obstack_vprintf_chk \
syslog syslog_chk vsyslog vsyslog_chk \
strfmon strfmon_l \
+ strfroml \
strtold strtold_l strtoldint wcstold wcstold_l wcstoldint \
qecvt qfcvt qgcvt qecvt_r qfcvt_r \
isinf isnan finite signbit scalb log2 lgamma_r ceil \
significand acos asin atan atan2 cos sin tan cosh sinh \
- tanh acosh asinh atanh exp log log10 exp10 pow10 expm1 \
+ tanh acosh asinh atanh exp log log10 exp10 expm1 \
log1p logb exp2 sqrt cbrt fabs floor j0 j1 y0 y1 erf erfc \
lgamma tgamma gamma rint nearbyint round trunc \
copysign fdim fmax fmin nextafter pow hypot fmod \
@@ -40,7 +41,11 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
isoc99_scanf isoc99_fscanf isoc99_sscanf \
isoc99_vscanf isoc99_vfscanf isoc99_vsscanf \
isoc99_wscanf isoc99_fwscanf isoc99_swscanf \
- isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf
+ isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf \
+ nextup nextdown totalorder totalordermag getpayload \
+ canonicalize setpayload setpayloadsig llogb fmaxmag fminmag \
+ roundeven fromfp ufromfp fromfpx ufromfpx fadd dadd \
+ fdiv ddiv fmul dmul fsub dsub
libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
libnldbl-inhibit-o = $(object-suffixes)
libnldbl-static-only-routines = $(libnldbl-routines)
@@ -56,6 +61,7 @@ CFLAGS-nldbl-atanh.c = -fno-builtin-atanhl
CFLAGS-nldbl-cabs.c = -fno-builtin-cabsl
CFLAGS-nldbl-cacos.c = -fno-builtin-cacosl
CFLAGS-nldbl-cacosh.c = -fno-builtin-cacoshl
+CFLAGS-nldbl-canonicalize.c = -fno-builtin-canonicalizel
CFLAGS-nldbl-carg.c = -fno-builtin-cargl
CFLAGS-nldbl-casin.c = -fno-builtin-casinl
CFLAGS-nldbl-casinh.c = -fno-builtin-casinhl
@@ -81,6 +87,10 @@ CFLAGS-nldbl-csinh.c = -fno-builtin-csinhl
CFLAGS-nldbl-csqrt.c = -fno-builtin-csqrtl
CFLAGS-nldbl-ctan.c = -fno-builtin-ctanl
CFLAGS-nldbl-ctanh.c = -fno-builtin-ctanhl
+CFLAGS-nldbl-dadd.c = -fno-builtin-daddl
+CFLAGS-nldbl-ddiv.c = -fno-builtin-ddivl
+CFLAGS-nldbl-dmul.c = -fno-builtin-dmull
+CFLAGS-nldbl-dsub.c = -fno-builtin-dsubl
CFLAGS-nldbl-erf.c = -fno-builtin-erfl
CFLAGS-nldbl-erfc.c = -fno-builtin-erfcl
CFLAGS-nldbl-exp.c = -fno-builtin-expl
@@ -88,15 +98,24 @@ CFLAGS-nldbl-exp10.c = -fno-builtin-exp10l
CFLAGS-nldbl-exp2.c = -fno-builtin-exp2l
CFLAGS-nldbl-expm1.c = -fno-builtin-expm1l
CFLAGS-nldbl-fabs.c = -fno-builtin-fabsl
+CFLAGS-nldbl-fadd.c = -fno-builtin-faddl
CFLAGS-nldbl-fdim.c = -fno-builtin-fdiml
+CFLAGS-nldbl-fdiv.c = -fno-builtin-fdivl
CFLAGS-nldbl-finite.c = -fno-builtin-finitel
CFLAGS-nldbl-floor.c = -fno-builtin-floorl
CFLAGS-nldbl-fma.c = -fno-builtin-fmal
CFLAGS-nldbl-fmax.c = -fno-builtin-fmaxl
+CFLAGS-nldbl-fmaxmag.c = -fno-builtin-fmaxmagl
CFLAGS-nldbl-fmin.c = -fno-builtin-fminl
+CFLAGS-nldbl-fminmag.c = -fno-builtin-fminmagl
CFLAGS-nldbl-fmod.c = -fno-builtin-fmodl
+CFLAGS-nldbl-fmul.c = -fno-builtin-fmull
CFLAGS-nldbl-frexp.c = -fno-builtin-frexpl
+CFLAGS-nldbl-fromfp.c = -fno-builtin-fromfpl
+CFLAGS-nldbl-fromfpx.c = -fno-builtin-fromfpxl
+CFLAGS-nldbl-fsub.c = -fno-builtin-fsubl
CFLAGS-nldbl-gamma.c = -fno-builtin-gammal
+CFLAGS-nldbl-getpayload.c = -fno-builtin-getpayloadl
CFLAGS-nldbl-hypot.c = -fno-builtin-hypotl
CFLAGS-nldbl-ilogb.c = -fno-builtin-ilogbl
CFLAGS-nldbl-isinf.c = -fno-builtin-isinfl
@@ -107,6 +126,7 @@ CFLAGS-nldbl-jn.c = -fno-builtin-jnl
CFLAGS-nldbl-ldexp.c = -fno-builtin-ldexpl
CFLAGS-nldbl-lgamma.c = -fno-builtin-lgammal
CFLAGS-nldbl-lgamma_r.c = -fno-builtin-lgammal_r
+CFLAGS-nldbl-llogb.c = -fno-builtin-llogbl
CFLAGS-nldbl-llrint.c = -fno-builtin-llrintl
CFLAGS-nldbl-llround.c = -fno-builtin-llroundl
CFLAGS-nldbl-log.c = -fno-builtin-logl
@@ -120,17 +140,21 @@ CFLAGS-nldbl-modf.c = -fno-builtin-modfl
CFLAGS-nldbl-nan.c = -fno-builtin-nanl
CFLAGS-nldbl-nearbyint.c = -fno-builtin-nearbyintl
CFLAGS-nldbl-nextafter.c = -fno-builtin-nextafterl
+CFLAGS-nldbl-nextdown.c = -fno-builtin-nextdownl
CFLAGS-nldbl-nexttoward.c = -fno-builtin-nexttoward -fno-builtin-nexttowardl
CFLAGS-nldbl-nexttowardf.c = -fno-builtin-nexttowardf
+CFLAGS-nldbl-nextup.c = -fno-builtin-nextupl
CFLAGS-nldbl-pow.c = -fno-builtin-powl
-CFLAGS-nldbl-pow10.c = -fno-builtin-pow10l
CFLAGS-nldbl-remainder.c = -fno-builtin-remainderl -fno-builtin-dreml
CFLAGS-nldbl-remquo.c = -fno-builtin-remquol
CFLAGS-nldbl-rint.c = -fno-builtin-rintl
CFLAGS-nldbl-round.c = -fno-builtin-roundl
+CFLAGS-nldbl-roundeven.c = -fno-builtin-roundevenl
CFLAGS-nldbl-scalb.c = -fno-builtin-scalbl
CFLAGS-nldbl-scalbln.c = -fno-builtin-scalblnl
CFLAGS-nldbl-scalbn.c = -fno-builtin-scalbnl
+CFLAGS-nldbl-setpayload.c = -fno-builtin-setpayloadl
+CFLAGS-nldbl-setpayloadsig.c = -fno-builtin-setpayloadsigl
CFLAGS-nldbl-significand.c = -fno-builtin-significandl
CFLAGS-nldbl-sin.c = -fno-builtin-sinl
CFLAGS-nldbl-sincos.c = -fno-builtin-sincosl
@@ -139,9 +163,16 @@ CFLAGS-nldbl-sqrt.c = -fno-builtin-sqrtl
CFLAGS-nldbl-tan.c = -fno-builtin-tanl
CFLAGS-nldbl-tanh.c = -fno-builtin-tanhl
CFLAGS-nldbl-tgamma.c = -fno-builtin-tgammal
+CFLAGS-nldbl-totalorder.c = -fno-builtin-totalorderl
+CFLAGS-nldbl-totalordermag.c = -fno-builtin-totalordermagl
CFLAGS-nldbl-trunc.c = -fno-builtin-truncl
+CFLAGS-nldbl-ufromfp.c = -fno-builtin-ufromfpl
+CFLAGS-nldbl-ufromfpx.c = -fno-builtin-ufromfpxl
CFLAGS-nldbl-y0.c = -fno-builtin-y0l
CFLAGS-nldbl-y1.c = -fno-builtin-y1l
CFLAGS-nldbl-yn.c = -fno-builtin-ynl
+tests += test-narrow-macros-ldbl-64
+CFLAGS-test-narrow-macros-ldbl-64.c += -mlong-double-64
+
endif
diff --git a/sysdeps/ieee754/ldbl-opt/Versions b/sysdeps/ieee754/ldbl-opt/Versions
index d3f0beaef2..af0c4a098c 100644
--- a/sysdeps/ieee754/ldbl-opt/Versions
+++ b/sysdeps/ieee754/ldbl-opt/Versions
@@ -97,4 +97,10 @@ libm {
sincosl; tanl; tanhl; truncl; expl; __finitel; __signbitl;
__fpclassifyl; nexttowardf; nexttoward; __nldbl_nexttowardf;
}
+ GLIBC_2.28 {
+ # Functions taking long double = double argument and rounding
+ # result to double (same as f32x*f64 functions, but those names
+ # are not reserved in TS 18661-1).
+ __nldbl_daddl; __nldbl_ddivl; __nldbl_dmull; __nldbl_dsubl;
+ }
}
diff --git a/sysdeps/ieee754/ldbl-opt/bits/long-double.h b/sysdeps/ieee754/ldbl-opt/bits/long-double.h
new file mode 100644
index 0000000000..69b33890ff
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/bits/long-double.h
@@ -0,0 +1,24 @@
+/* Properties of long double type. ldbl-opt version.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef __NO_LONG_DOUBLE_MATH
+# define __LONG_DOUBLE_MATH_OPTIONAL 1
+# ifndef __LONG_DOUBLE_128__
+# define __NO_LONG_DOUBLE_MATH 1
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cabs.c b/sysdeps/ieee754/ldbl-opt/cabs.c
deleted file mode 100644
index a181de2fa8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cabs.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/cabs.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cabs, cabsl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cabsl.c b/sysdeps/ieee754/ldbl-opt/cabsl.c
deleted file mode 100644
index b861633544..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cabsl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cabsl.c>
-long_double_symbol (libm, __cabsl, cabsl);
diff --git a/sysdeps/ieee754/ldbl-opt/carg.c b/sysdeps/ieee754/ldbl-opt/carg.c
deleted file mode 100644
index 2ed358113c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/carg.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/carg.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __carg, cargl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cargl.c b/sysdeps/ieee754/ldbl-opt/cargl.c
deleted file mode 100644
index 952dc60664..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cargl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cargl.c>
-long_double_symbol (libm, __cargl, cargl);
diff --git a/sysdeps/ieee754/ldbl-opt/cimag.c b/sysdeps/ieee754/ldbl-opt/cimag.c
deleted file mode 100644
index f8052581b3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cimag.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/cimag.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cimag, cimagl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/cimagl.c b/sysdeps/ieee754/ldbl-opt/cimagl.c
deleted file mode 100644
index 112365e3ae..0000000000
--- a/sysdeps/ieee754/ldbl-opt/cimagl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/cimagl.c>
-long_double_symbol (libm, __cimagl, cimagl);
diff --git a/sysdeps/ieee754/ldbl-opt/conj.c b/sysdeps/ieee754/ldbl-opt/conj.c
deleted file mode 100644
index e4edade05e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/conj.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/conj.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __conj, conjl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/conjl.c b/sysdeps/ieee754/ldbl-opt/conjl.c
deleted file mode 100644
index c98e0ed1c3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/conjl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/conjl.c>
-long_double_symbol (libm, __conjl, conjl);
diff --git a/sysdeps/ieee754/ldbl-opt/creal.c b/sysdeps/ieee754/ldbl-opt/creal.c
deleted file mode 100644
index 0d1c93e640..0000000000
--- a/sysdeps/ieee754/ldbl-opt/creal.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/creal.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __creal, creall, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/creall.c b/sysdeps/ieee754/ldbl-opt/creall.c
deleted file mode 100644
index 68fedd4ccd..0000000000
--- a/sysdeps/ieee754/ldbl-opt/creall.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/creall.c>
-long_double_symbol (libm, __creall, creall);
diff --git a/sysdeps/ieee754/ldbl-opt/libm-alias-double.h b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h
new file mode 100644
index 0000000000..95f810f4eb
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/libm-alias-double.h
@@ -0,0 +1,72 @@
+/* Define aliases for libm double functions. ldbl-opt version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBM_ALIAS_DOUBLE_H
+#define _LIBM_ALIAS_DOUBLE_H
+
+#include <bits/floatn.h>
+#include <math_ldbl_opt.h>
+#include <first-versions.h>
+#include <ldbl-compat-choose.h>
+
+#if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# define libm_alias_double_other_r_f64(from, to, r) \
+ weak_alias (from ## r, to ## f64 ## r)
+#else
+# define libm_alias_double_other_r_f64(from, to, r)
+#endif
+
+#if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# define libm_alias_double_other_r_f32x(from, to, r) \
+ weak_alias (from ## r, to ## f32x ## r)
+#else
+# define libm_alias_double_other_r_f32x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a double libm function that
+ has internal name FROM ## R and public names TO ## suffix ## R for
+ each suffix of a supported _FloatN / _FloatNx floating-point type
+ with the same format as double. */
+#define libm_alias_double_other_r(from, to, r) \
+ libm_alias_double_other_r_f64 (from, to, r); \
+ libm_alias_double_other_r_f32x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double_other(from, to) \
+ libm_alias_double_other_r (from, to, )
+
+/* Define aliases for a double libm function that has internal name
+ FROM ## R and public names TO ## suffix ## R for each suffix of a
+ supported floating-point type with the same format as double. This
+ should only be used for functions where such public names exist for
+ _FloatN types, not for implementation-namespace exported names
+ (where there is one name per format, not per type) or for
+ obsolescent functions not provided for _FloatN types. */
+#define libm_alias_double_r(from, to, r) \
+ weak_alias (from ## r, to ## r); \
+ LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \
+ (compat_symbol (libm, \
+ from ## r, \
+ to ## l ## r, \
+ FIRST_VERSION_libm_ ## to ## l ## r), ); \
+ libm_alias_double_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_double(from, to) libm_alias_double_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h b/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h
new file mode 100644
index 0000000000..df9172b333
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h
@@ -0,0 +1,69 @@
+/* Define aliases for libm long double functions. ldbl-opt version.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBM_ALIAS_LDOUBLE_H
+#define _LIBM_ALIAS_LDOUBLE_H
+
+#include <bits/floatn.h>
+#include <math_ldbl_opt.h>
+#include <ldbl-compat-choose.h>
+
+#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
+# define libm_alias_ldouble_other_r_f128(from, to, r) \
+ weak_alias (from ## l ## r, to ## f128 ## r)
+#else
+# define libm_alias_ldouble_other_r_f128(from, to, r)
+#endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define libm_alias_ldouble_other_r_f64x(from, to, r) \
+ weak_alias (from ## l ## r, to ## f64x ## r)
+#else
+# define libm_alias_ldouble_other_r_f64x(from, to, r)
+#endif
+
+/* Define _FloatN / _FloatNx aliases for a long double libm function
+ that has internal name FROM ## l ## R and public names TO ## suffix
+ ## R for each suffix of a supported _FloatN / _FloatNx
+ floating-point type with the same format as long double. */
+#define libm_alias_ldouble_other_r(from, to, r) \
+ libm_alias_ldouble_other_r_f128 (from, to, r); \
+ libm_alias_ldouble_other_r_f64x (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble_other(from, to) \
+ libm_alias_ldouble_other_r (from, to, )
+
+/* Define aliases for a long double libm function that has internal
+ name FROM ## l ## R and public names TO ## suffix ## R for each
+ suffix of a supported floating-point type with the same format as
+ long double. This should only be used for functions where such
+ public names exist for _FloatN types, not for
+ implementation-namespace exported names (where there is one name
+ per format, not per type) or for obsolescent functions not provided
+ for _FloatN types. */
+#define libm_alias_ldouble_r(from, to, r) \
+ LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \
+ (long_double_symbol (libm, from ## l ## r, to ## l ## r), \
+ weak_alias (from ## l ## r, to ## l ## r)); \
+ libm_alias_ldouble_other_r (from, to, r)
+
+/* Likewise, but without the R suffix. */
+#define libm_alias_ldouble(from, to) libm_alias_ldouble_r (from, to, )
+
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
index af861c11ea..61ba784f86 100644
--- a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
+++ b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
@@ -36,9 +36,6 @@
#endif
#ifndef __ASSEMBLER__
-# include <math.h>
-# include <math_private.h>
-
/* Set temporarily to non-zero if long double should be considered
the same as double. */
extern __thread int __no_long_double attribute_tls_model_ie attribute_hidden;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c b/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c
new file mode 100644
index 0000000000..a65d87458d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-canonicalize.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for canonicalize.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+canonicalizel (double *cx, double *x)
+{
+ return canonicalize (cx, x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
index 35b7a69945..ffb5fabebe 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -1,5 +1,5 @@
/* *printf* family compatibility routines for IEEE double as long double
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <libioP.h>
+#include <math.h>
#include <wchar.h>
#include <printf.h>
#include <monetary.h>
@@ -333,8 +334,7 @@ __nldbl_wprintf (const wchar_t *fmt, ...)
int
attribute_compat_text_section
-__nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
- int *errp)
+__nldbl__IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
int res;
set_no_long_double ();
@@ -790,7 +790,7 @@ __nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
ssize_t
attribute_compat_text_section
-__nldbl___strfmon_l (char *s, size_t maxsize, __locale_t loc,
+__nldbl___strfmon_l (char *s, size_t maxsize, locale_t loc,
const char *format, ...)
{
va_list ap;
@@ -818,7 +818,7 @@ libc_hidden_def (__nldbl___vstrfmon)
ssize_t
attribute_compat_text_section
-__nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
+__nldbl___vstrfmon_l (char *s, size_t maxsize, locale_t loc,
const char *format, va_list ap)
{
ssize_t res;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
index 0c3c5ad24d..888f561cac 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
@@ -1,5 +1,5 @@
/* Prototypes for compatibility double == long double entry points.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
@@ -24,6 +24,7 @@
#define __NO_LONG_DOUBLE_MATH 1
#include <stdarg.h>
#include <stdlib.h>
+#include <stdint.h>
#include <stdio.h>
#include <printf.h>
#include <wchar.h>
@@ -81,23 +82,30 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)
/* These don't use __typeof because they were not declared by the headers,
since we don't compile with _FORTIFY_SOURCE. */
extern int __nldbl___vfprintf_chk (FILE *__restrict, int,
- const char *__restrict, _G_va_list);
+ const char *__restrict, __gnuc_va_list);
extern int __nldbl___vfwprintf_chk (FILE *__restrict, int,
const wchar_t *__restrict, __gnuc_va_list);
extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t,
- const char *__restrict, _G_va_list) __THROW;
+ const char *__restrict, __gnuc_va_list)
+ __THROW;
extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t,
- const char *__restrict, _G_va_list)
+ const char *__restrict, __gnuc_va_list)
__THROW;
extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t,
const wchar_t *__restrict, __gnuc_va_list)
__THROW;
-extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list)
+extern int __nldbl___vasprintf_chk (char **, int, const char *, __gnuc_va_list)
__THROW;
-extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list);
+extern int __nldbl___vdprintf_chk (int, int, const char *, __gnuc_va_list);
extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *,
- _G_va_list) __THROW;
+ __gnuc_va_list) __THROW;
extern void __nldbl___vsyslog_chk (int, int, const char *, va_list);
+/* The original declarations of these were hidden by the including
+ file. */
+extern double __nldbl_daddl (double, double) __THROW;
+extern double __nldbl_ddivl (double, double) __THROW;
+extern double __nldbl_dmull (double, double) __THROW;
+extern double __nldbl_dsubl (double, double) __THROW;
#endif /* __NLDBL_COMPAT_H */
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c b/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c
new file mode 100644
index 0000000000..acbcb3ff75
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dadd.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dadd.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define daddl __hide_daddl
+#include "nldbl-compat.h"
+#undef daddl
+
+double
+attribute_hidden
+daddl (double x, double y)
+{
+ return __nldbl_daddl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c b/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c
new file mode 100644
index 0000000000..5cb4606b7d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for ddiv.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define ddivl __hide_ddivl
+#include "nldbl-compat.h"
+#undef ddivl
+
+double
+attribute_hidden
+ddivl (double x, double y)
+{
+ return __nldbl_ddivl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c b/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c
new file mode 100644
index 0000000000..9c9b94e067
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dmul.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dmul.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define dmull __hide_dmull
+#include "nldbl-compat.h"
+#undef dmull
+
+double
+attribute_hidden
+dmull (double x, double y)
+{
+ return __nldbl_dmull (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c b/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c
new file mode 100644
index 0000000000..1d31a75f13
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-dsub.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for dsub.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define dsubl __hide_dsubl
+#include "nldbl-compat.h"
+#undef dsubl
+
+double
+attribute_hidden
+dsubl (double x, double y)
+{
+ return __nldbl_dsubl (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c b/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c
new file mode 100644
index 0000000000..c31a6db475
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fadd.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fadd.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define faddl __hide_faddl
+#include "nldbl-compat.h"
+#undef faddl
+
+float
+attribute_hidden
+faddl (double x, double y)
+{
+ return fadd (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c b/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c
new file mode 100644
index 0000000000..2d043fc721
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fdiv.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define fdivl __hide_fdivl
+#include "nldbl-compat.h"
+#undef fdivl
+
+float
+attribute_hidden
+fdivl (double x, double y)
+{
+ return fdiv (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c b/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c
new file mode 100644
index 0000000000..774ed88a63
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fmaxmag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fmaxmag.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+fmaxmagl (double x, double y)
+{
+ return fmaxmag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c b/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c
new file mode 100644
index 0000000000..66dff4f3ff
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fminmag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fminmag.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+fminmagl (double x, double y)
+{
+ return fminmag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c b/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c
new file mode 100644
index 0000000000..2520d1b014
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fmul.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fmul.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define fmull __hide_fmull
+#include "nldbl-compat.h"
+#undef fmull
+
+float
+attribute_hidden
+fmull (double x, double y)
+{
+ return fmul (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c b/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c
new file mode 100644
index 0000000000..59db6a9819
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fromfp.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+intmax_t
+attribute_hidden
+fromfpl (double x, int round, unsigned int width)
+{
+ return fromfp (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c b/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c
new file mode 100644
index 0000000000..f8df721ff9
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for fromfpx.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+intmax_t
+attribute_hidden
+fromfpxl (double x, int round, unsigned int width)
+{
+ return fromfpx (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c b/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c
new file mode 100644
index 0000000000..36dfe11a75
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fsub.c
@@ -0,0 +1,28 @@
+/* Compatibility routine for IEEE double as long double for fsub.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define fsubl __hide_fsubl
+#include "nldbl-compat.h"
+#undef fsubl
+
+float
+attribute_hidden
+fsubl (double x, double y)
+{
+ return fsub (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c b/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c
new file mode 100644
index 0000000000..425afebc52
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-getpayload.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for getpayload.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+getpayloadl (const double *x)
+{
+ return getpayload (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
index 05581c0354..442c11c203 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c
@@ -2,7 +2,7 @@
int
attribute_hidden
-_IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap, int *errp)
+_IO_vfscanf (FILE *s, const char *fmt, va_list ap, int *errp)
{
return __nldbl__IO_vfscanf (s, fmt, ap, errp);
}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c b/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c
new file mode 100644
index 0000000000..d0dcf35f2d
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-llogb.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for llogb.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+long int
+attribute_hidden
+llogbl (double x)
+{
+ return llogb (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c b/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c
new file mode 100644
index 0000000000..30f7f253f3
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-nextdown.c
@@ -0,0 +1,27 @@
+/* Compatibility routine for IEEE double as long double for nextdown.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+/* Return the greatest floating-point number less than X. */
+double
+attribute_hidden
+nextdownl (double x)
+{
+ return nextdown (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c b/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c
new file mode 100644
index 0000000000..1f04fedbdd
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-nextup.c
@@ -0,0 +1,27 @@
+/* Compatibility routine for IEEE double as long double for nextup.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+/* Return the least floating-point number greater than X. */
+double
+attribute_hidden
+nextupl (double x)
+{
+ return nextup (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c b/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c
deleted file mode 100644
index 20ebf8d1bb..0000000000
--- a/sysdeps/ieee754/ldbl-opt/nldbl-pow10.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "nldbl-compat.h"
-
-double
-attribute_hidden
-pow10l (double x)
-{
- return pow10 (x);
-}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c b/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c
new file mode 100644
index 0000000000..ccafa45af1
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for roundeven.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+roundevenl (double x)
+{
+ return roundeven (x);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c b/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c
new file mode 100644
index 0000000000..810e329454
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-setpayload.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for setpayload.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+setpayloadl (double *x, double payload)
+{
+ return setpayload (x, payload);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c b/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c
new file mode 100644
index 0000000000..c510f3ea0b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-setpayloadsig.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for setpayloadsig.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+setpayloadsigl (double *x, double payload)
+{
+ return setpayloadsig (x, payload);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
index 0db0e8c42f..9281e17a37 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c
@@ -2,7 +2,7 @@
ssize_t
attribute_hidden
-__strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
+__strfmon_l (char *s, size_t maxsize, locale_t loc, const char *format, ...)
{
va_list ap;
ssize_t res;
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c b/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c
new file mode 100644
index 0000000000..d6df69e418
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strfroml.c
@@ -0,0 +1,8 @@
+#include "nldbl-compat.h"
+
+int
+attribute_hidden
+strfroml (char *dest, size_t size, const char *format, long double f)
+{
+ return strfromd (dest, size, format, f);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
index 33ff1ca5b5..29ad60c8a5 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c
@@ -8,11 +8,11 @@
extern double
__strtod_l (const char *__restrict __nptr, char **__restrict __endptr,
- __locale_t __loc);
+ locale_t __loc);
double
attribute_hidden
-__strtold_l (const char *nptr, char **endptr, __locale_t loc)
+__strtold_l (const char *nptr, char **endptr, locale_t loc)
{
return __strtod_l (nptr, endptr, loc);
}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
new file mode 100644
index 0000000000..52aaa4618b
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for totalorder.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+totalorderl (double x, double y)
+{
+ return totalorder (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c b/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c
new file mode 100644
index 0000000000..0a8860b53f
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for totalordermag.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+double
+attribute_hidden
+totalordermagl (double x, double y)
+{
+ return totalordermag (x, y);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c
new file mode 100644
index 0000000000..a7b6835ce6
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for ufromfp.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+uintmax_t
+attribute_hidden
+ufromfpl (double x, int round, unsigned int width)
+{
+ return ufromfp (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c
new file mode 100644
index 0000000000..61eea00996
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c
@@ -0,0 +1,26 @@
+/* Compatibility routine for IEEE double as long double for ufromfpx.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "nldbl-compat.h"
+
+uintmax_t
+attribute_hidden
+ufromfpxl (double x, int round, unsigned int width)
+{
+ return ufromfpx (x, round, width);
+}
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c b/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
index e32d13a94b..7004ae79f4 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c
@@ -6,7 +6,7 @@
double
attribute_hidden
-__wcstold_l (const wchar_t *nptr, wchar_t **endptr, __locale_t loc)
+__wcstold_l (const wchar_t *nptr, wchar_t **endptr, locale_t loc)
{
return __wcstod_l (nptr, endptr, loc);
}
diff --git a/sysdeps/ieee754/ldbl-opt/s_asinh.c b/sysdeps/ieee754/ldbl-opt/s_asinh.c
deleted file mode 100644
index e9bcfaea62..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_asinh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_asinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __asinh, asinhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_atan.c b/sysdeps/ieee754/ldbl-opt/s_atan.c
deleted file mode 100644
index 5fbd5e62d6..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_atan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_atan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, atan, atanl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacos.c b/sysdeps/ieee754/ldbl-opt/s_cacos.c
deleted file mode 100644
index db90a9ef18..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacos.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cacos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cacos, cacosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacosh.c b/sysdeps/ieee754/ldbl-opt/s_cacosh.c
deleted file mode 100644
index e68049d46d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacosh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cacosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cacosh, cacoshl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacoshl.c b/sysdeps/ieee754/ldbl-opt/s_cacoshl.c
deleted file mode 100644
index ed4a299845..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacoshl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cacoshl.c>
-long_double_symbol (libm, __cacoshl, cacoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cacosl.c b/sysdeps/ieee754/ldbl-opt/s_cacosl.c
deleted file mode 100644
index 9b840054e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cacosl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cacosl.c>
-long_double_symbol (libm, __cacosl, cacosl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_casin.c b/sysdeps/ieee754/ldbl-opt/s_casin.c
deleted file mode 100644
index 04c47ca602..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casin.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_casin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __casin, casinl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinh.c b/sysdeps/ieee754/ldbl-opt/s_casinh.c
deleted file mode 100644
index 19c4fa30f8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_casinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __casinh, casinhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinhl.c b/sysdeps/ieee754/ldbl-opt/s_casinhl.c
deleted file mode 100644
index 976fa8e5b0..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_casinhl.c>
-long_double_symbol (libm, __casinhl, casinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_casinl.c b/sysdeps/ieee754/ldbl-opt/s_casinl.c
deleted file mode 100644
index 7afb77cd4d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_casinl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_casinl.c>
-long_double_symbol (libm, __casinl, casinl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_catan.c b/sysdeps/ieee754/ldbl-opt/s_catan.c
deleted file mode 100644
index 19f61736d2..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catan.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_catan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __catan, catanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanh.c b/sysdeps/ieee754/ldbl-opt/s_catanh.c
deleted file mode 100644
index cff7861444..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_catanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __catanh, catanhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanhl.c b/sysdeps/ieee754/ldbl-opt/s_catanhl.c
deleted file mode 100644
index e9562825e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_catanhl.c>
-long_double_symbol (libm, __catanhl, catanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_catanl.c b/sysdeps/ieee754/ldbl-opt/s_catanl.c
deleted file mode 100644
index ee2fdf5d6c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_catanl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_catanl.c>
-long_double_symbol (libm, __catanl, catanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cbrt.c b/sysdeps/ieee754/ldbl-opt/s_cbrt.c
deleted file mode 100644
index cdc635771e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cbrt.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_cbrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __cbrt, cbrtl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccos.c b/sysdeps/ieee754/ldbl-opt/s_ccos.c
deleted file mode 100644
index 2c43c7f392..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccos.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ccos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ccos, ccosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccosh.c b/sysdeps/ieee754/ldbl-opt/s_ccosh.c
deleted file mode 100644
index 3753cd56bc..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccosh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ccosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ccosh, ccoshl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccoshl.c b/sysdeps/ieee754/ldbl-opt/s_ccoshl.c
deleted file mode 100644
index 9f0c1e1a32..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccoshl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ccoshl.c>
-long_double_symbol (libm, __ccoshl, ccoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ccosl.c b/sysdeps/ieee754/ldbl-opt/s_ccosl.c
deleted file mode 100644
index e93e80538e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ccosl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ccosl.c>
-long_double_symbol (libm, __ccosl, ccosl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ceil.c b/sysdeps/ieee754/ldbl-opt/s_ceil.c
deleted file mode 100644
index 6e4b70795d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ceil.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_ceil.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ceil, ceill, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cexp.c b/sysdeps/ieee754/ldbl-opt/s_cexp.c
deleted file mode 100644
index d983c96b7b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cexp.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cexp.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cexp, cexpl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cexpl.c b/sysdeps/ieee754/ldbl-opt/s_cexpl.c
deleted file mode 100644
index d5ae1fc0d0..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cexpl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cexpl.c>
-long_double_symbol (libm, __cexpl, cexpl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog.c b/sysdeps/ieee754/ldbl-opt/s_clog.c
deleted file mode 100644
index 3e0e90cf89..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_clog.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_clog.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __clog, clogl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog10.c b/sysdeps/ieee754/ldbl-opt/s_clog10.c
index ac3f4a3a71..1ce017392c 100644
--- a/sysdeps/ieee754/ldbl-opt/s_clog10.c
+++ b/sysdeps/ieee754/ldbl-opt/s_clog10.c
@@ -1,7 +1,28 @@
-#include <complex.h>
+/* Define __clog10l compat symbol for clog10 for ldbl-opt.
+ Copyright (C) 2017-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
#include <math_ldbl_opt.h>
-#include <math/s_clog10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __clog10, __clog10l, GLIBC_2_1);
-compat_symbol (libm, clog10, clog10l, GLIBC_2_1);
+#include <first-versions.h>
+#include <math-type-macros-double.h>
+
+#include <s_clog10_template.c>
+
+#if LONG_DOUBLE_COMPAT (libm, FIRST_VERSION_libm___clog10l)
+strong_alias (__clog10, __clog10l_alias)
+compat_symbol (libm, __clog10l_alias, __clog10l, FIRST_VERSION_libm___clog10l);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_clog10l.c b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
index 954f68095a..77e1dc3812 100644
--- a/sysdeps/ieee754/ldbl-opt/s_clog10l.c
+++ b/sysdeps/ieee754/ldbl-opt/s_clog10l.c
@@ -1,10 +1,32 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#define __clog10l __clog10l_internal
-#include <math/s_clog10l.c>
-#undef __clog10l
-strong_alias (__clog10l_internal, __clog10l__internal)
+/* clog10l alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define M_DECL_FUNC(x) __clog10l_internal
+#include <math-type-macros-ldouble.h>
+
+#undef declare_mgen_alias
+#define declare_mgen_alias(from, to)
+
+#include <s_clog10_template.c>
+
+/* __clog10l is also a public symbol. */
+strong_alias (__clog10l_internal, __clog10_internal_l)
long_double_symbol (libm, __clog10l_internal, __clog10l);
-long_double_symbol (libm, __clog10l__internal, clog10l);
+long_double_symbol (libm, __clog10_internal_l, clog10l);
+libm_alias_ldouble_other (__clog10_internal_, clog10)
diff --git a/sysdeps/ieee754/ldbl-opt/s_clogl.c b/sysdeps/ieee754/ldbl-opt/s_clogl.c
deleted file mode 100644
index 75126c8b89..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_clogl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_clogl.c>
-long_double_symbol (libm, __clogl, clogl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_copysign.c b/sysdeps/ieee754/ldbl-opt/s_copysign.c
index f4303f5768..8d42a181df 100644
--- a/sysdeps/ieee754/ldbl-opt/s_copysign.c
+++ b/sysdeps/ieee754/ldbl-opt/s_copysign.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_copysign.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cpow.c b/sysdeps/ieee754/ldbl-opt/s_cpow.c
deleted file mode 100644
index 4801d7cdf9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cpow.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cpow.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cpow, cpowl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cpowl.c b/sysdeps/ieee754/ldbl-opt/s_cpowl.c
deleted file mode 100644
index 61840e3381..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cpowl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cpowl.c>
-long_double_symbol (libm, __cpowl, cpowl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_cproj.c b/sysdeps/ieee754/ldbl-opt/s_cproj.c
deleted file mode 100644
index f298c3795a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cproj.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_cproj.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __cproj, cprojl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_cprojl.c b/sysdeps/ieee754/ldbl-opt/s_cprojl.c
deleted file mode 100644
index 1cc058007e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_cprojl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_cprojl.c>
-long_double_symbol (libm, __cprojl, cprojl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csin.c b/sysdeps/ieee754/ldbl-opt/s_csin.c
deleted file mode 100644
index 7017c95450..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csin.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csin, csinl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinh.c b/sysdeps/ieee754/ldbl-opt/s_csinh.c
deleted file mode 100644
index a1fa6671db..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csinh, csinhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinhl.c b/sysdeps/ieee754/ldbl-opt/s_csinhl.c
deleted file mode 100644
index 484d466ce8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csinhl.c>
-long_double_symbol (libm, __csinhl, csinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csinl.c b/sysdeps/ieee754/ldbl-opt/s_csinl.c
deleted file mode 100644
index f71642e886..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csinl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csinl.c>
-long_double_symbol (libm, __csinl, csinl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_csqrt.c b/sysdeps/ieee754/ldbl-opt/s_csqrt.c
deleted file mode 100644
index 2b6dcfe010..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csqrt.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_csqrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __csqrt, csqrtl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_csqrtl.c b/sysdeps/ieee754/ldbl-opt/s_csqrtl.c
deleted file mode 100644
index 045ff93e43..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_csqrtl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_csqrtl.c>
-long_double_symbol (libm, __csqrtl, csqrtl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctan.c b/sysdeps/ieee754/ldbl-opt/s_ctan.c
deleted file mode 100644
index a6a21f9f23..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctan.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ctan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ctan, ctanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanh.c b/sysdeps/ieee754/ldbl-opt/s_ctanh.c
deleted file mode 100644
index fd4be129f8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#include <math/s_ctanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __ctanh, ctanhl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanhl.c b/sysdeps/ieee754/ldbl-opt/s_ctanhl.c
deleted file mode 100644
index f159373b39..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanhl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ctanhl.c>
-long_double_symbol (libm, __ctanhl, ctanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_ctanl.c b/sysdeps/ieee754/ldbl-opt/s_ctanl.c
deleted file mode 100644
index 0c2d94cf49..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_ctanl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <complex.h>
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ctanl.c>
-long_double_symbol (libm, __ctanl, ctanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_erf.c b/sysdeps/ieee754/ldbl-opt/s_erf.c
deleted file mode 100644
index 76f1baa5ca..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_erf.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_erf.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __erf, erfl, GLIBC_2_0);
-compat_symbol (libm, __erfc, erfcl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_expm1.c b/sysdeps/ieee754/ldbl-opt/s_expm1.c
deleted file mode 100644
index ef9b5956db..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_expm1.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_expm1.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __expm1, expm1l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fabs.c b/sysdeps/ieee754/ldbl-opt/s_fabs.c
deleted file mode 100644
index e7c92187e9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fabs.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_fabs.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fabs, fabsl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fdim.c b/sysdeps/ieee754/ldbl-opt/s_fdim.c
deleted file mode 100644
index 02c95bfa81..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fdim.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fdim.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fdim, fdiml, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fdiml.c b/sysdeps/ieee754/ldbl-opt/s_fdiml.c
deleted file mode 100644
index 06b760b7b4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fdiml.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fdiml.c>
-long_double_symbol (libm, __fdiml, fdiml);
diff --git a/sysdeps/ieee754/ldbl-opt/s_floor.c b/sysdeps/ieee754/ldbl-opt/s_floor.c
deleted file mode 100644
index 7797944e9e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_floor.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_floor.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __floor, floorl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fma.c b/sysdeps/ieee754/ldbl-opt/s_fma.c
deleted file mode 100644
index 1723c5c306..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fma, fmal, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmal.c b/sysdeps/ieee754/ldbl-opt/s_fmal.c
deleted file mode 100644
index bd12dabcbe..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fmal.c>
-long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmax.c b/sysdeps/ieee754/ldbl-opt/s_fmax.c
deleted file mode 100644
index 11e759121f..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmax.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fmax.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmaxl.c b/sysdeps/ieee754/ldbl-opt/s_fmaxl.c
deleted file mode 100644
index 98221b2cdc..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmaxl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fmaxl.c>
-long_double_symbol (libm, __fmaxl, fmaxl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_fmin.c b/sysdeps/ieee754/ldbl-opt/s_fmin.c
deleted file mode 100644
index c3fe44d9d9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fmin.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_fmin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_fminl.c b/sysdeps/ieee754/ldbl-opt/s_fminl.c
deleted file mode 100644
index 9bfdc7ad79..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_fminl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_fminl.c>
-long_double_symbol (libm, __fminl, fminl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_frexp.c b/sysdeps/ieee754/ldbl-opt/s_frexp.c
index 0e3a5e0830..b0bfde3093 100644
--- a/sysdeps/ieee754/ldbl-opt/s_frexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_frexp.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_frexp.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __frexp, frexpl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __frexp, frexpl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexp.c b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
index 20e107be7e..94417193f5 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexp.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexp.c
@@ -1,9 +1,26 @@
-#include <math_ldbl_opt.h>
-#include <math/s_ldexp.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ldexp, ldexpl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+/* ldexp alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <math-type-macros-double.h>
+#include <s_ldexp_template.c>
+
+#if IS_IN (libc) && LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __ldexp, ldexpl, GLIBC_2_0);
+compat_symbol (libc, __wrap_scalbn, scalbnl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
index ed87a92b96..8a60b03987 100644
--- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
+++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c
@@ -1,12 +1,29 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_ldexpl.c>
-strong_alias (__ldexpl, __ldexpl_2)
-#if IS_IN (libm)
-long_double_symbol (libm, __ldexpl, ldexpl);
-long_double_symbol (libm, __ldexpl_2, scalbnl);
-#else
+/* ldexpl alias overrides for platforms where long double
+ was previously not unique.
+ Copyright (C) 2016-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#if IS_IN (libc)
+# define declare_mgen_alias(f,t)
+#endif
+#include <math-type-macros-ldouble.h>
+#include <s_ldexp_template.c>
+
+#if IS_IN (libc)
long_double_symbol (libc, __ldexpl, ldexpl);
-long_double_symbol (libc, __ldexpl_2, scalbnl);
+long_double_symbol (libc, __wrap_scalbnl, scalbnl);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_llrint.c b/sysdeps/ieee754/ldbl-opt/s_llrint.c
deleted file mode 100644
index e6311972e1..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_llrint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_llrint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_llround.c b/sysdeps/ieee754/ldbl-opt/s_llround.c
deleted file mode 100644
index 36c7e6edac..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_llround.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_llround.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_log1p.c b/sysdeps/ieee754/ldbl-opt/s_log1p.c
deleted file mode 100644
index 495fa32e35..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_log1p.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_log1p.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log1p, log1pl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_logb.c b/sysdeps/ieee754/ldbl-opt/s_logb.c
deleted file mode 100644
index 4d7a6db275..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_logb.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_logb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __logb, logbl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_lrint.c b/sysdeps/ieee754/ldbl-opt/s_lrint.c
deleted file mode 100644
index b7af812846..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_lrint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_lrint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_lround.c b/sysdeps/ieee754/ldbl-opt/s_lround.c
deleted file mode 100644
index f3a27fa9c9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_lround.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_lround.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_modf.c b/sysdeps/ieee754/ldbl-opt/s_modf.c
index 93acb43ae6..268a728e9b 100644
--- a/sysdeps/ieee754/ldbl-opt/s_modf.c
+++ b/sysdeps/ieee754/ldbl-opt/s_modf.c
@@ -1,9 +1,5 @@
#include <math_ldbl_opt.h>
#include <sysdeps/ieee754/dbl-64/s_modf.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __modf, modfl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
compat_symbol (libc, __modf, modfl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nan.c b/sysdeps/ieee754/ldbl-opt/s_nan.c
deleted file mode 100644
index 418aad2076..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_nan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nan, nanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nanl.c b/sysdeps/ieee754/ldbl-opt/s_nanl.c
deleted file mode 100644
index 9496e0b5ce..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_nanl.c>
-long_double_symbol (libm, __nanl, nanl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_nearbyint.c b/sysdeps/ieee754/ldbl-opt/s_nearbyint.c
deleted file mode 100644
index a8b7973acd..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nearbyint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_nearbyint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nextafter.c b/sysdeps/ieee754/ldbl-opt/s_nextafter.c
index 78e2c0ff37..e36ade8202 100644
--- a/sysdeps/ieee754/ldbl-opt/s_nextafter.c
+++ b/sysdeps/ieee754/ldbl-opt/s_nextafter.c
@@ -1,8 +1,5 @@
#include <math_ldbl_opt.h>
#include <math/s_nextafter.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __nextafter, nextafterl, GLIBC_2_0);
-#endif
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
strong_alias (__nextafter, __nexttowardd)
strong_alias (__nextafter, __nexttowardld)
diff --git a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
index 07e9375b78..d1cdd54c44 100644
--- a/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
+++ b/sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c
@@ -22,6 +22,7 @@
#include <errno.h>
#include <math.h>
+#include <math-barriers.h>
#include <math_private.h>
#include <math_ldbl_opt.h>
#include <float.h>
@@ -31,7 +32,7 @@ float __nldbl_nexttowardf(float x, double y);
float __nldbl_nexttowardf(float x, double y)
{
int32_t hx,hy,ix,iy;
- u_int32_t ly;
+ uint32_t ly;
GET_FLOAT_WORD(hx,x);
EXTRACT_WORDS(hy,ly,y);
@@ -44,7 +45,7 @@ float __nldbl_nexttowardf(float x, double y)
if((double) x==y) return y; /* x=y, return y */
if(ix==0) { /* x == 0 */
float u;
- SET_FLOAT_WORD(x,(u_int32_t)(hy&0x80000000)|1);/* return +-minsub*/
+ SET_FLOAT_WORD(x,(uint32_t)(hy&0x80000000)|1);/* return +-minsub*/
u = math_opt_barrier (x);
u = u * u;
math_force_eval (u); /* raise underflow flag */
diff --git a/sysdeps/ieee754/ldbl-opt/s_remquo.c b/sysdeps/ieee754/ldbl-opt/s_remquo.c
deleted file mode 100644
index 9f3d7ba368..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_remquo.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_remquo.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __remquo, remquol, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_rint.c b/sysdeps/ieee754/ldbl-opt/s_rint.c
deleted file mode 100644
index d9b156ea27..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_rint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_rint.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __rint, rintl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_round.c b/sysdeps/ieee754/ldbl-opt/s_round.c
deleted file mode 100644
index edff2f017b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_round.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_round.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbln.c b/sysdeps/ieee754/ldbl-opt/s_scalbln.c
deleted file mode 100644
index 391142b769..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_scalbln.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_scalbln.c>
-#if IS_IN (libm)
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __scalbln, scalblnl, GLIBC_2_1);
-#endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
-compat_symbol (libc, __scalbln, scalblnl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_scalbn.c b/sysdeps/ieee754/ldbl-opt/s_scalbn.c
deleted file mode 100644
index 1ad81b199e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_scalbn.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_scalbn.c>
-#if IS_IN (libm)
-# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __scalbn, scalbnl, GLIBC_2_0);
-# endif
-#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __scalbn, scalbnl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_significand.c b/sysdeps/ieee754/ldbl-opt/s_significand.c
deleted file mode 100644
index 5287c09066..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significand.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_significand.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __significand, significandl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_significandl.c b/sysdeps/ieee754/ldbl-opt/s_significandl.c
deleted file mode 100644
index 9339b4780d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_significandl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_significandl.c>
-long_double_symbol (libm, __significandl, significandl);
diff --git a/sysdeps/ieee754/ldbl-opt/s_sin.c b/sysdeps/ieee754/ldbl-opt/s_sin.c
deleted file mode 100644
index 04e60e2731..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_sin.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* dbl-64/s_sin.c uses NAN and sincos identifiers internally. */
-#define sincos sincos_disable
-/* These definitions needed for proper unfolding of __MATHDECL_VEC. */
-#define __DECL_SIMD_sincos_disable
-#define __DECL_SIMD_sincos_disablef
-#define __DECL_SIMD_sincos_disablel
-#include <math_ldbl_opt.h>
-#undef NAN
-#undef sincos
-#include <sysdeps/ieee754/dbl-64/s_sin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sin, sinl, GLIBC_2_0);
-compat_symbol (libm, __cos, cosl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_sincos.c b/sysdeps/ieee754/ldbl-opt/s_sincos.c
deleted file mode 100644
index 6d2a48f25b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_sincos.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_sincos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __sincos, sincosl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_tan.c b/sysdeps/ieee754/ldbl-opt/s_tan.c
deleted file mode 100644
index 6b0fec0063..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_tan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_tan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, tan, tanl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_tanh.c b/sysdeps/ieee754/ldbl-opt/s_tanh.c
deleted file mode 100644
index e763bbde77..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_tanh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_tanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __tanh, tanhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_trunc.c b/sysdeps/ieee754/ldbl-opt/s_trunc.c
deleted file mode 100644
index 9d90a2bd73..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_trunc.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/s_trunc.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c b/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c
new file mode 100644
index 0000000000..be92325403
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/test-narrow-macros-ldbl-64.c
@@ -0,0 +1 @@
+#include <math/test-narrow-macros.c>
diff --git a/sysdeps/ieee754/ldbl-opt/w_acos.c b/sysdeps/ieee754/ldbl-opt/w_acos.c
deleted file mode 100644
index 2934041d4d..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acos.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_acos.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __acos, acosl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_acosh.c b/sysdeps/ieee754/ldbl-opt/w_acosh.c
deleted file mode 100644
index 7f7fa14e27..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acosh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_acosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __acosh, acoshl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_acoshl.c b/sysdeps/ieee754/ldbl-opt/w_acoshl.c
deleted file mode 100644
index 6243c2ac80..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acoshl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_acoshl.c>
-long_double_symbol (libm, __acoshl, acoshl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_acosl.c b/sysdeps/ieee754/ldbl-opt/w_acosl.c
deleted file mode 100644
index 8b6e890a53..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_acosl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_acosl.c>
-long_double_symbol (libm, __acosl, acosl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_asin.c b/sysdeps/ieee754/ldbl-opt/w_asin.c
deleted file mode 100644
index 5e1d70ff65..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_asin.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_asin.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __asin, asinl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_asinl.c b/sysdeps/ieee754/ldbl-opt/w_asinl.c
deleted file mode 100644
index a58a224a38..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_asinl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_asinl.c>
-long_double_symbol (libm, __asinl, asinl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_atan2.c b/sysdeps/ieee754/ldbl-opt/w_atan2.c
deleted file mode 100644
index f1d1501bd2..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atan2.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_atan2.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __atan2, atan2l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_atan2l.c b/sysdeps/ieee754/ldbl-opt/w_atan2l.c
deleted file mode 100644
index 01431eff44..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atan2l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_atan2l.c>
-long_double_symbol (libm, __atan2l, atan2l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_atanh.c b/sysdeps/ieee754/ldbl-opt/w_atanh.c
deleted file mode 100644
index b4cab87c32..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atanh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_atanh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __atanh, atanhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_atanhl.c b/sysdeps/ieee754/ldbl-opt/w_atanhl.c
deleted file mode 100644
index 0dbc114481..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_atanhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_atanhl.c>
-long_double_symbol (libm, __atanhl, atanhl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_cosh.c b/sysdeps/ieee754/ldbl-opt/w_cosh.c
deleted file mode 100644
index a6f56cf4c5..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_cosh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_cosh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __cosh, coshl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_coshl.c b/sysdeps/ieee754/ldbl-opt/w_coshl.c
deleted file mode 100644
index 8c7dccb7f3..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_coshl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_coshl.c>
-long_double_symbol (libm, __coshl, coshl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp.c b/sysdeps/ieee754/ldbl-opt/w_exp.c
deleted file mode 100644
index 61fcfcc9df..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <sysdeps/ieee754/dbl-64/w_exp.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __exp, expl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10.c b/sysdeps/ieee754/ldbl-opt/w_exp10.c
deleted file mode 100644
index 990c48e61a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp10.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_exp10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __exp10, exp10l, GLIBC_2_1);
-compat_symbol (libm, __pow10, pow10l, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c
new file mode 100644
index 0000000000..895411d1ee
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c
@@ -0,0 +1,8 @@
+#include <math_ldbl_opt.h>
+#include <math/w_exp10_compat.c>
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+strong_alias (__pow10, __pow10_pow10l)
+compat_symbol (libm, __pow10_pow10l, pow10l, GLIBC_2_1);
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10l.c b/sysdeps/ieee754/ldbl-opt/w_exp10l.c
deleted file mode 100644
index e06dfb5014..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_exp10l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_exp10l.c>
-long_double_symbol (libm, __exp10l, exp10l);
-long_double_symbol (libm, __pow10l, pow10l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c
new file mode 100644
index 0000000000..4822211189
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c
@@ -0,0 +1,17 @@
+#include <math_ldbl_opt.h>
+#undef compat_symbol
+#define compat_symbol(l,n,a,v)
+#include <math/w_exp10l_compat.c>
+#if LIBM_SVID_COMPAT
+# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
+/* compat_symbol was undefined and redefined above to avoid the
+ default pow10l compat symbol at version GLIBC_2_1 (as for ldbl-opt
+ configurations, that version should have the alias to exp10). So
+ it now needs to be redefined to define the compat symbol at version
+ LONG_DOUBLE_COMPAT_VERSION. */
+# undef compat_symbol
+# define compat_symbol(lib, local, symbol, version) \
+ compat_symbol_reference (lib, local, symbol, version)
+compat_symbol (libm, __pow10l, pow10l, LONG_DOUBLE_COMPAT_VERSION);
+# endif
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_fmod.c b/sysdeps/ieee754/ldbl-opt/w_fmod.c
deleted file mode 100644
index 81ad5057f7..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_fmod.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_fmod.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fmod, fmodl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_fmodl.c b/sysdeps/ieee754/ldbl-opt/w_fmodl.c
deleted file mode 100644
index 2a534a304c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_fmodl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_fmodl.c>
-long_double_symbol (libm, __fmodl, fmodl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_hypot.c b/sysdeps/ieee754/ldbl-opt/w_hypot.c
deleted file mode 100644
index e1cf1ffcfe..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_hypot.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_hypot.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __hypot, hypotl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_hypotl.c b/sysdeps/ieee754/ldbl-opt/w_hypotl.c
deleted file mode 100644
index 6c46bd4bde..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_hypotl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_hypotl.c>
-long_double_symbol (libm, __hypotl, hypotl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_ilogb.c b/sysdeps/ieee754/ldbl-opt/w_ilogb.c
deleted file mode 100644
index f518087a5f..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_ilogb.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_ilogb.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __ilogb, ilogbl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_ilogbl.c b/sysdeps/ieee754/ldbl-opt/w_ilogbl.c
deleted file mode 100644
index 36f83f6ade..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_ilogbl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_ilogbl.c>
-long_double_symbol (libm, __ilogbl, ilogbl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_j0.c b/sysdeps/ieee754/ldbl-opt/w_j0.c
deleted file mode 100644
index 5c78aff085..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j0.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_j0.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, j0, j0l, GLIBC_2_0);
-compat_symbol (libm, y0, y0l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_j0l.c b/sysdeps/ieee754/ldbl-opt/w_j0l.c
deleted file mode 100644
index 767a1bcada..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j0l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_j0l.c>
-long_double_symbol (libm, __j0l, j0l);
-long_double_symbol (libm, __y0l, y0l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_j1.c b/sysdeps/ieee754/ldbl-opt/w_j1.c
deleted file mode 100644
index ed3dbc0361..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j1.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_j1.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, j1, j1l, GLIBC_2_0);
-compat_symbol (libm, y1, y1l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_j1l.c b/sysdeps/ieee754/ldbl-opt/w_j1l.c
deleted file mode 100644
index 946c36467c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_j1l.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_j1l.c>
-long_double_symbol (libm, __j1l, j1l);
-long_double_symbol (libm, __y1l, y1l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_jn.c b/sysdeps/ieee754/ldbl-opt/w_jn.c
deleted file mode 100644
index 7a7e0d434b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_jn.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_jn.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, jn, jnl, GLIBC_2_0);
-compat_symbol (libm, yn, ynl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_jnl.c b/sysdeps/ieee754/ldbl-opt/w_jnl.c
deleted file mode 100644
index 5219543a97..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_jnl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_jnl.c>
-long_double_symbol (libm, __jnl, jnl);
-long_double_symbol (libm, __ynl, ynl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c b/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
deleted file mode 100644
index eeab6a6b47..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_lgamma_r.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __lgamma_r, lgammal_r, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c b/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
deleted file mode 100644
index 25459758d7..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_lgammal_r.c>
-long_double_symbol (libm, __lgammal_r, lgammal_r);
diff --git a/sysdeps/ieee754/ldbl-opt/w_log.c b/sysdeps/ieee754/ldbl-opt/w_log.c
deleted file mode 100644
index bde1e31db4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log, logl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log10.c b/sysdeps/ieee754/ldbl-opt/w_log10.c
deleted file mode 100644
index 74e716821e..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log10.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log10.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __log10, log10l, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log10l.c b/sysdeps/ieee754/ldbl-opt/w_log10l.c
deleted file mode 100644
index 9c936e376a..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log10l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log10l.c>
-long_double_symbol (libm, __log10l, log10l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_log2.c b/sysdeps/ieee754/ldbl-opt/w_log2.c
deleted file mode 100644
index 9b9b45b21b..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log2.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_log2.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __log2, log2l, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_log2l.c b/sysdeps/ieee754/ldbl-opt/w_log2l.c
deleted file mode 100644
index c859682133..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_log2l.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_log2l.c>
-long_double_symbol (libm, __log2l, log2l);
diff --git a/sysdeps/ieee754/ldbl-opt/w_logl.c b/sysdeps/ieee754/ldbl-opt/w_logl.c
deleted file mode 100644
index c2354a02b9..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_logl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_logl.c>
-long_double_symbol (libm, __logl, logl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_pow.c b/sysdeps/ieee754/ldbl-opt/w_pow.c
deleted file mode 100644
index 2d98fb9be4..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_pow.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_pow.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __pow, powl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_powl.c b/sysdeps/ieee754/ldbl-opt/w_powl.c
deleted file mode 100644
index 85b8927648..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_powl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_powl.c>
-long_double_symbol (libm, __powl, powl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainder.c b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c
index dfa7b7f569..8bdea32c02 100644
--- a/sysdeps/ieee754/ldbl-opt/w_remainder.c
+++ b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c
@@ -1,7 +1,6 @@
#include <math_ldbl_opt.h>
-#include <math/w_remainder.c>
+#include <math/w_remainder_compat.c>
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __remainder, remainderl, GLIBC_2_0);
strong_alias (__remainder, __drem)
compat_symbol (libm, __drem, dreml, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainderl.c b/sysdeps/ieee754/ldbl-opt/w_remainderl.c
deleted file mode 100644
index 7a344b7709..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_remainderl.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_remainderl.c>
-long_double_symbol (libm, __remainderl, remainderl);
-strong_alias (__remainderl, __dreml)
-long_double_symbol (libm, __dreml, dreml);
diff --git a/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c b/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c
new file mode 100644
index 0000000000..2579600aa2
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c
@@ -0,0 +1,19 @@
+#include <math_ldbl_opt.h>
+#undef weak_alias
+#define weak_alias(n,a)
+#include <math/w_remainderl_compat.c>
+#if LIBM_SVID_COMPAT
+/* If ldbl-opt is used without special versioning for remainderl being
+ required, the generic code does not define remainderl because of
+ the undefine and redefine of weak_alias above. In any case, that
+ undefine and redefine mean _FloatN / _FloatNx aliases have not been
+ defined. */
+# undef weak_alias
+# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+# if !LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+weak_alias (__remainderl, remainderl)
+# endif
+strong_alias (__remainderl, __dreml)
+long_double_symbol (libm, __dreml, dreml);
+libm_alias_ldouble_other (__remainder, remainder)
+#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalb.c b/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c
index e2ac601596..f6d53a5ba5 100644
--- a/sysdeps/ieee754/ldbl-opt/w_scalb.c
+++ b/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c
@@ -1,5 +1,5 @@
#include <math_ldbl_opt.h>
-#include <math/w_scalb.c>
+#include <math/w_scalb_compat.c>
#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
compat_symbol (libm, __scalb, scalbl, GLIBC_2_0);
#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_scalbl.c b/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c
index f3d3901f86..c8feb654a2 100644
--- a/sysdeps/ieee754/ldbl-opt/w_scalbl.c
+++ b/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c
@@ -1,5 +1,5 @@
#include <math_ldbl_opt.h>
#undef weak_alias
#define weak_alias(n,a)
-#include <math/w_scalbl.c>
+#include <math/w_scalbl_compat.c>
long_double_symbol (libm, __scalbl, scalbl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_sinh.c b/sysdeps/ieee754/ldbl-opt/w_sinh.c
deleted file mode 100644
index a5400b5eb1..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sinh.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_sinh.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sinh, sinhl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_sinhl.c b/sysdeps/ieee754/ldbl-opt/w_sinhl.c
deleted file mode 100644
index b94f4ec845..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sinhl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_sinhl.c>
-long_double_symbol (libm, __sinhl, sinhl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_sqrt.c b/sysdeps/ieee754/ldbl-opt/w_sqrt.c
deleted file mode 100644
index ca2ba061e8..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sqrt.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_sqrt.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __sqrt, sqrtl, GLIBC_2_0);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_sqrtl.c b/sysdeps/ieee754/ldbl-opt/w_sqrtl.c
deleted file mode 100644
index 609f5bf3d6..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_sqrtl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_sqrtl.c>
-long_double_symbol (libm, __sqrtl, sqrtl);
diff --git a/sysdeps/ieee754/ldbl-opt/w_tgamma.c b/sysdeps/ieee754/ldbl-opt/w_tgamma.c
deleted file mode 100644
index cce9f348ed..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_tgamma.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/w_tgamma.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __tgamma, tgammal, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/w_tgammal.c b/sysdeps/ieee754/ldbl-opt/w_tgammal.c
deleted file mode 100644
index c3c511db8c..0000000000
--- a/sysdeps/ieee754/ldbl-opt/w_tgammal.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/w_tgammal.c>
-long_double_symbol (libm, __tgammal, tgammal);