From 7b7c39450b3c4ab35b4960346e61d7b177ee728e Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Thu, 25 Aug 2016 11:25:33 -0500 Subject: Make common fdim implementation generic. The only difference is the usage of math_narrow_eval when building s_fdiml.c. This should be harmless for long double, but I did observe some code generation changes on m68k, but lack the resources to test it. Likewise, to more easily support overriding symbol generation, the aliasing macros are always conditionally defined on their absence to reduce boilerplate. I also ran builds for i486, ppc64, sparcv9, aarch64, s390x and observed no changes to s_fdim* objects. --- sysdeps/ieee754/ldbl-opt/math-type-macros-double.h | 9 +++++++-- sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h | 4 +++- sysdeps/ieee754/ldbl-opt/s_fdim.c | 5 ----- sysdeps/ieee754/ldbl-opt/s_fdiml.c | 5 ----- 4 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 sysdeps/ieee754/ldbl-opt/s_fdim.c delete mode 100644 sysdeps/ieee754/ldbl-opt/s_fdiml.c (limited to 'sysdeps/ieee754/ldbl-opt') diff --git a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h index 8cb569454e..e78a5e3589 100644 --- a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h +++ b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h @@ -44,15 +44,20 @@ #define LDOUBLE_cpowl_libm_version GLIBC_2_1 #define LDOUBLE_clog10l_libm_version GLIBC_2_1 #define LDOUBLE___clog10l_libm_version GLIBC_2_1 +#define LDOUBLE_fdiml_libm_version GLIBC_2_1 /* Define compat symbols for long double on platforms where it was not always a distinct type. */ -#define M_LIBM_NEED_COMPAT(f) \ +#if !defined M_LIBM_NEED_COMPAT +# define M_LIBM_NEED_COMPAT(f) \ LONG_DOUBLE_COMPAT (libm, LDOUBLE_ ## f ## l_libm_version) +#endif -#define declare_mgen_libm_compat(from, to) \ +#if !defined declare_mgen_libm_compat +# define declare_mgen_libm_compat(from, to) \ compat_symbol (libm, from, to ## l, \ LDOUBLE_ ## to ## l_libm_version); +#endif #include_next #endif diff --git a/sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h b/sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h index d2af4bbcc0..ae3713d49d 100644 --- a/sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h +++ b/sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h @@ -22,8 +22,10 @@ /* Use properly versioned symbols for long double on platforms where it was not always a distinct type. */ -#define declare_mgen_alias(from, to) \ +#if !defined declare_mgen_alias +# define declare_mgen_alias(from, to) \ long_double_symbol (libm, from ## l, to ## l); +#endif #include_next #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 -#include -#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 -#undef weak_alias -#define weak_alias(n,a) -#include -long_double_symbol (libm, __fdiml, fdiml); -- cgit v1.2.3