about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>2018-04-04 07:15:24 +0530
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2020-02-28 08:20:02 -0600
commit39b47ada8d915b939d9d511504902431d152ff6e (patch)
treea58de411bcba09a6368a33cb6f0b4e7e6db4381a
parent8dbfea3a2094798a52cebddde01d255483f49665 (diff)
downloadglibc-39b47ada8d915b939d9d511504902431d152ff6e.tar.gz
glibc-39b47ada8d915b939d9d511504902431d152ff6e.tar.xz
glibc-39b47ada8d915b939d9d511504902431d152ff6e.zip
ldbl-128ibm-compat: Redirect complex math functions
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.
-rw-r--r--math/complex.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/math/complex.h b/math/complex.h
index 42f3fd7517..b6d175e800 100644
--- a/math/complex.h
+++ b/math/complex.h
@@ -95,9 +95,11 @@ __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(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) \
@@ -124,13 +126,28 @@ __BEGIN_DECLS
 #  undef __MATHDECL_1
 #  define __MATHDECL_1(type, function, args) \
   extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function)
+# elif __LONG_DOUBLE_USES_FLOAT128 == 1
+#  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
+# if defined __LDBL_COMPAT \
+     || __LONG_DOUBLE_USES_FLOAT128 == 1
+#  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