From 9ac44708881c086f27f86b36c20749052d079c8f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 15 Sep 2017 23:10:02 +0000 Subject: Use libm_alias_double in math/. This patch converts libm function implementations in math/ from using weak_alias to using libm_alias_double to define public function names, in cases where it would be appropriate to define _Float64 / _Float32x aliases for those functions as well. This eliminates many NO_LONG_DOUBLE conditionals and ldbl-opt wrappers round these function implementations. Tested for x86_64. Also tested with build-many-glibcs.py. Binary differences seen are that the different order in which remainder and drem symbols get defined as a result of this patch (the same source file defines the same aliases, but in a different order of definition) changes the order of symbols in the final libm.so when long double = double, and for ldbl-opt configurations, the compat symbols for Bessel functions were previously defined by e.g. "compat_symbol (libm, j0, j0l, GLIBC_2_0)", which declares j0l as a compat symbol based on j0 and so makes j0l weak because j0 is weak, and are now defined (indirectly via the relevant macros) based on e.g. __j0, so are no longer weak because __j0 isn't weak. * math/s_fma.c: Include . (fma): Define using libm_alias_double. * math/s_nextafter.c: Include . (nextafter): Define using libm_alias_double. * math/w_acos_compat.c: Include . (acos): Define using libm_alias_double. * math/w_acosh_compat.c: Include . (aocsh): Define using libm_alias_double. * math/w_asin_compat.c: Include . (asin): Define using libm_alias_double. * math/w_atan2_compat.c: Include . (atan2): Define using libm_alias_double. * math/w_atanh_compat.c: Include . (atanh): Define using libm_alias_double. * math/w_cosh_compat.c: Include . (cosh): Define using libm_alias_double. * math/w_exp10_compat.c: Include . (exp10): Define using libm_alias_double. * math/w_exp2_compat.c: Include . (exp2): Define using libm_alias_double. * math/w_exp_compat.c: Include . (exp): Define using libm_alias_double. * math/w_fmod_compat.c: Include . (fmod): Define using libm_alias_double. * math/w_hypot_compat.c: Include . (hypot): Define using libm_alias_double. * math/w_j0_compat.c: Include . (j0): Define using libm_alias_double. (y0): Likewise. * math/w_j1_compat.c: Include . (j1): Define using libm_alias_double. (y1): Likewise. * math/w_jn_compat.c: Include . (jn): Define using libm_alias_double. (yn): Likewise. * math/w_log10_compat.c: Include . (log10): Define using libm_alias_double. * math/w_log2_compat.c: Include . (log2): Define using libm_alias_double. * math/w_log_compat.c: Include . (log): Define using libm_alias_double. * math/w_pow_compat.c: Include . (pow): Define using libm_alias_double. * math/w_remainder_compat.c: Include . (remainder): Define using libm_alias_double. * math/w_sinh_compat.c: Include . (sinh): Define using libm_alias_double. * math/w_sqrt_compat.c: Include . (sqrt): Define using libm_alias_double. * math/w_tgamma_compat.c: Include . (tgamma): Define using libm_alias_double. * sysdeps/ieee754/ldbl-opt/s_nextafter.c [LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)] (nextafterl): Do not define compat symbol here. * sysdeps/ieee754/ldbl-opt/w_exp10_compat.c [LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)] (exp10l): Likewise. * sysdeps/ieee754/ldbl-opt/w_remainder_compat.c [LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)] (remainderl): Likewise. * sysdeps/ieee754/ldbl-opt/w_acos_compat.c: Remove. * sysdeps/ieee754/ldbl-opt/w_acosh_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_asin_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_atan2_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_atanh_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_cosh_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_exp_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_fmod_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_hypot_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_j0_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_j1_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_jn_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_log10_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_log2_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_log_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_pow_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_sinh_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_sqrt_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_tgamma_compat.c: Likewise. --- math/s_fma.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'math/s_fma.c') diff --git a/math/s_fma.c b/math/s_fma.c index dc1cc65bbe..929ca581db 100644 --- a/math/s_fma.c +++ b/math/s_fma.c @@ -18,6 +18,7 @@ . */ #include +#include double __fma (double x, double y, double z) @@ -25,10 +26,5 @@ __fma (double x, double y, double z) return (x * y) + z; } #ifndef __fma -weak_alias (__fma, fma) -#endif - -#ifdef NO_LONG_DOUBLE -strong_alias (__fma, __fmal) -weak_alias (__fmal, fmal) +libm_alias_double (__fma, fma) #endif -- cgit v1.2.3