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/w_j0_compat.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'math/w_j0_compat.c') diff --git a/math/w_j0_compat.c b/math/w_j0_compat.c index b08688e131..03f0d8e118 100644 --- a/math/w_j0_compat.c +++ b/math/w_j0_compat.c @@ -20,6 +20,7 @@ #include #include #include +#include #if LIBM_SVID_COMPAT @@ -34,11 +35,7 @@ __j0 (double x) return __ieee754_j0 (x); } -weak_alias (__j0, j0) -# ifdef NO_LONG_DOUBLE -strong_alias (__j0, __j0l) -weak_alias (__j0, j0l) -# endif +libm_alias_double (__j0, j0) /* wrapper y0 */ @@ -67,9 +64,5 @@ __y0 (double x) return __ieee754_y0 (x); } -weak_alias (__y0, y0) -# ifdef NO_LONG_DOUBLE -strong_alias (__y0, __y0l) -weak_alias (__y0, y0l) -# endif +libm_alias_double (__y0, y0) #endif -- cgit v1.2.3