From patchwork Wed Jun 6 22:39:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 27686 X-Patchwork-Delegate: joseph@codesourcery.com Received: (qmail 86778 invoked by alias); 6 Jun 2018 22:43:14 -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 84982 invoked by uid 89); 6 Jun 2018 22:42:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com, gabriel@inconstante.eti.br, raji@linux.ibm.com, Rajalakshmi Srinivasaraghavan Subject: [PATCH 9/9] ldbl-128ibm-compat: Redirect complex math functions Date: Wed, 6 Jun 2018 19:39:09 -0300 In-Reply-To: <20180606223909.16675-1-tuliom@linux.ibm.com> References: <20180606223909.16675-1-tuliom@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18060622-0068-0000-0000-000003047342 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009139; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01043027; UDB=6.00534142; IPR=6.00822157; MB=3.00021491; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-06 22:42:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060622-0069-0000-0000-000044980C58 Message-Id: <20180606223909.16675-10-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-06_10:, , signatures=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. 2018-06-06 Rajalakshmi Srinivasaraghavan * 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 +# 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