From patchwork Wed Jun 20 02:04:15 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: 931899 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93425-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Hu7kjrAj"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419SpD2nNMz9s4n for ; Wed, 20 Jun 2018 12:05:08 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=cCpeVb6DXqLFKvfLFddeszBgWLD2EC9 aNuU9c77syH0DlZQDJ9YyX79TNLA89BEqSzk0w+B63iwr6VyUqYY/QaYZqDe/91P Xb9GAGjcfDob9IMAKH//WFLARFP+t+/S+Imm039W3GJWoytwE+IzIOfIJ3TvBux6 /UpGkYQgL6Tw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=+xCwr59o3P0qsZfPf0F+tfR145w=; b=Hu7kj rAjpHCIZ7N3S/DcvYWomEFAepWcJptZerDxy6VtRI89TtJJsUBi6d1/GSDXv6KuQ gVuPogOxo4vd24PW64XuntmZIOM4jr8tcuuVMo3W8+Y8OYS6tTcyz9gDjKaI/utT JR280pnJb3psPOEVZN72UaWnt/YIOm++24IsLc= Received: (qmail 129363 invoked by alias); 20 Jun 2018 02:05:01 -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 129153 invoked by uid 89); 20 Jun 2018 02:05:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 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=redefined X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com Subject: [PATCH 01/12] Undefine redirections after long double definition on __LDBL_COMPAT [BZ #23294] Date: Tue, 19 Jun 2018 23:04:15 -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-0068-0000-0000-0000030B8D65 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.00828476; MB=3.00021748; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 02:04:55 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0069-0000-0000-000044BE8C22 Message-Id: <20180620020426.20372-2-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 After defining the long double redirections to double, __MATHDECL_1 has to be redefined to its previous state in order to avoid redirecting all subsequent types. 2018-06-19 Tulio Magno Quites Machado Filho [BZ #23294] * math/complex.h (__MATHDECL_1_IMPL): New macro. [__LDBL_COMPAT](__MATHDECL_1): Redefine as __MATHDECL_1_IMPL after redirection. * math/math.h (__MATHDECL_1_IMPL, __MATHREDIR): New macros. [__LDBL_COMPAT](__MATHDECL_2): Removed. [__LDBL_COMPAT](__MATHDECL_1): Redefine as __MATHDECL_1_IMPL after redirection. Signed-off-by: Tulio Magno Quites Machado Filho --- math/complex.h | 10 +++++++++- math/math.h | 18 +++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/math/complex.h b/math/complex.h index 544e7acd82..40cf8e0705 100644 --- a/math/complex.h +++ b/math/complex.h @@ -98,8 +98,10 @@ __BEGIN_DECLS #define __MATHDECL(type, function, args) \ __MATHDECL_1(type, function, args); \ __MATHDECL_1(type, __CONCAT(__,function), args) -#define __MATHDECL_1(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 @@ -127,6 +129,11 @@ __BEGIN_DECLS # define _Mdouble_ long double # define __MATH_PRECNAME(name) name##l # include +# if defined __LDBL_COMPAT +# undef __MATHDECL_1 +# define __MATHDECL_1(type, function, args) \ + __MATHDECL_1_IMPL(type, function, args) +# endif #endif #undef _Mdouble_ #undef __MATH_PRECNAME @@ -215,6 +222,7 @@ __BEGIN_DECLS # undef _Mdouble_complex_ #endif +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL diff --git a/math/math.h b/math/math.h index ddee4e4083..998d3042c5 100644 --- a/math/math.h +++ b/math/math.h @@ -279,8 +279,13 @@ enum #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) -#define __MATHDECL_1(type, function,suffix, args) \ +#define __MATHDECL_1_IMPL(type, function, suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW +#define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) + +#define __MATHREDIR(type, function, suffix, args, to) \ + extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to) #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) @@ -331,11 +336,8 @@ extern long double __REDIRECT_NTH (nexttowardl, # endif # undef __MATHDECL_1 -# define __MATHDECL_2(type, function,suffix, args, alias) \ - extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ - args, alias) # define __MATHDECL_1(type, function,suffix, args) \ - __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) + __MATHREDIR(type, function, suffix, args, __CONCAT(function,suffix)) # endif /* Include the file of declarations again, this time using `long double' @@ -353,6 +355,11 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# if defined __LDBL_COMPAT +# undef __MATHDECL_1 +# define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) +# endif # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ @@ -479,6 +486,7 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL From patchwork Wed Jun 20 02:04:16 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: 931900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93426-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="xfWr3HP7"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419SpQ1MC0z9s4n for ; Wed, 20 Jun 2018 12:05:17 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=ECTFBJIPEOFotWou6b++aFIFOvieu7v vggz3etNgIhsnSde5RJNHYKCHOZkCzQOxKwUa5/xH/YneUuJC5ZpwNQKj2WwyoN0 Y2cmu+5VyRSmXpN8b4kwr0W9XhVIQm0o2DYsB4K0LM2PrVlCAIWxXWh2k4XuxQOC 9u5iBE7JCn5w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=4fDtdMfv6vn2K2Z4n8RzWWhUHvE=; b=xfWr3 HP7iBLR+bNrEl74muGwiRF0EDwEA3zGhVY39Zh/w/cG/AJPKMKxPl4wsceXnVP5K q4c1pXUBMl5lFhdSKVSRFbWyYSpEPsXP3LvTdaPjGuWfBxZGnVoW6yKQszPlWID5 hxsilYpJkLL7YpqOCD+j35CiJC1U62HLaou8fw= Received: (qmail 130976 invoked by alias); 20 Jun 2018 02:05:11 -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 130876 invoked by uid 89); 20 Jun 2018 02:05:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 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 Subject: [PATCH 02/12] Move declare_mgen_finite_alias definition Date: Tue, 19 Jun 2018 23:04:16 -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-0016-0000-0000-000008FD037C 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.00828476; MB=3.00021748; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 02:05:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0017-0000-0000-00003F588413 Message-Id: <20180620020426.20372-3-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Move declare_mgen_finite_alias, declare_mgen_finite_alias_s and declare_mgen_finite_alias_x to a shared place in order to reuse them in other files that also declare _finite aliases. 2018-06-19 Tulio Magno Quites Machado Filho * math/e_exp2_template.c (declare_mgen_finite_alias, declare_mgen_finite_alias_s, declare_mgen_finite_alias_x): Move to... * sysdeps/generic/math-type-macros.h (declare_mgen_finite_alias, declare_mgen_finite_alias_s, declare_mgen_finite_alias_x): ... here. Signed-off-by: Tulio Magno Quites Machado Filho --- math/e_exp2_template.c | 7 ------- sysdeps/generic/math-type-macros.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/math/e_exp2_template.c b/math/e_exp2_template.c index 30ed4af49b..19f9780b05 100644 --- a/math/e_exp2_template.c +++ b/math/e_exp2_template.c @@ -21,13 +21,6 @@ #include #include -#define declare_mgen_finite_alias_x(from, to) \ - strong_alias (from, to ## _finite) -#define declare_mgen_finite_alias_s(from,to) \ - declare_mgen_finite_alias_x (from, to) -#define declare_mgen_finite_alias(from, to) \ - declare_mgen_finite_alias_s (M_SUF (from), M_SUF (to)) - FLOAT M_DECL_FUNC (__ieee754_exp2) (FLOAT x) { diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h index 0e8ef16d7a..5250815253 100644 --- a/sysdeps/generic/math-type-macros.h +++ b/sysdeps/generic/math-type-macros.h @@ -74,6 +74,21 @@ # error "SET_NAN_PAYLOAD must be defined." #endif +#ifndef declare_mgen_finite_alias_x +#define declare_mgen_finite_alias_x(from, to) \ + strong_alias (from, to ## _finite) +#endif + +#ifndef declare_mgen_finite_alias_s +# define declare_mgen_finite_alias_s(from,to) \ + declare_mgen_finite_alias_x (from, to) +#endif + +#ifndef declare_mgen_finite_alias +# define declare_mgen_finite_alias(from, to) \ + declare_mgen_finite_alias_s (M_SUF (from), M_SUF (to)) +#endif + #define __M_CONCAT(a,b) a ## b #define __M_CONCATX(a,b) __M_CONCAT(a,b) From patchwork Wed Jun 20 02:04:17 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: 931901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93427-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="shwP7/Wb"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419Spd4R2tz9s4n for ; Wed, 20 Jun 2018 12:05:29 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=IAweFoaff/L31WYjdGiHCzN6y8Vt5YP 2XRgVKXrzCcUfINl1dv4fyZfz+N9QK6DkhdJ2rDud4emcTP6iBb8u2HRSFh48GMi KZl0mMdjQjft6MpZAkOPS/v+sQxNVl1D8YN0TI4oPQtgxh6Ao916TXIw7wRhPE9e V4wn2dPWn0js= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=/71UPJKf6W8JMB8x8undrgjmq3Q=; b=shwP7 /WbOOjfBhJjOlto7NyTmsTfLZ+uTlMa/L9U2I8d/dOpurr8gHL2/q3FKyf7rPDyA sLpWSM6Yquu/LMhW63mkqL6AjVmUsTnz6d30EAJaKu3xXVJUX5gXg5cILVWOhjly IAZYTV3GHU3LaArlzz2oXXce3k9+mwpKW20HOg= Received: (qmail 2084 invoked by alias); 20 Jun 2018 02:05:22 -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 1889 invoked by uid 89); 20 Jun 2018 02:05:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-20.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, KAM_STOCKTIP, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=na X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com Subject: [PATCH 03/12] Add a generic scalb implementation Date: Tue, 19 Jun 2018 23:04:17 -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-0016-0000-0000-000008FD0382 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.00828476; MB=3.00021748; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 02:05:12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0017-0000-0000-00003F58842A Message-Id: <20180620020426.20372-4-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Create templates for e_scabl, w_scalb and w_scalb_compat. 2018-06-19 Tulio Magno Quites Machado Filho * math/Makefile (libm-calls): Move e_scalbF to... (gen-libm-calls): ... here and add w_scalbF_compat. * math/e_scalb.c: Removed. * math/e_scalbf.c: Removed. * math/e_scalbl.c: Removed. * math/w_scalb_compat.c: Removed. * math/w_scalbf_compat.c: Removed. * math/e_scalb_template.c: New file. * math/w_scalb_compat_template.c: New file. * math/w_scalb_template.c: New file. * math/w_scalbl_compat.c: Removed. * sysdeps/generic/math-type-macros-double.h: Define M_K_STANDARD. * sysdeps/generic/math-type-macros-float.h: Likewise. * sysdeps/generic/math-type-macros-ldouble.h: Likewise. * sysdeps/ieee754/float128/w_scalbf128.c: New file without contents. * sysdeps/ieee754/float128/w_scalbf128_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_scalb_compat.c: Removed. * sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c: Removed. Signed-off-by: Tulio Magno Quites Machado Filho --- math/Makefile | 7 +- math/{e_scalb.c => e_scalb_template.c} | 32 ++++----- math/e_scalbf.c | 54 --------------- math/e_scalbl.c | 54 --------------- ...{w_scalb_compat.c => w_scalb_compat_template.c} | 36 ++++------ math/{w_scalbf_compat.c => w_scalb_template.c} | 54 +++++---------- math/w_scalbl_compat.c | 81 ---------------------- sysdeps/generic/math-type-macros-double.h | 1 + sysdeps/generic/math-type-macros-float.h | 1 + sysdeps/generic/math-type-macros-ldouble.h | 1 + sysdeps/ieee754/float128/w_scalbf128.c | 1 + sysdeps/ieee754/float128/w_scalbf128_compat.c | 1 + sysdeps/ieee754/ldbl-opt/w_scalb_compat.c | 5 -- sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c | 5 -- 14 files changed, 56 insertions(+), 277 deletions(-) rename math/{e_scalb.c => e_scalb_template.c} (64%) delete mode 100644 math/e_scalbf.c delete mode 100644 math/e_scalbl.c rename math/{w_scalb_compat.c => w_scalb_compat_template.c} (69%) rename math/{w_scalbf_compat.c => w_scalb_template.c} (53%) delete mode 100644 math/w_scalbl_compat.c create mode 100644 sysdeps/ieee754/float128/w_scalbf128.c create mode 100644 sysdeps/ieee754/float128/w_scalbf128_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_scalb_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c diff --git a/math/Makefile b/math/Makefile index 335b1fb197..e5d9ab7013 100644 --- a/math/Makefile +++ b/math/Makefile @@ -48,7 +48,7 @@ libm-support = s_lib_version s_matherr s_signgam \ # Wrappers for these functions generated per type using a file named # _template.c and the appropriate math-type-macros-.h. -gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF \ +gen-libm-calls = cargF conjF cimagF crealF cabsF e_scalbF s_cacosF \ s_cacoshF s_ccosF s_ccoshF s_casinF s_csinF s_casinhF \ k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \ s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF \ @@ -57,13 +57,14 @@ gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF \ w_log1pF w_scalblnF s_fmaxmagF s_fminmagF w_acosF \ w_acoshF w_asinF w_atan2F w_atanhF w_coshF w_exp10F \ w_exp2F w_fmodF w_hypotF w_j0F w_j1F w_jnF w_logF \ - w_log10F w_log2F w_powF w_remainderF w_sinhF w_sqrtF \ + w_log10F w_log2F w_powF w_remainderF w_scalbF \ + w_scalbF_compat w_sinhF w_sqrtF \ w_tgammaF w_lgammaF w_lgammaF_r w_expF e_exp2F libm-calls = \ e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \ e_hypotF e_j0F e_j1F e_jnF e_lgammaF_r e_logF e_log10F e_powF \ - e_rem_pio2F e_remainderF e_scalbF e_sinhF e_sqrtF e_gammaF_r \ + e_rem_pio2F e_remainderF e_sinhF e_sqrtF e_gammaF_r \ e_ilogbF \ k_cosF k_sinF k_tanF s_asinhF s_atanF s_cbrtF \ s_ceilF s_cosF s_erfF s_expm1F s_fabsF \ diff --git a/math/e_scalb.c b/math/e_scalb_template.c similarity index 64% rename from math/e_scalb.c rename to math/e_scalb_template.c index 96c3579aad..02663424a7 100644 --- a/math/e_scalb.c +++ b/math/e_scalb_template.c @@ -1,6 +1,6 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Multiply by integral power of radix. + Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,36 +19,36 @@ #include #include - -static double +static FLOAT __attribute__ ((noinline)) -invalid_fn (double x, double fn) +invalid_fn (FLOAT x, FLOAT fn) { - if (__rint (fn) != fn) + if (M_SUF (__rint) (fn) != fn) return (fn - fn) / (fn - fn); - else if (fn > 65000.0) - return __scalbn (x, 65000); + else if (fn > M_LIT (65000.0)) + return M_SUF (__scalbn) (x, 65000); else - return __scalbn (x,-65000); + return M_SUF (__scalbn) (x,-65000); } -double -__ieee754_scalb (double x, double fn) +FLOAT +M_DECL_FUNC (__ieee754_scalb) (FLOAT x, FLOAT fn) { if (__glibc_unlikely (isnan (x))) return x * fn; if (__glibc_unlikely (!isfinite (fn))) { - if (isnan (fn) || fn > 0.0) + if (isnan (fn) || fn > M_LIT (0.0)) return x * fn; - if (x == 0.0) + if (x == M_LIT (0.0)) return x; return x / -fn; } - if (__glibc_unlikely (fabs (fn) >= 0x1p31 || (double) (int) fn != fn)) + if (__glibc_unlikely (M_FABS (fn) >= M_LIT (0x1p31) + || (FLOAT) (int) fn != fn)) return invalid_fn (x, fn); - return __scalbn (x, (int) fn); + return M_SCALBN (x, (int) fn); } -strong_alias (__ieee754_scalb, __scalb_finite) +declare_mgen_finite_alias (__ieee754_scalb, __scalb) diff --git a/math/e_scalbf.c b/math/e_scalbf.c deleted file mode 100644 index 23b38a95de..0000000000 --- a/math/e_scalbf.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -static float -__attribute__ ((noinline)) -invalid_fn (float x, float fn) -{ - if (__rintf (fn) != fn) - return (fn - fn) / (fn - fn); - else if (fn > 65000.0f) - return __scalbnf (x, 65000); - else - return __scalbnf (x,-65000); -} - - -float -__ieee754_scalbf (float x, float fn) -{ - if (__glibc_unlikely (isnan (x))) - return x * fn; - if (__glibc_unlikely (!isfinite (fn))) - { - if (isnan (fn) || fn > 0.0f) - return x * fn; - if (x == 0.0f) - return x; - return x / -fn; - } - if (__glibc_unlikely (fabsf (fn) >= 0x1p31f || (float) (int) fn != fn)) - return invalid_fn (x, fn); - - return __scalbnf (x, (int) fn); -} -strong_alias (__ieee754_scalbf, __scalbf_finite) diff --git a/math/e_scalbl.c b/math/e_scalbl.c deleted file mode 100644 index a677d06b9f..0000000000 --- a/math/e_scalbl.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -static long double -__attribute__ ((noinline)) -invalid_fn (long double x, long double fn) -{ - if (__rintl (fn) != fn) - return (fn - fn) / (fn - fn); - else if (fn > 65000.0L) - return __scalbnl (x, 65000); - else - return __scalbnl (x,-65000); -} - - -long double -__ieee754_scalbl (long double x, long double fn) -{ - if (__glibc_unlikely (isnan (x))) - return x * fn; - if (__glibc_unlikely (!isfinite (fn))) - { - if (isnan (fn) || fn > 0.0L) - return x * fn; - if (x == 0.0L) - return x; - return x / -fn; - } - if (__glibc_unlikely (fabsl (fn) >= 0x1p31L || (long double) (int) fn != fn)) - return invalid_fn (x, fn); - - return __scalbnl (x, (int) fn); -} -strong_alias (__ieee754_scalbl, __scalbl_finite) diff --git a/math/w_scalb_compat.c b/math/w_scalb_compat_template.c similarity index 69% rename from math/w_scalb_compat.c rename to math/w_scalb_compat_template.c index 5e57db4a9f..ba69aca017 100644 --- a/math/w_scalb_compat.c +++ b/math/w_scalb_compat_template.c @@ -1,6 +1,5 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -21,40 +20,37 @@ #include #include - #if LIBM_SVID_COMPAT -static double + +static FLOAT __attribute__ ((noinline)) -sysv_scalb (double x, double fn) +M_DECL_FUNC (sysv_scalb) (FLOAT x, FLOAT fn) { - double z = __ieee754_scalb (x, fn); + FLOAT z = M_SUF (__ieee754_scalb) (x, fn); if (__glibc_unlikely (isinf (z))) { if (isfinite (x)) - return __kernel_standard (x, fn, 32); /* scalb overflow */ + return M_K_STANDARD (x, fn, 32); /* scalb overflow */ else __set_errno (ERANGE); } - else if (__builtin_expect (z == 0.0, 0) && z != x) - return __kernel_standard (x, fn, 33); /* scalb underflow */ + else if (__builtin_expect (z == M_LIT (0.0), 0) && z != x) + return M_K_STANDARD (x, fn, 33); /* scalb underflow */ return z; } -#endif /* Wrapper scalb */ -double -__scalb (double x, double fn) +FLOAT +M_DECL_FUNC (__scalb) (FLOAT x, FLOAT fn) { -#if LIBM_SVID_COMPAT if (__glibc_unlikely (_LIB_VERSION == _SVID_)) - return sysv_scalb (x, fn); + return M_SUF (sysv_scalb) (x, fn); else -#endif { - double z = __ieee754_scalb (x, fn); + FLOAT z = M_SUF (__ieee754_scalb) (x, fn); if (__glibc_unlikely (!isfinite (z) || z == 0.0)) { @@ -78,8 +74,6 @@ __scalb (double x, double fn) return z; } } -weak_alias (__scalb, scalb) -#ifdef NO_LONG_DOUBLE -strong_alias (__scalb, __scalbl) -weak_alias (__scalb, scalbl) -#endif +declare_mgen_alias (__scalb, scalb); + +#endif /* __LIBM_SVID_COMPAT. */ diff --git a/math/w_scalbf_compat.c b/math/w_scalb_template.c similarity index 53% rename from math/w_scalbf_compat.c rename to math/w_scalb_template.c index 7e35a66f43..b2aafcdf36 100644 --- a/math/w_scalbf_compat.c +++ b/math/w_scalb_template.c @@ -1,6 +1,6 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Wrapper to set errno for scalb. + Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -16,47 +16,23 @@ License along with the GNU C Library; if not, see . */ +/* Only build wrappers from the templates for the types that define the macro + below. This macro is set in math-type-macros-.h in sysdeps/generic + for each floating-point type. */ +#if __USE_WRAPPER_TEMPLATE + #include #include #include -#include - -#if LIBM_SVID_COMPAT -static float -__attribute__ ((noinline)) -sysv_scalbf (float x, float fn) +/* Wrapper scalb */ +FLOAT +M_DECL_FUNC (__scalb) (FLOAT x, FLOAT fn) { - float z = __ieee754_scalbf (x, fn); - - if (__glibc_unlikely (isinf (z))) { - if (isfinite (x)) - return __kernel_standard_f (x, fn, 132); /* scalb overflow */ - else - __set_errno (ERANGE); - } - else if (__builtin_expect (z == 0.0f, 0) && z != x) - return __kernel_standard_f (x, fn, 133); /* scalb underflow */ - - return z; -} -#endif + FLOAT z = M_SUF (__ieee754_scalb) (x, fn); - -/* Wrapper scalbf */ -float -__scalbf (float x, float fn) -{ -#if LIBM_SVID_COMPAT - if (__glibc_unlikely (_LIB_VERSION == _SVID_)) - return sysv_scalbf (x, fn); - else -#endif - { - float z = __ieee754_scalbf (x, fn); - - if (__glibc_unlikely (!isfinite (z) || z == 0.0f)) + if (__glibc_unlikely (!isfinite (z) || z == M_LIT (0.0))) { if (isnan (z)) { @@ -71,11 +47,13 @@ __scalbf (float x, float fn) else { /* z == 0. */ - if (x != 0.0f && !isinf (fn)) + if (x != M_LIT (0.0) && !isinf (fn)) __set_errno (ERANGE); } } return z; } } -weak_alias (__scalbf, scalbf) +declare_mgen_alias (__scalb, scalb); + +#endif /* __USE_WRAPPER_TEMPLATE. */ diff --git a/math/w_scalbl_compat.c b/math/w_scalbl_compat.c deleted file mode 100644 index 658b081f91..0000000000 --- a/math/w_scalbl_compat.c +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include - - -#if LIBM_SVID_COMPAT -static long double -__attribute__ ((noinline)) -sysv_scalbl (long double x, long double fn) -{ - long double z = __ieee754_scalbl (x, fn); - - if (__glibc_unlikely (isinf (z))) - { - if (isfinite (x)) - return __kernel_standard_l (x, fn, 232); /* scalb overflow */ - else - __set_errno (ERANGE); - } - else if (__builtin_expect (z == 0.0L, 0) && z != x) - return __kernel_standard_l (x, fn, 233); /* scalb underflow */ - - return z; -} -#endif - - -/* Wrapper scalbl */ -long double -__scalbl (long double x, long double fn) -{ -#if LIBM_SVID_COMPAT - if (__glibc_unlikely (_LIB_VERSION == _SVID_)) - return sysv_scalbl (x, fn); - else -#endif - { - long double z = __ieee754_scalbl (x, fn); - - if (__glibc_unlikely (!isfinite (z) || z == 0.0L)) - { - if (isnan (z)) - { - if (!isnan (x) && !isnan (fn)) - __set_errno (EDOM); - } - else if (isinf (z)) - { - if (!isinf (x) && !isinf (fn)) - __set_errno (ERANGE); - } - else - { - /* z == 0. */ - if (x != 0.0L && !isinf (fn)) - __set_errno (ERANGE); - } - } - return z; - } -} -weak_alias (__scalbl, scalbl) diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h index be5d94488f..dfd0919b71 100644 --- a/sysdeps/generic/math-type-macros-double.h +++ b/sysdeps/generic/math-type-macros-double.h @@ -26,6 +26,7 @@ #define FLOAT double #define CFLOAT _Complex double #define M_STRTO_NAN __strtod_nan +#define M_K_STANDARD __kernel_standard #include #include diff --git a/sysdeps/generic/math-type-macros-float.h b/sysdeps/generic/math-type-macros-float.h index 1f280950cd..72b30171fa 100644 --- a/sysdeps/generic/math-type-macros-float.h +++ b/sysdeps/generic/math-type-macros-float.h @@ -25,6 +25,7 @@ #define FLOAT float #define CFLOAT _Complex float #define M_STRTO_NAN __strtof_nan +#define M_K_STANDARD __kernel_standard_f /* Standard/GNU macro literals do not exist for the float type. Use the double macro constants. */ diff --git a/sysdeps/generic/math-type-macros-ldouble.h b/sysdeps/generic/math-type-macros-ldouble.h index 300dd18f94..ef0a1e5b99 100644 --- a/sysdeps/generic/math-type-macros-ldouble.h +++ b/sysdeps/generic/math-type-macros-ldouble.h @@ -26,6 +26,7 @@ #define FLOAT long double #define CFLOAT _Complex long double #define M_STRTO_NAN __strtold_nan +#define M_K_STANDARD __kernel_standard_l #include #include diff --git a/sysdeps/ieee754/float128/w_scalbf128.c b/sysdeps/ieee754/float128/w_scalbf128.c new file mode 100644 index 0000000000..067b724164 --- /dev/null +++ b/sysdeps/ieee754/float128/w_scalbf128.c @@ -0,0 +1 @@ +/* Not defined for _FloatN types. */ diff --git a/sysdeps/ieee754/float128/w_scalbf128_compat.c b/sysdeps/ieee754/float128/w_scalbf128_compat.c new file mode 100644 index 0000000000..067b724164 --- /dev/null +++ b/sysdeps/ieee754/float128/w_scalbf128_compat.c @@ -0,0 +1 @@ +/* Not defined for _FloatN types. */ diff --git a/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c b/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c deleted file mode 100644 index f6d53a5ba5..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_scalb_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __scalb, scalbl, GLIBC_2_0); -#endif diff --git a/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c b/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c deleted file mode 100644 index c8feb654a2..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_scalbl_compat.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#undef weak_alias -#define weak_alias(n,a) -#include -long_double_symbol (libm, __scalbl, scalbl); From patchwork Wed Jun 20 02:04:18 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: 931902 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93428-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="alpmJSfb"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419Spr6Tdmz9s4n for ; Wed, 20 Jun 2018 12:05:40 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=Ic3E2Qxpwre5r9Xm4H+Y1RQOlznrVyg mQ0uBJJy+8Tekl3umKLOv0BXc1quBKacsw8VteeBv861Nz3dfJkHz4GEGXNNroZA +Gx2uWgZISXpK1KX7xLROYMjgI2jkHNJsaEX0zeicRUb8fa5DNsf8gEhh9zA3RaS 7azytgeAHIxQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=jICB8/Kum4tOyKJ6+EuknZozjFw=; b=alpmJ SfbZI12MP9YYYUcf+ISGOpAwW6jpID87rigGpTBf+rWA7NcMusCUmBqlRh1RYyoG WfWp1cAFGVLRbbMj7F8eYBkjDLiqOBolShtLEKwrMcdCTTePmSrDnxv1BH2lYBZf 5JRIdM9wl/eoMu084A6YaRNK2xEWb5zUTpIjSQ= Received: (qmail 2829 invoked by alias); 20 Jun 2018 02:05:25 -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 2558 invoked by uid 89); 20 Jun 2018 02:05:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=freely, 1993 X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com Subject: [PATCH 04/12] Add a generic significand implementation Date: Tue, 19 Jun 2018 23:04:18 -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-0012-0000-0000-00001680116C 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:05:18 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0013-0000-0000-0000536328D4 Message-Id: <20180620020426.20372-5-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Create a template for significand. 2018-06-19 Tulio Magno Quites Machado Filho * math/Makefile (libm-calls): Move s_significandF to... (gen-libm-calls): ... here. * math/s_significand_template.c: New file. * math/s_significand.c: Removed. * math/s_significandf.c: Removed. * math/s_significandl.c: Removed. * sysdeps/ieee754/ldbl-opt/s_significand.c: Removed. * sysdeps/ieee754/ldbl-opt/s_significandl.c: Removed. Signed-off-by: Tulio Magno Quites Machado Filho --- math/Makefile | 5 +++-- math/s_significand.c | 34 ------------------------------- math/s_significand_template.c | 33 ++++++++++++++++++++++++++++++ math/s_significandf.c | 27 ------------------------ math/s_significandl.c | 34 ------------------------------- sysdeps/ieee754/ldbl-opt/s_significand.c | 5 ----- sysdeps/ieee754/ldbl-opt/s_significandl.c | 5 ----- 7 files changed, 36 insertions(+), 107 deletions(-) delete mode 100644 math/s_significand.c create mode 100644 math/s_significand_template.c delete mode 100644 math/s_significandf.c delete mode 100644 math/s_significandl.c delete mode 100644 sysdeps/ieee754/ldbl-opt/s_significand.c delete mode 100644 sysdeps/ieee754/ldbl-opt/s_significandl.c diff --git a/math/Makefile b/math/Makefile index e5d9ab7013..291788b348 100644 --- a/math/Makefile +++ b/math/Makefile @@ -53,7 +53,8 @@ gen-libm-calls = cargF conjF cimagF crealF cabsF e_scalbF s_cacosF \ k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \ s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF \ s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF \ - s_nanF s_iseqsigF s_canonicalizeF w_ilogbF w_llogbF \ + s_nanF s_iseqsigF s_canonicalizeF s_significandF \ + w_ilogbF w_llogbF \ w_log1pF w_scalblnF s_fmaxmagF s_fminmagF w_acosF \ w_acoshF w_asinF w_atan2F w_atanhF w_coshF w_exp10F \ w_exp2F w_fmodF w_hypotF w_j0F w_j1F w_jnF w_logF \ @@ -70,7 +71,7 @@ libm-calls = \ s_ceilF s_cosF s_erfF s_expm1F s_fabsF \ s_floorF s_log1pF s_logbF \ s_nextafterF s_nexttowardF s_rintF s_scalblnF \ - s_significandF s_sinF s_tanF s_tanhF \ + s_sinF s_tanF s_tanhF \ s_fpclassifyF s_truncF \ s_remquoF e_log2F s_roundF s_nearbyintF s_sincosF \ s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F \ diff --git a/math/s_significand.c b/math/s_significand.c deleted file mode 100644 index 348bdcf6ad..0000000000 --- a/math/s_significand.c +++ /dev/null @@ -1,34 +0,0 @@ -/* @(#)s_signif.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: s_significand.c,v 1.6 1995/05/10 20:48:11 jtc Exp $"; -#endif - -/* - * significand(x) computes just - * scalb(x, (double) -ilogb(x)), - * for exercising the fraction-part(F) IEEE 754-1985 test vector. - */ - -#include -#include - -double __significand(double x) -{ - return __ieee754_scalb(x,(double) -__ilogb(x)); -} -weak_alias (__significand, significand) -#ifdef NO_LONG_DOUBLE -strong_alias (__significand, __significandl) -weak_alias (__significand, significandl) -#endif diff --git a/math/s_significand_template.c b/math/s_significand_template.c new file mode 100644 index 0000000000..0c5ad8d14b --- /dev/null +++ b/math/s_significand_template.c @@ -0,0 +1,33 @@ +/* Return the mantissa of a floating-point number. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* + * significand(x) computes just + * scalb(x, (FLOAT) - ilogb(x)), + * for exercising the fraction-part(F) IEEE 754-1985 test vector. + */ + +#include +#include + +FLOAT +M_DECL_FUNC (__significand) (FLOAT x) +{ + return M_SUF (__ieee754_scalb) (x,(FLOAT) - M_SUF (__ilogb) (x)); +} +declare_mgen_alias (__significand, significand) diff --git a/math/s_significandf.c b/math/s_significandf.c deleted file mode 100644 index 876e53932b..0000000000 --- a/math/s_significandf.c +++ /dev/null @@ -1,27 +0,0 @@ -/* s_significandf.c -- float version of s_significand.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: s_significandf.c,v 1.3 1995/05/10 20:48:13 jtc Exp $"; -#endif - -#include -#include - -float __significandf(float x) -{ - return __ieee754_scalbf(x,(float) -__ilogbf(x)); -} -weak_alias (__significandf, significandf) diff --git a/math/s_significandl.c b/math/s_significandl.c deleted file mode 100644 index 0e3337b2fe..0000000000 --- a/math/s_significandl.c +++ /dev/null @@ -1,34 +0,0 @@ -/* s_significandl.c -- long double version of s_significand.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#if defined(LIBM_SCCS) && !defined(lint) -static char rcsid[] = "$NetBSD: $"; -#endif - -/* - * significandl(x) computes just - * scalbl(x, (long double) -ilogbl(x)), - * for exercising the fraction-part(F) IEEE 754-1985 test vector. - */ - -#include -#include - -long double __significandl(long double x) -{ - return __ieee754_scalbl(x,(long double) -__ilogbl(x)); -} -weak_alias (__significandl, significandl) diff --git a/sysdeps/ieee754/ldbl-opt/s_significand.c b/sysdeps/ieee754/ldbl-opt/s_significand.c deleted file mode 100644 index 5287c09066..0000000000 --- a/sysdeps/ieee754/ldbl-opt/s_significand.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __significand, significandl, GLIBC_2_0); -#endif diff --git a/sysdeps/ieee754/ldbl-opt/s_significandl.c b/sysdeps/ieee754/ldbl-opt/s_significandl.c deleted file mode 100644 index 9339b4780d..0000000000 --- a/sysdeps/ieee754/ldbl-opt/s_significandl.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#undef weak_alias -#define weak_alias(n,a) -#include -long_double_symbol (libm, __significandl, significandl); From patchwork Wed Jun 20 02:04:19 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: 931903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93429-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="b+rVvH1N"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419Sq657HSz9s4n for ; Wed, 20 Jun 2018 12:05:54 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=mVkODXZviA9ky4QAentHKZpvzFm8fNr qgIkTvMQn5rTAFmrrTXVCSijJKYIVbAPbERBQ3hzJSvMSWDthdWvGfJ+iqSr7mMF QDvSihwo6uAED7mzeYM3uO/Flmde1pgKHQMk+Z7IQI60YS1ECCulb/VIdMP+8xxe mG/vo6mixJQQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=lQmI3T2CecXX37vRsRl4bE1XQ48=; b=b+rVv H1NysJ3CpRAxrb0weitLmp47gyPZ4rWozT+4ebjSxiNE16Jo0UJBRmP5LP5LJUVd X/fZPjRsIeAxIYLCqYi1xHlTzYGcHZlqMtH511oRqL8j9KNXFna8QQqnofHRomuO 9ZpxY/tfhXY984zv+2fQ7DUzZEsT3YlqMUJ9ZA= Received: (qmail 4461 invoked by alias); 20 Jun 2018 02:05:38 -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 4231 invoked by uid 89); 20 Jun 2018 02:05:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.1 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=tan X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com Subject: [PATCH 05/12] Refactor math/bits/math-finite.h, reusing math/bits/mathcalls.h [BZ #23292] Date: Tue, 19 Jun 2018 23:04:19 -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-0060-0000-0000-0000027FEFA2 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:05:25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0061-0000-0000-00004582D3F2 Message-Id: <20180620020426.20372-6-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 On a new enough compiler, redirecting the same function twice can cause -Werror=pragmas errors. This issue may appear when redirecting a floating point function to a different ABI at the same time that finite redirections are expected. This patch removes all of the common redirections done in math-finite.h in order to reuse mathcalls.h. Prototypes and redirections are now defined only once. The finite functions are identified with macros __MATHCALL_FINITE or __MATHCALL_VEC_FINITE. When finite functions are not requested, the macros behave in the same way as their non-finite peers, i.e. __MATHCALL and __MATHCALL_VEC. However, when finite functions are requested, i.e. __FINITE_MATH_ONLY__ > 0, they both redirect their functions via __MATHREDIR, using __MATH_FINITE_NAME to set the name of the target function. In another change, math-finite.h inline functions are modified in order to benefit from functions that have already been redirected. Macro __REDIRTO_PUBLIC_F is used to reuse functions that are already available in the API, e.g. lgammal is is an inline function that calls __lgammal_r_finite, which has already been redirected via assembly to __lgammaf128_r_finite. The inline function could be directly redirected to its respective f128 as it isn't guaranteed to be available in the API. 2018-06-19 Tulio Magno Quites Machado Filho [BZ #23292] * math/bits/math-finite.h: Move most of the functions to bits/mathcalls.h. * math/bits/mathcalls.h: Use macros __MATHCALL_FINITE and __MATHCALL_VEC_FINITE to identify finite functions. * math/math.h (__MATH_FINITE_NAMEY, __MATH_FINITE_NAMEX, __MATH_FINITE_NAME_IMPL, __MATH_FINITE_NAME, __MATHCALL_VEC_FINITE, __MATHCALL_FINITE): New macros. [defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0]: Include bits/math-finite.h for double, float and long double earlier in order to use its functions from the math-finite.h of _FloatN types. Signed-off-by: Tulio Magno Quites Machado Filho --- math/bits/math-finite.h | 160 ++++------------- math/bits/mathcalls.h | 53 +++--- math/math.h | 466 +++++++++++++++++++++++++----------------------- 3 files changed, 296 insertions(+), 383 deletions(-) diff --git a/math/bits/math-finite.h b/math/bits/math-finite.h index 0799fe7b29..7a23b234cc 100644 --- a/math/bits/math-finite.h +++ b/math/bits/math-finite.h @@ -20,96 +20,27 @@ # error "Never use directly; include instead." #endif -#define __REDIRFROM(...) __REDIRFROM_X(__VA_ARGS__) +#define __REDIRFROM_F(...) __REDIRFROM_X(__VA_ARGS__) -#define __REDIRTO(...) __REDIRTO_X(__VA_ARGS__) +#define __REDIRTO_F(...) __REDIRTO_X(__VA_ARGS__) -#define __MATH_REDIRCALL_X(from, args, to) \ - extern _Mdouble_ __REDIRECT_NTH (from, args, to) -#define __MATH_REDIRCALL(function, reentrant, args) \ - __MATH_REDIRCALL_X \ - (__REDIRFROM (function, reentrant), args, \ - __REDIRTO (function, reentrant)) -#define __MATH_REDIRCALL_2(from, reentrant, args, to) \ - __MATH_REDIRCALL_X \ - (__REDIRFROM (from, reentrant), args, \ - __REDIRTO (to, reentrant)) - -#define __MATH_REDIRCALL_INTERNAL(function, reentrant, args) \ - __MATH_REDIRCALL_X \ - (__REDIRFROM (__CONCAT (__, function), \ - __CONCAT (reentrant, _finite)), \ - args, __REDIRTO (function, _r)) - - -/* acos. */ -__MATH_REDIRCALL (acos, , (_Mdouble_)); - -#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* acosh. */ -__MATH_REDIRCALL (acosh, , (_Mdouble_)); -#endif - -/* asin. */ -__MATH_REDIRCALL (asin, , (_Mdouble_)); - -/* atan2. */ -__MATH_REDIRCALL (atan2, , (_Mdouble_, _Mdouble_)); - -#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* atanh. */ -__MATH_REDIRCALL (atanh, , (_Mdouble_)); -#endif - -/* cosh. */ -__MATH_REDIRCALL (cosh, , (_Mdouble_)); - -/* exp. */ -__MATH_REDIRCALL (exp, , (_Mdouble_)); - -#if __GLIBC_USE (IEC_60559_FUNCS_EXT) -/* exp10. */ -__MATH_REDIRCALL (exp10, , (_Mdouble_)); -#endif - -#ifdef __USE_ISOC99 -/* exp2. */ -__MATH_REDIRCALL (exp2, , (_Mdouble_)); -#endif - -/* fmod. */ -__MATH_REDIRCALL (fmod, , (_Mdouble_, _Mdouble_)); - -#if defined __USE_XOPEN || defined __USE_ISOC99 -/* hypot. */ -__MATH_REDIRCALL (hypot, , (_Mdouble_, _Mdouble_)); -#endif +/* Redirects to a function that is part of the API. */ +#define __REDIRTO_PUBLIC_F(...) __REDIRTO_PUBLIC_X(__VA_ARGS__) -#if (__MATH_DECLARING_DOUBLE && (defined __USE_MISC || defined __USE_XOPEN)) \ - || (!__MATH_DECLARING_DOUBLE && defined __USE_MISC) -/* j0. */ -__MATH_REDIRCALL (j0, , (_Mdouble_)); +#define __MATH_REDIR_X(type, from, args, to) \ + extern type __REDIRECT_NTH (from, args, to) -/* y0. */ -__MATH_REDIRCALL (y0, , (_Mdouble_)); - -/* j1. */ -__MATH_REDIRCALL (j1, , (_Mdouble_)); - -/* y1. */ -__MATH_REDIRCALL (y1, , (_Mdouble_)); - -/* jn. */ -__MATH_REDIRCALL (jn, , (int, _Mdouble_)); +#define __MATH_REDIRCALL(function, reentrant, args) \ + __MATH_REDIR_X (_Mdouble_, \ + __REDIRFROM_F (function, reentrant), args, \ + __REDIRTO_F (function, reentrant)) -/* yn. */ -__MATH_REDIRCALL (yn, , (int, _Mdouble_)); -#endif +#define __MATH_REDIRCALL_INTERNAL(function, reentrant, args) \ + __MATH_REDIR_X (_Mdouble_, \ + __REDIRFROM_F (__CONCAT (__, function), \ + __CONCAT (reentrant, _finite)), \ + args, __REDIRTO_F (function, _r)) -#ifdef __USE_MISC -/* lgamma_r. */ -__MATH_REDIRCALL (lgamma, _r, (_Mdouble_, int *)); -#endif /* Redirect __lgammal_r_finite to __lgamma_r_finite when __NO_LONG_DOUBLE_MATH is set and to itself otherwise. It also redirects __lgamma_r_finite and @@ -120,13 +51,13 @@ __MATH_REDIRCALL_INTERNAL (lgamma, _r, (_Mdouble_, int *)); && defined __extern_always_inline) /* lgamma. */ __extern_always_inline _Mdouble_ -__NTH (__REDIRFROM (lgamma, ) (_Mdouble_ __d)) +__NTH (__REDIRFROM_F (lgamma, ) (_Mdouble_ __d)) { # if defined __USE_MISC || defined __USE_XOPEN - return __REDIRTO (lgamma, _r) (__d, &signgam); + return __REDIRTO_PUBLIC_F (lgamma, _r) (__d, &signgam); # else int __local_signgam = 0; - return __REDIRTO (lgamma, _r) (__d, &__local_signgam); + return __REDIRTO_PUBLIC_F (lgamma, _r) (__d, &__local_signgam); # endif } #endif @@ -135,63 +66,32 @@ __NTH (__REDIRFROM (lgamma, ) (_Mdouble_ __d)) && defined __extern_always_inline) && !__MATH_DECLARING_FLOATN /* gamma. */ __extern_always_inline _Mdouble_ -__NTH (__REDIRFROM (gamma, ) (_Mdouble_ __d)) +__NTH (__REDIRFROM_F (gamma, ) (_Mdouble_ __d)) { - return __REDIRTO (lgamma, _r) (__d, &signgam); + return __REDIRTO_PUBLIC_F (lgamma, _r) (__d, &signgam); } #endif -/* log. */ -__MATH_REDIRCALL (log, , (_Mdouble_)); - -/* log10. */ -__MATH_REDIRCALL (log10, , (_Mdouble_)); - -#ifdef __USE_ISOC99 -/* log2. */ -__MATH_REDIRCALL (log2, , (_Mdouble_)); -#endif - -/* pow. */ -__MATH_REDIRCALL (pow, , (_Mdouble_, _Mdouble_)); - -#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* remainder. */ -__MATH_REDIRCALL (remainder, , (_Mdouble_, _Mdouble_)); -#endif - -#if ((__MATH_DECLARING_DOUBLE \ - && (defined __USE_MISC \ - || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))) \ - || (!defined __MATH_DECLARE_LDOUBLE && defined __USE_MISC)) \ - && !__MATH_DECLARING_FLOATN -/* scalb. */ -__MATH_REDIRCALL (scalb, , (_Mdouble_, _Mdouble_)); -#endif - -/* sinh. */ -__MATH_REDIRCALL (sinh, , (_Mdouble_)); - -/* sqrt. */ -__MATH_REDIRCALL (sqrt, , (_Mdouble_)); - #if defined __USE_ISOC99 && defined __extern_always_inline /* tgamma. */ +# if __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL +__MATH_REDIRCALL_INTERNAL (gamma, _r, (_Mdouble_, int *)); +# else extern _Mdouble_ -__REDIRFROM (__gamma, _r_finite) (_Mdouble_, int *); +__REDIRFROM_F (__gamma, _r_finite) (_Mdouble_, int *); +# endif __extern_always_inline _Mdouble_ -__NTH (__REDIRFROM (tgamma, ) (_Mdouble_ __d)) +__NTH (__REDIRFROM_F (tgamma, ) (_Mdouble_ __d)) { int __local_signgam = 0; - _Mdouble_ __res = __REDIRTO (gamma, _r) (__d, &__local_signgam); + _Mdouble_ __res = __REDIRTO_PUBLIC_F (gamma, _r) (__d, &__local_signgam); return __local_signgam < 0 ? -__res : __res; } #endif -#undef __REDIRFROM -#undef __REDIRTO #undef __MATH_REDIRCALL -#undef __MATH_REDIRCALL_2 #undef __MATH_REDIRCALL_INTERNAL -#undef __MATH_REDIRCALL_X +#undef __MATH_REDIR_X +#undef __REDIRFROM_F +#undef __REDIRTO_F diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index cf87313e2f..f4246a7881 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -50,13 +50,13 @@ /* Trigonometric functions. */ /* Arc cosine of X. */ -__MATHCALL (acos,, (_Mdouble_ __x)); +__MATHCALL_FINITE (acos,, (_Mdouble_ __x)); /* Arc sine of X. */ -__MATHCALL (asin,, (_Mdouble_ __x)); +__MATHCALL_FINITE (asin,, (_Mdouble_ __x)); /* Arc tangent of X. */ __MATHCALL (atan,, (_Mdouble_ __x)); /* Arc tangent of Y/X. */ -__MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); +__MATHCALL_FINITE (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ __MATHCALL_VEC (cos,, (_Mdouble_ __x)); @@ -68,9 +68,9 @@ __MATHCALL (tan,, (_Mdouble_ __x)); /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ -__MATHCALL (cosh,, (_Mdouble_ __x)); +__MATHCALL_FINITE (cosh,, (_Mdouble_ __x)); /* Hyperbolic sine of X. */ -__MATHCALL (sinh,, (_Mdouble_ __x)); +__MATHCALL_FINITE (sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL (tanh,, (_Mdouble_ __x)); @@ -82,17 +82,17 @@ __MATHDECL_VEC (void,sincos,, #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Hyperbolic arc cosine of X. */ -__MATHCALL (acosh,, (_Mdouble_ __x)); +__MATHCALL_FINITE (acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ __MATHCALL (asinh,, (_Mdouble_ __x)); /* Hyperbolic arc tangent of X. */ -__MATHCALL (atanh,, (_Mdouble_ __x)); +__MATHCALL_FINITE (atanh,, (_Mdouble_ __x)); #endif /* Exponential and logarithmic functions. */ /* Exponential function of X. */ -__MATHCALL_VEC (exp,, (_Mdouble_ __x)); +__MATHCALL_VEC_FINITE (exp,, (_Mdouble_ __x)); /* Break VALUE into a normalized fraction and an integral power of 2. */ __MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); @@ -101,17 +101,17 @@ __MATHCALL (frexp,, (_Mdouble_ __x, int *__exponent)); __MATHCALL (ldexp,, (_Mdouble_ __x, int __exponent)); /* Natural logarithm of X. */ -__MATHCALL_VEC (log,, (_Mdouble_ __x)); +__MATHCALL_VEC_FINITE (log,, (_Mdouble_ __x)); /* Base-ten logarithm of X. */ -__MATHCALL (log10,, (_Mdouble_ __x)); +__MATHCALL_FINITE (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); #if __GLIBC_USE (IEC_60559_FUNCS_EXT) /* Compute exponent to base ten. */ -__MATHCALL (exp10,, (_Mdouble_ __x)); +__MATHCALL_FINITE (exp10,, (_Mdouble_ __x)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 @@ -127,24 +127,23 @@ __MATHCALL (logb,, (_Mdouble_ __x)); #ifdef __USE_ISOC99 /* Compute base-2 exponential of X. */ -__MATHCALL (exp2,, (_Mdouble_ __x)); +__MATHCALL_FINITE (exp2,, (_Mdouble_ __x)); /* Compute base-2 logarithm of X. */ -__MATHCALL (log2,, (_Mdouble_ __x)); +__MATHCALL_FINITE (log2,, (_Mdouble_ __x)); #endif - /* Power functions. */ /* Return X to the Y power. */ -__MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALL_VEC_FINITE (pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ -__MATHCALL (sqrt,, (_Mdouble_ __x)); +__MATHCALL_FINITE (sqrt,, (_Mdouble_ __x)); #if defined __USE_XOPEN || defined __USE_ISOC99 /* Return `sqrt(X*X + Y*Y)'. */ -__MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALL_FINITE (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); #endif #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 @@ -165,7 +164,7 @@ __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); __MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); /* Floating-point modulo remainder of X/Y. */ -__MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALL_FINITE (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); #ifdef __USE_MISC # if ((!defined __cplusplus \ @@ -214,12 +213,12 @@ __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE) /* Bessel functions. */ -__MATHCALL (j0,, (_Mdouble_)); -__MATHCALL (j1,, (_Mdouble_)); -__MATHCALL (jn,, (int, _Mdouble_)); -__MATHCALL (y0,, (_Mdouble_)); -__MATHCALL (y1,, (_Mdouble_)); -__MATHCALL (yn,, (int, _Mdouble_)); +__MATHCALL_FINITE (j0,, (_Mdouble_)); +__MATHCALL_FINITE (j1,, (_Mdouble_)); +__MATHCALL_FINITE (jn,, (int, _Mdouble_)); +__MATHCALL_FINITE (y0,, (_Mdouble_)); +__MATHCALL_FINITE (y1,, (_Mdouble_)); +__MATHCALL_FINITE (yn,, (int, _Mdouble_)); #endif @@ -246,7 +245,7 @@ __MATHCALL (gamma,, (_Mdouble_)); /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ -__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); +__MATHCALL_FINITE (lgamma,_r, (_Mdouble_, int *__signgamp)); #endif @@ -269,7 +268,7 @@ __MATHCALL (nextup,, (_Mdouble_ __x)); # endif /* Return the remainder of integer divison X / Y with infinite precision. */ -__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALL_FINITE (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); # ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ @@ -393,5 +392,5 @@ __MATHDECL_1 (int, setpayloadsig,, (_Mdouble_ *__x, _Mdouble_ __payload)); && !defined __USE_XOPEN2K8)) \ && !__MATH_DECLARING_FLOATN /* Return X times (2 to the Nth power). */ -__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); +__MATHCALL_FINITE (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); #endif diff --git a/math/math.h b/math/math.h index 998d3042c5..c1765e4c8c 100644 --- a/math/math.h +++ b/math/math.h @@ -286,6 +286,28 @@ enum #define __MATHREDIR(type, function, suffix, args, to) \ extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to) +#define __MATH_FINITE_NAMEY(p, f, s) \ + p ## f ## s +#define __MATH_FINITE_NAMEX(p, f, s) \ + __MATH_FINITE_NAMEY (p, f, s) +#define __MATH_FINITE_NAME_IMPL(function, suffix) \ + __MATH_FINITE_NAMEX (__, __MATH_PRECNAME (function, suffix), _finite) +#define __MATH_FINITE_NAME(function, suffix) \ + __MATH_FINITE_NAME_IMPL (function, suffix) + +#if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# define __MATHCALL_VEC_FINITE(function, suffix, args) \ + __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \ + __MATHCALL_FINITE (function, suffix, args) +# define __MATHCALL_FINITE(function, suffix, args) \ + __MATHREDIR (_Mdouble_, function, suffix, args, \ + __MATH_FINITE_NAME(function, suffix)) +#else +# define __MATHCALL_VEC_FINITE(function, suffix, args) \ + __MATHCALL_VEC(function, suffix, args) +# define __MATHCALL_FINITE(function, suffix, args) \ + __MATHCALL (function, suffix, args) +#endif #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) @@ -320,6 +342,10 @@ enum || defined _LIBC_TEST # ifdef __LDBL_COMPAT +# undef __MATH_FINITE_NAME +# define __MATH_FINITE_NAME(function, suffix) \ + __MATH_FINITE_NAMEX (__, function ## suffix, _finite) + # ifdef __USE_ISOC99 extern float __nldbl_nexttowardf (float __x, long double __y) __THROW __attribute__ ((__const__)); @@ -364,8 +390,99 @@ extern long double __REDIRECT_NTH (nexttowardl, #endif /* Use ISO C99. */ +#if defined __USE_MISC || defined __USE_XOPEN +/* This variable is used by `gamma' and `lgamma'. */ +extern int signgam; +#endif + +/* Define special entry points to use when the compiler got told to + only expect finite results. */ +#if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 + +/* Include bits/math-finite.h for double. */ +# define _Mdouble_ double +# define __MATH_DECLARING_DOUBLE 1 +# define __MATH_DECLARING_FLOATN 0 +# define __REDIRFROM_X(function, reentrant) \ + function ## reentrant +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## reentrant ## _finite +# define __REDIRTO_PUBLIC_X(function, reentrant) \ + __REDIRTO_X(function, reentrant) +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# undef __REDIRTO_PUBLIC_X + +/* When __USE_ISOC99 is defined, include math-finite for float and + long double, as well. */ +# ifdef __USE_ISOC99 + +/* Include bits/math-finite.h for float. */ +# define _Mdouble_ float +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 0 +# define __REDIRFROM_X(function, reentrant) \ + function ## f ## reentrant +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f ## reentrant ## _finite +# define __REDIRTO_PUBLIC_X(function, reentrant) \ + __REDIRTO_X(function, reentrant) +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# undef __REDIRTO_PUBLIC_X + +/* Include bits/math-finite.h for long double. */ +# ifdef __MATH_DECLARE_LDOUBLE +# define _Mdouble_ long double +# define __MATH_DECLARING_DOUBLE 0 +# define __MATH_DECLARING_FLOATN 0 +# define __REDIRFROM_X(function, reentrant) \ + function ## l ## reentrant +# ifdef __NO_LONG_DOUBLE_MATH +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## reentrant ## _finite +# define __REDIRTO_PUBLIC_X(function, reentrant) \ + __REDIRTO_X(function, reentrant) +# elif __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f128 ## reentrant ## _finite +# define __REDIRTO_PUBLIC_X(function, reentrant) \ + __ ## function ## l ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## l ## reentrant ## _finite +# define __REDIRTO_PUBLIC_X(function, reentrant) \ + __REDIRTO_X(function, reentrant) +# endif +# include +# undef _Mdouble_ +# undef __MATH_DECLARING_DOUBLE +# undef __MATH_DECLARING_FLOATN +# undef __REDIRFROM_X +# undef __REDIRTO_X +# undef __REDIRTO_PUBLIC_X +# endif + +# endif /* __USE_ISOC99. */ +#endif /* __FINITE_MATH_ONLY__ > 0. */ + /* Include the file of declarations for _FloatN and _FloatNx types. */ +#undef __MATH_FINITE_NAME +#define __MATH_FINITE_NAME(function, suffix) \ + __MATH_FINITE_NAMEX (, __REDIRTO_X (function, suffix),) +#define __REDIRFROM_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +#define __REDIRTO_PUBLIC_X(function, reentrant) \ + __REDIRTO_X(function, reentrant) #if __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC) # define _Mdouble_ _Float16 @@ -376,12 +493,27 @@ extern long double __REDIRECT_NTH (nexttowardl, # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# if __HAVE_DISTINCT_FLOAT16 +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f16 ## reentrant ## _finite +# else +# error "non-distinct _Float16" +# endif +# else +# define __REDIRTO_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +# endif # include +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# include +# endif # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# undef __REDIRTO_X #endif /* __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC) @@ -393,12 +525,28 @@ extern long double __REDIRECT_NTH (nexttowardl, # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# if __HAVE_DISTINCT_FLOAT32 +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f32 ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f ## reentrant ## _finite +# endif +# else +# define __REDIRTO_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +# endif # include +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# include +# endif # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# undef __REDIRTO_X #endif /* __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC) @@ -410,12 +558,28 @@ extern long double __REDIRECT_NTH (nexttowardl, # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# if __HAVE_DISTINCT_FLOAT64 +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f64 ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## reentrant ## _finite +# endif +# else +# define __REDIRTO_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +# endif # include +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# include +# endif # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# undef __REDIRTO_X #endif /* __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC) @@ -427,12 +591,28 @@ extern long double __REDIRECT_NTH (nexttowardl, # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# if __HAVE_DISTINCT_FLOAT128 +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f128 ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## l ## reentrant ## _finite +# endif +# else +# define __REDIRTO_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +# endif # include +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# include +# endif # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# undef __REDIRTO_X #endif /* __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC) @@ -444,12 +624,28 @@ extern long double __REDIRECT_NTH (nexttowardl, # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# if __HAVE_DISTINCT_FLOAT32X +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f32x ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## reentrant ## _finite +# endif +# else +# define __REDIRTO_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +# endif # include +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# include +# endif # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# undef __REDIRTO_X #endif /* __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC) @@ -461,12 +657,31 @@ extern long double __REDIRECT_NTH (nexttowardl, # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# if __HAVE_DISTINCT_FLOAT64X +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f64x ## reentrant ## _finite +# elif __HAVE_FLOAT64X_LONG_DOUBLE +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## l ## reentrant ## _finite +# else +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f128 ## reentrant ## _finite +# endif +# else +# define __REDIRTO_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +# endif # include +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# include +# endif # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# undef __REDIRTO_X #endif /* __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC). */ #if __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC) @@ -478,18 +693,43 @@ extern long double __REDIRECT_NTH (nexttowardl, # include # endif # if __GLIBC_USE (IEC_60559_TYPES_EXT) +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# if __HAVE_DISTINCT_FLOAT128X +# define __REDIRTO_X(function, reentrant) \ + __ ## function ## f128x ## reentrant ## _finite +# else +# error "non-distinct _Float128x" +# endif +# else +# define __REDIRTO_X(function, reentrant) \ + __MATH_PRECNAME (function, reentrant) +# endif # include +# if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 +# include +# endif # endif # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# undef __REDIRTO_X #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ +#undef __REDIRFROM_X +#undef __REDIRTO_PUBLIC_X #undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL +#undef __MATHCALL_VEC +#undef __MATHCALL_FINITE +#undef __MATHCALL_VEC_FINITE +#undef __MATHREDIR +#undef __MATH_FINITE_NAMEY +#undef __MATH_FINITE_NAMEX +#undef __MATH_FINITE_NAME_IMPL +#undef __MATH_FINITE_NAME /* Declare functions returning a narrower type. */ #define __MATHCALL_NARROW_ARGS_1 (_Marg_ __x) @@ -776,11 +1016,6 @@ extern long double __REDIRECT_NTH (nexttowardl, #undef __MATHCALL_NARROW_REDIR #undef __MATHCALL_NARROW -#if defined __USE_MISC || defined __USE_XOPEN -/* This variable is used by `gamma' and `lgamma'. */ -extern int signgam; -#endif - #if (__HAVE_DISTINCT_FLOAT16 \ || __HAVE_DISTINCT_FLOAT32 \ || __HAVE_DISTINCT_FLOAT64 \ @@ -1248,227 +1483,6 @@ iszero (__T __val) # include #endif -/* Define special entry points to use when the compiler got told to - only expect finite results. */ -#if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0 - -/* Include bits/math-finite.h for double. */ -# define _Mdouble_ double -# define __MATH_DECLARING_DOUBLE 1 -# define __MATH_DECLARING_FLOATN 0 -# define __REDIRFROM_X(function, reentrant) \ - function ## reentrant -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## reentrant ## _finite -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X - -/* When __USE_ISOC99 is defined, include math-finite for float and - long double, as well. */ -# ifdef __USE_ISOC99 - -/* Include bits/math-finite.h for float. */ -# define _Mdouble_ float -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 0 -# define __REDIRFROM_X(function, reentrant) \ - function ## f ## reentrant -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f ## reentrant ## _finite -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X - -/* Include bits/math-finite.h for long double. */ -# ifdef __MATH_DECLARE_LDOUBLE -# define _Mdouble_ long double -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 0 -# define __REDIRFROM_X(function, reentrant) \ - function ## l ## reentrant -# ifdef __NO_LONG_DOUBLE_MATH -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## reentrant ## _finite -# else -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## l ## reentrant ## _finite -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -# endif /* __USE_ISOC99. */ - -/* Include bits/math-finite.h for _FloatN and _FloatNx. */ - -# if (__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)) \ - && __GLIBC_USE (IEC_60559_TYPES_EXT) -# define _Mdouble_ _Float16 -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 1 -# define __REDIRFROM_X(function, reentrant) \ - function ## f16 ## reentrant -# if __HAVE_DISTINCT_FLOAT16 -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f16 ## reentrant ## _finite -# else -# error "non-disinct _Float16" -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -# if (__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)) \ - && __GLIBC_USE (IEC_60559_TYPES_EXT) -# define _Mdouble_ _Float32 -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 1 -# define __REDIRFROM_X(function, reentrant) \ - function ## f32 ## reentrant -# if __HAVE_DISTINCT_FLOAT32 -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f32 ## reentrant ## _finite -# else -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f ## reentrant ## _finite -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -# if (__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)) \ - && __GLIBC_USE (IEC_60559_TYPES_EXT) -# define _Mdouble_ _Float64 -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 1 -# define __REDIRFROM_X(function, reentrant) \ - function ## f64 ## reentrant -# if __HAVE_DISTINCT_FLOAT64 -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f64 ## reentrant ## _finite -# else -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## reentrant ## _finite -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -# if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \ - && __GLIBC_USE (IEC_60559_TYPES_EXT) -# define _Mdouble_ _Float128 -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 1 -# define __REDIRFROM_X(function, reentrant) \ - function ## f128 ## reentrant -# if __HAVE_DISTINCT_FLOAT128 -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f128 ## reentrant ## _finite -# else -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## l ## reentrant ## _finite -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -# if (__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)) \ - && __GLIBC_USE (IEC_60559_TYPES_EXT) -# define _Mdouble_ _Float32x -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 1 -# define __REDIRFROM_X(function, reentrant) \ - function ## f32x ## reentrant -# if __HAVE_DISTINCT_FLOAT32X -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f32x ## reentrant ## _finite -# else -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## reentrant ## _finite -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -# if (__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)) \ - && __GLIBC_USE (IEC_60559_TYPES_EXT) -# define _Mdouble_ _Float64x -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 1 -# define __REDIRFROM_X(function, reentrant) \ - function ## f64x ## reentrant -# if __HAVE_DISTINCT_FLOAT64X -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f64x ## reentrant ## _finite -# elif __HAVE_FLOAT64X_LONG_DOUBLE -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## l ## reentrant ## _finite -# else -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f128 ## reentrant ## _finite -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -# if (__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)) \ - && __GLIBC_USE (IEC_60559_TYPES_EXT) -# define _Mdouble_ _Float128x -# define __MATH_DECLARING_DOUBLE 0 -# define __MATH_DECLARING_FLOATN 1 -# define __REDIRFROM_X(function, reentrant) \ - function ## f128x ## reentrant -# if __HAVE_DISTINCT_FLOAT128X -# define __REDIRTO_X(function, reentrant) \ - __ ## function ## f128x ## reentrant ## _finite -# else -# error "non-disinct _Float128x" -# endif -# include -# undef _Mdouble_ -# undef __MATH_DECLARING_DOUBLE -# undef __MATH_DECLARING_FLOATN -# undef __REDIRFROM_X -# undef __REDIRTO_X -# endif - -#endif /* __FINITE_MATH_ONLY__ > 0. */ - #if __GLIBC_USE (IEC_60559_BFP_EXT) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ From patchwork Wed Jun 20 02:04:20 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: 931904 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93430-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="WT6cYJiH"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419SqS49c6z9s4n for ; Wed, 20 Jun 2018 12:06:12 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=UyW3ou8d4aL85617rUXmIjwCxX7u9hp lYe42WYhZh5j6qRS0g2THbvh0FL8jl8gNjggvbJkzVD0WmBTDQGbkKO6FjnjtTBC bwuOsvvoSNL77PGzkPPxHbeSiPINFBlMTUnaLkZwFeOl3Yc6V+3SJof7F2Lwxc5P BrizEC6P7mEM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=x+3uGpLSgCUmZWX0Gtx72vyITss=; b=WT6cY JiH3t7FbnkNsSyvx4paFxcrkRlMOwlMMJwOsSFVCs1X0h8gp5mnek63gRACdBonv WvSz+sFPbJaqrBc+G1PTOtb89yDnCBe+8/WxY2ypb0S6d16f7LyQfcjXnYJGriuA davFKov/WQtPMItZUBZS4F9t2hxJ17sm9Szuas= Received: (qmail 4813 invoked by alias); 20 Jun 2018 02:05:41 -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 4671 invoked by uid 89); 20 Jun 2018 02:05:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, 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 Subject: [PATCH 06/12] ldbl-128ibm-compat: Create libm-alias-float128.h Date: Tue, 19 Jun 2018 23:04:20 -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-0016-0000-0000-000008FD0389 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.00828476; MB=3.00021748; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 02:05:34 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0017-0000-0000-00003F588469 Message-Id: <20180620020426.20372-7-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Add a new libm-alias-float128.h in order to provide the __*ieee128 aliases for the existing *f128 that do not have a globally exported symbol. 2018-06-19 Tulio Magno Quites Machado Filho Gabriel F. T. Gomes * sysdeps/ieee754/ldbl-128ibm-compat/Versions: New file. * sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h: New file. --- sysdeps/ieee754/ldbl-128ibm-compat/Versions | 113 +++++++++++++++++++++ .../ldbl-128ibm-compat/libm-alias-float128.h | 64 ++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/Versions create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions new file mode 100644 index 0000000000..322041132e --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -0,0 +1,113 @@ +%include +%ifndef LDBL_IBM128_VERSION +% error "ldbl-128ibm-compat-abi.h must define LDBL_IBM128_VERSION" +%endif + +libm { + LDBL_IBM128_VERSION { + __acoshieee128; + __acosieee128; + __asinhieee128; + __asinieee128; + __atan2ieee128; + __atanhieee128; + __atanieee128; + __cabsieee128; + __cacoshieee128; + __cacosieee128; + __canonicalizeieee128; + __cargieee128; + __casinhieee128; + __casinieee128; + __catanhieee128; + __catanieee128; + __cbrtieee128; + __ccoshieee128; + __ccosieee128; + __ceilieee128; + __cexpieee128; + __cimagieee128; + __clog10ieee128; + __clogieee128; + __conjieee128; + __copysignieee128; + __coshieee128; + __cosieee128; + __cpowieee128; + __cprojieee128; + __crealieee128; + __csinhieee128; + __csinieee128; + __csqrtieee128; + __ctanhieee128; + __ctanieee128; + __erfcieee128; + __erfieee128; + __exp10ieee128; + __exp2ieee128; + __expieee128; + __expm1ieee128; + __fabsieee128; + __fdimieee128; + __floorieee128; + __fmaieee128; + __fmaxieee128; + __fmaxmagieee128; + __fminieee128; + __fminmagieee128; + __fmodieee128; + __frexpieee128; + __fromfpieee128; + __fromfpxieee128; + __getpayloadieee128; + __hypotieee128; + __ilogbieee128; + __j0ieee128; + __j1ieee128; + __jnieee128; + __ldexpieee128; + __lgammaieee128; + __lgammaieee128_r; + __llogbieee128; + __llrintieee128; + __llroundieee128; + __log10ieee128; + __log1pieee128; + __log2ieee128; + __logbieee128; + __logieee128; + __lrintieee128; + __lroundieee128; + __modfieee128; + __nanieee128; + __nearbyintieee128; + __nextafterieee128; + __nextdownieee128; + __nextupieee128; + __powieee128; + __remainderieee128; + __remquoieee128; + __rintieee128; + __roundevenieee128; + __roundieee128; + __scalblnieee128; + __scalbnieee128; + __setpayloadieee128; + __setpayloadsigieee128; + __sincosieee128; + __sinhieee128; + __sinieee128; + __sqrtieee128; + __tanhieee128; + __tanieee128; + __tgammaieee128; + __totalorderieee128; + __totalordermagieee128; + __truncieee128; + __ufromfpieee128; + __ufromfpxieee128; + __y0ieee128; + __y1ieee128; + __ynieee128; + } +} diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h new file mode 100644 index 0000000000..a21dfcaea5 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h @@ -0,0 +1,64 @@ +/* Define aliases for libm _Float128 functions. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _LIBM_ALIAS_FLOAT128_H +#define _LIBM_ALIAS_FLOAT128_H + +#include +#include + +/* This macro should be used on all long double functions that are not part of + the _Float128 API in order to provide *ieee128 symbols without exposing + internal *f128 symbols. */ +#define libm_alias_float128_other_r_ldbl(from, to, r) \ + strong_alias (from ## f128 ## r, __ ## to ## ieee128 ## r) + +/* Define _FloatN / _FloatNx aliases (other than that for _Float128) + for a _Float128 libm function that has internal name FROM ## f128 + ## R and public names TO ## suffix ## R for each suffix of a + supported _FloatN / _FloatNx floating-point type with the same + format as _Float128. */ +#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE +# define libm_alias_float128_other_r(from, to, r) \ + weak_alias (from ## f128 ## r, to ## f64x ## r); \ + libm_alias_float128_other_r_ldbl(from, to, r) +#else +# define libm_alias_float128_other_r(from, to, r) \ + libm_alias_float128_other_r_ldbl(from, to, r) +#endif + +/* Likewise, but without the R suffix. */ +#define libm_alias_float128_other(from, to) \ + libm_alias_float128_other_r (from, to, ) + +/* Define aliases for a _Float128 libm function that has internal name + FROM ## f128 ## R and public names TO ## suffix ## R for each + suffix of a supported floating-point type with the same format as + _Float128. This should only be used for functions where such + public names exist for _FloatN types, not for + implementation-namespace exported names (where there is one name + per format, not per type) or for obsolescent functions not provided + for _FloatN types. */ +#define libm_alias_float128_r(from, to, r) \ + weak_alias (from ## f128 ## r, to ## f128 ## r); \ + libm_alias_float128_other_r (from, to, r) + +/* Likewise, but without the R suffix. */ +#define libm_alias_float128(from, to) libm_alias_float128_r (from, to, ) + +#endif From patchwork Wed Jun 20 02:04:21 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: 931905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93431-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="fBiyBqyq"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419Sqk1DsPz9s4v for ; Wed, 20 Jun 2018 12:06:25 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=YIzwX6hqCflAS8C+3plvy8H0EUyu81j khPa9iwuiIo1pyaw6bsC1Bbyi51s7gpw5sw+Cz50PYkXe79TImNUCrm7R6IBHTnj aIJKm/lEdnpGOpCA3u1mcplFlbiwfltIAcFe+fnseVRAOp1S/K2aTDfq9eSIhJbn SPHjTkmPsgmw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=Q1m0MGA7N1hMU7TqyIKkhz4GN1g=; b=fBiyB qyqjzIGOeMTWKMgBpJiPs2Xc7LHqES7Bwk+B9MM2zKTesB/F/uNbwou3stgAsDuC lm97eVQydaKodXiTCxovUKbL3RO7NFojvrxvIrmr2uE1G0MeEAqg9Y0nblvLQFRY iyY/ARNt1fr9VUiAU3dfirkKbOq+sshxIdtRC0= Received: (qmail 5636 invoked by alias); 20 Jun 2018 02:05:51 -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 5510 invoked by uid 89); 20 Jun 2018 02:05:49 -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, KAM_SHORT, 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 Subject: [PATCH 07/12] ldbl-128ibm-compat: Provide a scalb implementation Date: Tue, 19 Jun 2018 23:04:21 -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-0020-0000-0000-00000E328151 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:05:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0021-0000-0000-000062003208 Message-Id: <20180620020426.20372-8-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Reuse the template in order to provide the global symbols __scalbf128_finite and __scalbieee128. 2018-06-19 Tulio Magno Quites Machado Filho Gabriel F. T. Gomes * sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __scalbf128_finite and __scalbieee128. * sysdeps/ieee754/ldbl-128ibm-compat/e_scalbf128.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/w_scalbf128.c: New file. --- sysdeps/ieee754/ldbl-128ibm-compat/Versions | 2 ++ sysdeps/ieee754/ldbl-128ibm-compat/e_scalbf128.c | 21 ++++++++++++++++++ sysdeps/ieee754/ldbl-128ibm-compat/w_scalbf128.c | 27 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/e_scalbf128.c create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/w_scalbf128.c diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions index 322041132e..6496bd9187 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -90,6 +90,8 @@ libm { __rintieee128; __roundevenieee128; __roundieee128; + __scalbf128_finite; + __scalbieee128; __scalblnieee128; __scalbnieee128; __setpayloadieee128; diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/e_scalbf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/e_scalbf128.c new file mode 100644 index 0000000000..355be95996 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/e_scalbf128.c @@ -0,0 +1,21 @@ +/* Get mantissa of long double. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#include diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/w_scalbf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/w_scalbf128.c new file mode 100644 index 0000000000..4094fbfb19 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/w_scalbf128.c @@ -0,0 +1,27 @@ +/* Get mantissa of long double. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +#undef declare_mgen_alias +#define declare_mgen_alias(a,b) +#define __ieee754_scalbl __ieee754_scalbf128 +#include + +libm_alias_float128_other_r_ldbl (__scalb, scalb,) From patchwork Wed Jun 20 02:04:22 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: 931906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93432-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ZZVsQEj0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419Sqx10hmz9s4n for ; Wed, 20 Jun 2018 12:06:36 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=BE8Li/D2Ux7iTTg0fx7tlB3d9aoEbPt OSaZ/B3047xlFsm2w56xBcLPaIMrFSvCSxcf3UmNm0OHRAlrOHFAPUsfNaHfYSo8 baOfpZLQVelcSWcAD+vxJu4G3ZFqYsdH4NmRglVPF3UeML/h/2frhzVuBmW0gx5X p2k0T3flom7c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=A9EI6+WHItHUUtjE8cOaTisoRUw=; b=ZZVsQ Ej0YbRdm6kcL3yqlrT4iRKN9d+3LQOZ1GgSiq1UrEzNuPzrIYmS/71pjYBnALU5O K36/X6LjZkqHLKgWzhpOPYqh+lRzDUFX5Hg+ibtz1OWzDymRBlqKSUyk6PT8zKDZ lDKncJvEMnx4C3vTdh+bRrhoI+OsCkEU4Ld3pY= Received: (qmail 6450 invoked by alias); 20 Jun 2018 02:06:01 -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 6229 invoked by uid 89); 20 Jun 2018 02:05:58 -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, KAM_SHORT, 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 Subject: [PATCH 08/12] ldbl-128ibm-compat: Provide a significand implementation Date: Tue, 19 Jun 2018 23:04:22 -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-0068-0000-0000-0000030B8D7B 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:05:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0069-0000-0000-000044BE8CBC Message-Id: <20180620020426.20372-9-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Reuse the template in order to provide the global symbol __significandieee128. 2018-06-19 Tulio Magno Quites Machado Filho * sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __significandieee128. * sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c: New file. --- sysdeps/ieee754/ldbl-128ibm-compat/Versions | 1 + .../ieee754/ldbl-128ibm-compat/s_significandf128.c | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions index 6496bd9187..3c430f2074 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -96,6 +96,7 @@ libm { __scalbnieee128; __setpayloadieee128; __setpayloadsigieee128; + __significandieee128; __sincosieee128; __sinhieee128; __sinieee128; diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c new file mode 100644 index 0000000000..4ae0fde6a5 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c @@ -0,0 +1,25 @@ +/* Get mantissa of long double. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +#define __significandf128 __significandieee128 +#undef declare_mgen_alias +#define declare_mgen_alias(...) +#include From patchwork Wed Jun 20 02:04:23 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: 931907 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93433-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="GI4ivhtO"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419Sr726Pyz9s4n for ; Wed, 20 Jun 2018 12:06:47 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=Z2Ilroa+eVL4IPxk5Ta0pEuqEH76hQ7 L9QlaJFIqvc0g6R9CuJkQw+3NUQohEYYlUR5bP9GvCVcWbkTAHtKtwnZ0mkEMVer go8ZK2ediAqVWwdK1RprhFpQ+or7IKo3Z6ZMDLASWa7GsMqLLiyZB8F35jHF6fmH VsoqEFlVu97Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=E6d3ItYCOQau6F/Me4hXIi0B9Rc=; b=GI4iv htOZPmUekYmm6x8Q/pFwsL181HJXo+sIcpi50hbK1fLOb5X8Z+I1khlfVBCNQzeb /aLRGJYv+Zf6oQGE7FJHwLc7Xp94bzaCddyPER0KRusaYe0BJUkECV0TQToRYD+9 p8KbGAnp8ERWkeVcvZsOgqgcec6As/4yzsC5Rs= Received: (qmail 7468 invoked by alias); 20 Jun 2018 02:06:13 -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 7342 invoked by uid 89); 20 Jun 2018 02:06:11 -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, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*br X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com, "Gabriel F. T. Gomes" Subject: [PATCH 09/12] ldbl-128ibm-compat: Provide nexttoward functions Date: Tue, 19 Jun 2018 23:04:23 -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-0016-0000-0000-000008FD0397 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:06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0017-0000-0000-00003F5884C3 Message-Id: <20180620020426.20372-10-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 From: "Gabriel F. T. Gomes" The functions in the nexttoward family are special, in the sense that they always have a long double argument, regardless of their suffix (i.e.: nexttowardf and nexttoward have a long double argument, besides the float and double arguments). On top of that, they are also special because nexttoward functions are not part of the _FloatN API, hence __nexttowardf128 do not exist. This patch adds 4 new function implementations for the new long double format: __nexttoward_to_ieee128 __nexttowardf_to_ieee128 __nexttowardieee128 (as an alias to __nextafterieee128) 2018-06-19 Gabriel F. T. Gomes Tulio Magno Quites Machado Filho * sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __nexttowardf_to_ieee128, __nexttowardieee128 and __nexttoward_to_ieee128. * sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c: New file. --- sysdeps/ieee754/ldbl-128ibm-compat/Versions | 3 ++ .../ieee754/ldbl-128ibm-compat/s_nextafterf128.c | 20 ++++++++++++ .../ieee754/ldbl-128ibm-compat/s_nexttowardf128.c | 38 ++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions index 3c430f2074..01e67aec1a 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -83,6 +83,9 @@ libm { __nearbyintieee128; __nextafterieee128; __nextdownieee128; + __nexttowardf_to_ieee128; + __nexttowardieee128; + __nexttoward_to_ieee128; __nextupieee128; __powieee128; __remainderieee128; diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c new file mode 100644 index 0000000000..419068f8b1 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c @@ -0,0 +1,20 @@ +/* Provide nexttowardl and nextafterl implementations for IEEE long double. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ +#include "../float128/s_nextafterf128.c" + +strong_alias (__nextafterieee128, __nexttowardieee128) diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c new file mode 100644 index 0000000000..4403783a56 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c @@ -0,0 +1,38 @@ +/* Provide nexttoward[|f] implementations for IEEE long double. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +/* Build nexttoward functions with binary128 format. */ +#undef weak_alias +#define weak_alias(from, to) +#undef libm_alias_ldouble +#define libm_alias_ldouble(from, to) +#undef __nexttoward +#define __nexttoward __nexttoward_to_ieee128 +#include + +#undef weak_alias +#define weak_alias(from, to) +#undef libm_alias_ldouble +#define libm_alias_ldouble(from, to) +#undef __nexttowardf +#define __nexttowardf __nexttowardf_to_ieee128 +#include + +#include From patchwork Wed Jun 20 02:04:24 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: 931908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93434-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="GlHOz5m+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419SrK4lqhz9s4n for ; Wed, 20 Jun 2018 12:06:57 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=OwplTOJCqDC3FMAM/WWu9xJg6qzwtFe QcNz/Ze/rt+ePHegfm1uhrWWaOEc85hPT/kls05hsKbkD0n+3HxYiUgXYDx6xKBS pgXS0XdDg2h0jVDvIXjNBnETjX8zMY1Uuaa8Pp7csk16gBb6W0WR/W87msdoPt0o W7HWLd5zHHj4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=grP5f5HKMkwPzVsR7b2MhZ6/OXo=; b=GlHOz 5m+LGgYxs2U5hEl367wMSVwBzlNQdoYnhghbU3P98Iuc2dxmpEpW30aJVY+cwoO3 tNc4DzJ7lfA9Hs3wHWCPlo8+oj3DhK+n+Wy2ldD0OoYuo8pahxtuVtCA4k1aQiGf 9gXUMT2h6HaNisTW8xG9PCz58BgjI4wT1zB2Xg= Received: (qmail 8317 invoked by alias); 20 Jun 2018 02:06:24 -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 8046 invoked by uid 89); 20 Jun 2018 02:06:20 -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, KAM_SHORT, 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 Subject: [PATCH 10/12] ldbl-128ibm-compat: Redirect long double functions to f128/ieee128 functions Date: Tue, 19 Jun 2018 23:04:24 -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-0052-0000-0000-000003012386 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:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0053-0000-0000-00005D12E8FB Message-Id: <20180620020426.20372-11-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Modify the headers to redirect long double functions to global __*f128 symbols or to __*ieee128 otherwise. Most of the functions in math.h benefit from the infrastructure already available for __LDBL_COMPAT. The only exceptions are nexttowardf and nexttoward that need especial treatment. Both math/bits/mathcalls-helper-functions.h and math/bits/mathcalls.h were modified in order to provide alternative redirection destinations that are essential to support functions that should not be redirected to the same name pattern of the rest of the functions, i.e.: __fpclassify, __signbit, __iseqsig, __issignaling, isinf, finite and isnan, which will be redirected to __*f128 instead of __*ieee128 used for the rest. 2018-06-19 Tulio Magno Quites Machado Filho * include/math.h [__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL]: Avoid redirecting __finitel, __isinfl, __isnanl, __fpclassifyl, __issignalingl, __expl, __expml and sqrtl as they conflict with the redirections from math/math.h. * sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h [__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL]: Likewise for function iscanonical(_Float128). * math/math.h [__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL]: Redirect long double functions to __*f128 or _*ieee128. (__MATHDECL_ALIAS): New macro. * math/bits/mathcalls-helper-functions.h: Replace __MATHDECL_1 with __MATHDECL_ALIAS. * math/bits/mathcalls.h: Likewise for isinf, finite and isnan. Signed-off-by: Tulio Magno Quites Machado Filho --- include/math.h | 12 ++++- math/bits/mathcalls-helper-functions.h | 18 +++---- math/bits/mathcalls.h | 9 ++-- math/math.h | 66 ++++++++++++++++++++++++-- sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h | 6 ++- 5 files changed, 94 insertions(+), 17 deletions(-) diff --git a/include/math.h b/include/math.h index e21d34b868..57d77cfd13 100644 --- a/include/math.h +++ b/include/math.h @@ -18,7 +18,9 @@ hidden_proto (__finitef) hidden_proto (__isinff) hidden_proto (__isnanf) -# ifndef __NO_LONG_DOUBLE_MATH +# if !defined __NO_LONG_DOUBLE_MATH \ + && (!__HAVE_DISTINCT_FLOAT128 \ + || (__HAVE_DISTINCT_FLOAT128 && __HAVE_FLOAT128_UNLIKE_LDBL)) hidden_proto (__finitel) hidden_proto (__isinfl) hidden_proto (__isnanl) @@ -40,7 +42,9 @@ libm_hidden_proto (__exp) libm_hidden_proto (__expf) libm_hidden_proto (__roundeven) -# ifndef __NO_LONG_DOUBLE_MATH +# if !defined __NO_LONG_DOUBLE_MATH \ + && (!__HAVE_DISTINCT_FLOAT128 \ + || (__HAVE_DISTINCT_FLOAT128 && __HAVE_FLOAT128_UNLIKE_LDBL)) libm_hidden_proto (__fpclassifyl) libm_hidden_proto (__issignalingl) libm_hidden_proto (__expl) @@ -61,7 +65,11 @@ libm_hidden_proto (__expm1f128) float (sqrtf) (float) asm ("__ieee754_sqrtf"); double (sqrt) (double) asm ("__ieee754_sqrt"); # ifndef __NO_LONG_DOUBLE_MATH +/* Do not redirect sqrtl twice when the long double already redirects it. */ +# if !__HAVE_DISTINCT_FLOAT128 \ + || (__HAVE_DISTINCT_FLOAT128 && __HAVE_FLOAT128_UNLIKE_LDBL) long double (sqrtl) (long double) asm ("__ieee754_sqrtl"); +# endif # endif # if __HAVE_DISTINCT_FLOAT128 > 0 _Float128 (sqrtf128) (_Float128) asm ("__ieee754_sqrtf128"); diff --git a/math/bits/mathcalls-helper-functions.h b/math/bits/mathcalls-helper-functions.h index ac3115bfdc..a6d83bf4e6 100644 --- a/math/bits/mathcalls-helper-functions.h +++ b/math/bits/mathcalls-helper-functions.h @@ -16,28 +16,30 @@ License along with the GNU C Library; if not, see . */ - /* Classify given number. */ -__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __fpclassify,, (_Mdouble_ __value), fpclassify) __attribute__ ((__const__)); /* Test for negative number. */ -__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __signbit,, (_Mdouble_ __value), signbit) __attribute__ ((__const__)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */ -__MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); /* Test equality. */ -__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHDECL_ALIAS (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y), iseqsig); /* Test for signaling NaN. */ -__MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __issignaling,, (_Mdouble_ __value), issignaling) __attribute__ ((__const__)); diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index f4246a7881..9ace71bef6 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -173,12 +173,14 @@ __MATHCALL_FINITE (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); && !__MATH_DECLARING_FLOATN /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); # endif # if !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); @@ -207,7 +209,8 @@ __MATHCALL (nan,, (const char *__tagb)); || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); # endif #endif diff --git a/math/math.h b/math/math.h index c1765e4c8c..8d0880b262 100644 --- a/math/math.h +++ b/math/math.h @@ -283,6 +283,10 @@ enum extern type __MATH_PRECNAME(function,suffix) args __THROW #define __MATHDECL_1(type, function, suffix, args) \ __MATHDECL_1_IMPL(type, function, suffix, args) +/* Ignore the alias by default. The alias is only useful with + redirections. */ +#define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHDECL_1_IMPL(type, function, suffix, args) #define __MATHREDIR(type, function, suffix, args, to) \ extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to) @@ -364,6 +368,39 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATHDECL_1 # define __MATHDECL_1(type, function,suffix, args) \ __MATHREDIR(type, function, suffix, args, __CONCAT(function,suffix)) + +# elif __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL +# ifdef __REDIRECT_NTH +# ifdef __USE_ISOC99 +extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), + __nexttowardf_to_ieee128) + __attribute__ ((__const__)); +extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), + __nexttoward_to_ieee128) + __attribute__ ((__const__)); + +#define __dremieee128 __remainderieee128 +#define __gammaieee128 __lgammaieee128 + +# endif +# endif + +# undef __MATHDECL_1 +# undef __MATHDECL_ALIAS + +# define __REDIRTO(function, suffix) \ + __ ## function ## ieee128 ## suffix +# define __REDIRTO_ALT(function, suffix) \ + __ ## function ## f128 ## suffix + +# undef __MATH_FINITE_NAME +# define __MATH_FINITE_NAME(function, suffix) \ + __MATH_FINITE_NAMEX (, __REDIRTO_ALT (function, suffix), _finite) + +# define __MATHDECL_1(type, function, suffix, args) \ + __MATHREDIR (type, function, suffix, args, __REDIRTO (function, suffix)) +# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHREDIR (type, function, suffix, args, __REDIRTO_ALT (alias, suffix)) # endif /* Include the file of declarations again, this time using `long double' @@ -376,15 +413,25 @@ extern long double __REDIRECT_NTH (nexttowardl, # define __MATH_DECLARE_LDOUBLE 1 # include # include + # undef _Mdouble_ # undef __MATH_PRECNAME # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN -# if defined __LDBL_COMPAT +# if defined __LDBL_COMPAT \ + || (__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL) +# undef __REDIRTO +# undef __REDIRTO_ALT # undef __MATHDECL_1 +# undef __MATHDECL_ALIAS +# undef __MATH_FINITE_NAME +# define __MATH_FINITE_NAME(function, suffix) \ + __MATH_FINITE_NAME_IMPL (function, suffix) # define __MATHDECL_1(type, function, suffix, args) \ __MATHDECL_1_IMPL(type, function, suffix, args) +# define __MATHDECL_ALIAS(type, function, suffix, args, alias) \ + __MATHDECL_1_IMPL(type, function, suffix, args) # endif # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ @@ -720,6 +767,7 @@ extern int signgam; #undef __REDIRTO_PUBLIC_X #undef __MATHDECL_1_IMPL #undef __MATHDECL_1 +#undef __MATHDECL_ALIAS #undef __MATHDECL #undef __MATHCALL #undef __MATHCALL_VEC @@ -759,6 +807,11 @@ extern int signgam; # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) f ## name # undef __MATHCALL_NARROW +# define __MATHCALL_NARROW(func, redir, nargs) \ + __MATHCALL_NARROW_REDIR (func, redir, nargs) +# elif __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL +# define __MATHCALL_REDIR_NAME(name) __ ## f32 ## name ## ieee128 +# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -766,7 +819,8 @@ extern int signgam; # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# ifdef __LDBL_COMPAT +# if defined __LDBL_COMPAT \ + || (__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL) # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ @@ -779,6 +833,11 @@ extern int signgam; # ifdef __LDBL_COMPAT # define __MATHCALL_REDIR_NAME(name) __nldbl_d ## name ## l # undef __MATHCALL_NARROW +# define __MATHCALL_NARROW(func, redir, nargs) \ + __MATHCALL_NARROW_REDIR (func, redir, nargs) +# elif __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL +# define __MATHCALL_REDIR_NAME(name) __ ## f64 ## name ## ieee128 +# undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_REDIR (func, redir, nargs) # endif @@ -786,7 +845,8 @@ extern int signgam; # undef _Mret_ # undef _Marg_ # undef __MATHCALL_NAME -# ifdef __LDBL_COMPAT +# if defined __LDBL_COMPAT \ + || (__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL) # undef __MATHCALL_REDIR_NAME # undef __MATHCALL_NARROW # define __MATHCALL_NARROW(func, redir, nargs) \ diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h index 60c54cca46..f54e5d9ddb 100644 --- a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h +++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h @@ -50,7 +50,11 @@ extern "C++" { inline int iscanonical (float __val) { return __iscanonicalf (__val); } inline int iscanonical (double __val) { return __iscanonical (__val); } inline int iscanonical (long double __val) { return __iscanonicall (__val); } -# if __HAVE_DISTINCT_FLOAT128 +/* When using an IEEE 128-bit long double, _Float128 is defined as long double + in C++. */ +# if __HAVE_DISTINCT_FLOAT128 \ + && (!defined __cplusplus \ + || defined __cplusplus && __HAVE_FLOAT128_UNLIKE_LDBL) inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } # endif } 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: 931909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93435-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="WgJ0nM1B"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419SrW58sHz9s4n for ; Wed, 20 Jun 2018 12:07:07 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=TB24xIH5yjYIffGfOwa9ToB48ISMoin dyKMlFO/Qo2VGAZ2OQUer1DW3ULrq1j2LNUyK1OzDnDCj55I9uMzTSFaB5xgZ6zl ZKn4aC/7Y81bR//4lLkZesMn3UHL4M8tMx2P3rDZWNTdbXfp0DUSz4xv8G0LN8P3 JQyEkH0Z3PS0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=yt4XOzxf9Eu8neUT16yjb1oYKaU=; b=WgJ0n M1BexFyZTYjlXMJZe3+7H0o2GSdTN4eJ0TsiM7GF0hXc3Okp8X5Q38Hr/lNckibc TkjFJKWdQfTE4CiBiAOaUzZgKTg3Am1ToDvnFv8OrUnVgw84y9lEA36rdaR09KW6 mgo+kfETPAeTZIfCwVpG22OhCjQHeuWwn2UAwY= 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 From patchwork Wed Jun 20 02:04:26 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: 931910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93436-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="FNR37JdX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419Srk4R3Vz9s4v for ; Wed, 20 Jun 2018 12:07:18 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=fibQmK1V5ESjqsblRkANATaFntwHKJj ON3n0CHBhXKZ1/91izfWifwe2nuNCn9xRsQvXza3MWzIed9+1UA28ce4iCTnj4CK /41/YHw8UKbavTgUFU1GO+Z9so6kDxWMn+bUMjl9lIY1Dj4IdNREh2M6Yzx5XY++ pUQelxuc2eI8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=KqGjmXGUs44ZUluI0yy1fLMWAnY=; b=FNR37 JdXT+xvEhWQrtx2gyQ32T0MI4XdSgBxEB+Xk1xTW3Kwsu7FGfPblPMvWaj8Mxyj1 gmT4lkwaxvtvbr77y6gbiixGoAT6YBjuPkMbuu5D31sYtgJn7j7gb7E5f+1tYNM6 cRRuvGHnNHDGcanus/ZNO3NXCy9WNkJpYSP6B4= Received: (qmail 10813 invoked by alias); 20 Jun 2018 02:06:48 -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 10707 invoked by uid 89); 20 Jun 2018 02:06:47 -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 Subject: [PATCH 12/12] ldbl-128ibm-compat: Provide ieee128 symbols to narrow functions Date: Tue, 19 Jun 2018 23:04:26 -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-0020-0000-0000-00000E32815C 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.01049504; UDB=6.00537768; IPR=6.00828477; MB=3.00021748; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 02:06:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0021-0000-0000-0000620032BB Message-Id: <20180620020426.20372-13-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_01:, , signatures=0 Add ieee128 aliases for faddl, fdivl, fmull, fsubl, daddl, ddivl, dmull, dsubl. 2018-06-19 Tulio Magno Quites Machado Filho * math/math-narrow.h [__HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL] (libm_alias_float32_float128, libm_alias_float64_float128): Provide *ieee128 aliases. * sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __f32addieee128, __f32divieee128, __f32mulieee128, __f32subieee128, __f64addieee128, __f64divieee128, __f64mulieee128 and __f64subieee128. Signed-off-by: Tulio Magno Quites Machado Filho --- math/math-narrow.h | 10 ++++++++++ sysdeps/ieee754/ldbl-128ibm-compat/Versions | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/math/math-narrow.h b/math/math-narrow.h index c4065e88f7..bfc1c8dced 100644 --- a/math/math-narrow.h +++ b/math/math-narrow.h @@ -356,6 +356,16 @@ libm_alias_float32_float128_main (func) # define libm_alias_float64_float128(func) \ libm_alias_float64_float128_main (func) +#elif __HAVE_DISTINCT_FLOAT128 && !__HAVE_FLOAT128_UNLIKE_LDBL +# define libm_alias_float32_float128(func) \ + libm_alias_float32_float128_main (func) \ + weak_alias (__f32 ## func ## f128, f32 ## func ## f64x) \ + weak_alias (__f32 ## func ## f128, __ ## f32 ## func ## ieee128) +# define libm_alias_float64_float128(func) \ + libm_alias_float64_float128_main (func) \ + weak_alias (__f64 ## func ## f128, f64 ## func ## f64x) \ + weak_alias (__f64 ## func ## f128, f32x ## func ## f64x) \ + weak_alias (__f64 ## func ## f128, __ ## f64 ## func ## ieee128) #else # define libm_alias_float32_float128(func) \ libm_alias_float32_float128_main (func) \ diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions index 01e67aec1a..8fc6fb05f3 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -47,6 +47,14 @@ libm { __exp2ieee128; __expieee128; __expm1ieee128; + __f32addieee128; + __f32divieee128; + __f32mulieee128; + __f32subieee128; + __f64addieee128; + __f64divieee128; + __f64mulieee128; + __f64subieee128; __fabsieee128; __fdimieee128; __floorieee128;