about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-opt
diff options
context:
space:
mode:
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-08-25 11:25:33 -0500
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-09-01 09:28:05 -0500
commit7b7c39450b3c4ab35b4960346e61d7b177ee728e (patch)
tree251612e6e9a4192b1e5ca8010589ec64a692b9fa /sysdeps/ieee754/ldbl-opt
parent4d728087ef8cc826b05bd21d0c74d4eca9b1a27d (diff)
downloadglibc-7b7c39450b3c4ab35b4960346e61d7b177ee728e.tar.gz
glibc-7b7c39450b3c4ab35b4960346e61d7b177ee728e.tar.xz
glibc-7b7c39450b3c4ab35b4960346e61d7b177ee728e.zip
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.
Diffstat (limited to 'sysdeps/ieee754/ldbl-opt')
-rw-r--r--sysdeps/ieee754/ldbl-opt/math-type-macros-double.h9
-rw-r--r--sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h4
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdim.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_fdiml.c5
4 files changed, 10 insertions, 13 deletions
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 <math-type-macros-double.h>
 #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 <math-type-macros-ldouble.h>
 #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);