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. --- sysdeps/ieee754/ldbl-opt/s_nextafter.c | 3 --- sysdeps/ieee754/ldbl-opt/w_acos_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_acosh_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_asin_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_atan2_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_atanh_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_cosh_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_exp10_compat.c | 1 - sysdeps/ieee754/ldbl-opt/w_exp_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_fmod_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_hypot_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_j0_compat.c | 6 ------ sysdeps/ieee754/ldbl-opt/w_j1_compat.c | 6 ------ sysdeps/ieee754/ldbl-opt/w_jn_compat.c | 6 ------ sysdeps/ieee754/ldbl-opt/w_log10_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_log2_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_log_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_pow_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_remainder_compat.c | 1 - sysdeps/ieee754/ldbl-opt/w_sinh_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_sqrt_compat.c | 5 ----- sysdeps/ieee754/ldbl-opt/w_tgamma_compat.c | 5 ----- 22 files changed, 103 deletions(-) delete mode 100644 sysdeps/ieee754/ldbl-opt/w_acos_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_acosh_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_asin_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_atan2_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_atanh_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_cosh_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_exp_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_fmod_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_hypot_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_j0_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_j1_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_jn_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_log10_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_log2_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_log_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_pow_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_sinh_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_sqrt_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_tgamma_compat.c (limited to 'sysdeps/ieee754') 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 #include -#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/w_acos_compat.c b/sysdeps/ieee754/ldbl-opt/w_acos_compat.c deleted file mode 100644 index 1e6d1b37ec..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_acos_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_compat.c b/sysdeps/ieee754/ldbl-opt/w_acosh_compat.c deleted file mode 100644 index 40da339a7a..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_acosh_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_asin_compat.c b/sysdeps/ieee754/ldbl-opt/w_asin_compat.c deleted file mode 100644 index 1c52cc22ad..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_asin_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_atan2_compat.c b/sysdeps/ieee754/ldbl-opt/w_atan2_compat.c deleted file mode 100644 index d3f7964d7c..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_atan2_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_atanh_compat.c b/sysdeps/ieee754/ldbl-opt/w_atanh_compat.c deleted file mode 100644 index e15ef1f93d..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_atanh_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_cosh_compat.c b/sysdeps/ieee754/ldbl-opt/w_cosh_compat.c deleted file mode 100644 index af29735e10..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_cosh_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_exp10_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c index eb132cfbe5..895411d1ee 100644 --- a/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c +++ b/sysdeps/ieee754/ldbl-opt/w_exp10_compat.c @@ -1,7 +1,6 @@ #include #include #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __exp10, exp10l, 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); diff --git a/sysdeps/ieee754/ldbl-opt/w_exp_compat.c b/sysdeps/ieee754/ldbl-opt/w_exp_compat.c deleted file mode 100644 index d01fe655ff..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_exp_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_fmod_compat.c b/sysdeps/ieee754/ldbl-opt/w_fmod_compat.c deleted file mode 100644 index 9280d39d70..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_fmod_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_hypot_compat.c b/sysdeps/ieee754/ldbl-opt/w_hypot_compat.c deleted file mode 100644 index b3979ff0f4..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_hypot_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_j0_compat.c b/sysdeps/ieee754/ldbl-opt/w_j0_compat.c deleted file mode 100644 index 45b4d14764..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_j0_compat.c +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include -#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_j1_compat.c b/sysdeps/ieee754/ldbl-opt/w_j1_compat.c deleted file mode 100644 index 1071c8fd6a..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_j1_compat.c +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include -#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_jn_compat.c b/sysdeps/ieee754/ldbl-opt/w_jn_compat.c deleted file mode 100644 index be29a36041..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_jn_compat.c +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include -#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_log10_compat.c b/sysdeps/ieee754/ldbl-opt/w_log10_compat.c deleted file mode 100644 index 5ec6a2b2b6..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_log10_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_log2_compat.c b/sysdeps/ieee754/ldbl-opt/w_log2_compat.c deleted file mode 100644 index dffd2c183e..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_log2_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_log_compat.c b/sysdeps/ieee754/ldbl-opt/w_log_compat.c deleted file mode 100644 index d2a2bcadde..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_log_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_pow_compat.c b/sysdeps/ieee754/ldbl-opt/w_pow_compat.c deleted file mode 100644 index c2a7942019..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_pow_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_remainder_compat.c b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c index c823dcb8e7..8bdea32c02 100644 --- a/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c +++ b/sysdeps/ieee754/ldbl-opt/w_remainder_compat.c @@ -1,7 +1,6 @@ #include #include #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_sinh_compat.c b/sysdeps/ieee754/ldbl-opt/w_sinh_compat.c deleted file mode 100644 index b47182c017..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_sinh_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_sqrt_compat.c b/sysdeps/ieee754/ldbl-opt/w_sqrt_compat.c deleted file mode 100644 index 355d1c20db..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_sqrt_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#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_tgamma_compat.c b/sysdeps/ieee754/ldbl-opt/w_tgamma_compat.c deleted file mode 100644 index 082ce8aaff..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_tgamma_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __tgamma, tgammal, GLIBC_2_1); -#endif -- cgit 1.4.1