This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 9/9] ldbl-128ibm-compat: Redirect complex math functions
- From: Tulio Magno Quites Machado Filho <tuliom at linux dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: joseph at codesourcery dot com, gabriel at inconstante dot eti dot br, raji at linux dot ibm dot com, Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Date: Wed, 6 Jun 2018 19:39:09 -0300
- Subject: [PATCH 9/9] ldbl-128ibm-compat: Redirect complex math functions
- References: <20180606223909.16675-1-tuliom@linux.ibm.com>
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
The API doesn't change, i.e. compilers using a long double format compatible
with the IEEE 128-bit extended precision format are redirected from *l
functions to __*ieee128 symbols using the same mechanism already
used with -mlong-double-64 for complex math functions.
2018-06-06 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
* math/complex.h [__HAVE_DISTINCT_FLOAT128 &&
!__HAVE_FLOAT128_UNLIKE_LDBL]: Redirect long double functions
to __*ieee128.
---
math/complex.h | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/math/complex.h b/math/complex.h
index 544e7acd82..097d6dcb6f 100644
--- a/math/complex.h
+++ b/math/complex.h
@@ -95,11 +95,15 @@ __BEGIN_DECLS
#define __MATHCALL(function, args) \
__MATHDECL (_Mdouble_complex_,function, args)
-#define __MATHDECL(type, function, args) \
+#define __MATHDECL_IMPL(type, function, args) \
__MATHDECL_1(type, function, args); \
__MATHDECL_1(type, __CONCAT(__,function), args)
-#define __MATHDECL_1(type, function, args) \
+#define __MATHDECL(type, function, args) \
+ __MATHDECL_IMPL(type, function, args)
+#define __MATHDECL_1_IMPL(type, function, args) \
extern type __MATH_PRECNAME(function) args __THROW
+#define __MATHDECL_1(type, function, args) \
+ __MATHDECL_1_IMPL(type, function, args)
#define _Mdouble_ double
#define __MATH_PRECNAME(name) name
@@ -122,11 +126,31 @@ __BEGIN_DECLS
# undef __MATHDECL_1
# define __MATHDECL_1(type, function, args) \
extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function)
+# elif __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL
+# undef __MATHDECL_1
+# undef __MATHDECL
+# define __REDIR_TO(function) \
+ __ ## function ## ieee128
+# define __MATHDECL_1(type, function, alias, args) \
+ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, alias)
+#define __MATHDECL(type, function, args) \
+ __MATHDECL_1(type, function, __REDIR_TO(function), args); \
+ __MATHDECL_1(type, __CONCAT(__,function), __REDIR_TO(function), args)
# endif
# define _Mdouble_ long double
# define __MATH_PRECNAME(name) name##l
# include <bits/cmathcalls.h>
+# if !defined __LDBL_COMPAT \
+ && __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL
+# undef __REDIR_TO
+# undef __MATHDECL_1
+# undef __MATHDECL
+#define __MATHDECL(type, function, args) \
+ __MATHDECL_IMPL(type, function, args)
+# define __MATHDECL_1(type, function, args) \
+ __MATHDECL_1_IMPL(type, function, args)
+# endif
#endif
#undef _Mdouble_
#undef __MATH_PRECNAME
--
2.14.4