From patchwork Mon Feb 3 21:10:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 37663 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com Received: (qmail 65325 invoked by alias); 3 Feb 2020 21:10:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 65224 invoked by uid 89); 3 Feb 2020 21:10:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2215, HContent-Transfer-Encoding:8bit X-HELO: mx0a-001b2d01.pphosted.com From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH 4/6] ldbl-128ibm-compat: Redirect complex math functions Date: Mon, 3 Feb 2020 15:10:42 -0600 Message-Id: <98945d84449f1427125570eb7f02335261b3e65a.1580757509.git.murphyp@linux.vnet.ibm.com> In-Reply-To: References: MIME-Version: 1.0 From: Rajalakshmi Srinivasaraghavan 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. Reviewed-by: Tulio Magno Quites Machado Filho --- math/complex.h | 21 +++++++++++++++++++-- 1 file 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 -# 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