From patchwork Wed Jun 20 02:04:25 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: 27941 Received: (qmail 8918 invoked by alias); 20 Jun 2018 02:06:30 -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 8789 invoked by uid 89); 20 Jun 2018 02:06:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.4 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, Rajalakshmi Srinivasaraghavan Subject: [PATCH 11/12] ldbl-128ibm-compat: Redirect complex math functions Date: Tue, 19 Jun 2018 23:04:25 -0300 In-Reply-To: <20180620020426.20372-1-tuliom@linux.ibm.com> References: <20180620020426.20372-1-tuliom@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18062002-2213-0000-0000-000002BC7545 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009223; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01049503; UDB=6.00537768; IPR=6.00828477; MB=3.00021748; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 02:06:22 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-2214-0000-0000-00005A8A5FAC Message-Id: <20180620020426.20372-12-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , 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-19 Rajalakshmi Srinivasaraghavan * math/complex.h [__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL]: Redirect long double functions to __*ieee128. --- math/complex.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/math/complex.h b/math/complex.h index 40cf8e0705..8e917105bc 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 __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 +# 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