From patchwork Mon Sep 25 11:01:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 818174 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-84911-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="UxxXotSc"; 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 3y11Nk5WTxz9t1G for ; Mon, 25 Sep 2017 21:01:26 +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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= q3LfHGICKBts61p76dAkqbdihz52FzQ2qM5VfFW2DPFos4h8CH2/0vct31wB0I/e 1Gd6M2HRd8CCIFgFK0r8dVJ3dVFb0iZxqHv678t0qtcmBCOBFh4ZC9fOVq/6Ji2F Hj7K9ZHbLTMJv9emy4WlDTFVgfhce2IiJkrjYbooxXY= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=P+CD uuHHIiJo1OQ2tQ/TRKGz2xk=; b=UxxXotScEOA2G6K2XWtKghJyR3Gl4gvSTMCE ENjPmxyuuLRCyulEoWGvo99yTWLoYr8zljSBpDVIeYbZIJRH4MOPX753Zx5MdN7Y 5Q3BRZNxaEUDNVtQywMYcTH4xa2nZR8Wz/x3eP+hDXpVvEA8yIb15lzbOeKZZcHF 1V+qIpE= Received: (qmail 14622 invoked by alias); 25 Sep 2017 11:01:21 -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 14606 invoked by uid 89); 25 Sep 2017 11:01:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <59C8E1F5.7030407@arm.com> Date: Mon, 25 Sep 2017 12:01:09 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH 1/7 v3] Do not wrap expf and exp2f References: <59C8E136.6070606@arm.com> In-Reply-To: <59C8E136.6070606@arm.com> X-ClientProxiedBy: HE1PR05CA0201.eurprd05.prod.outlook.com (2603:10a6:3:f9::25) To AM5PR0802MB2482.eurprd08.prod.outlook.com (2603:10a6:203:98::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46710d60-abd2-44a7-dc70-08d50404bce9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:AM5PR0802MB2482; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2482; 3:5EMVwXR/KuUlo4AMlqXDyy01hykFrrM4w/YPN5IDGQwSEFedFs1Hm6/vrLViNmmgz6rkX4PO06dz1VG9BcrskPftjNC+b9oWT+mcQ1V08aIQ+k7wMZ3rsBI+3MMkRNDbEYpQcOHhYUYBiVoTwWFlyYlLhOWmyQxy9UA2SCjoVVMQIxu3uDxCM70CA+IyeHvst6X8OrgNJYVAtGMcRH/4g3KuzSD6D3aVb67qVhI7RuXXN2b0fDl+hMyfY2y1NgRy; 25:sygwuehHEzooUtrXdwHK0dkmFLp0sD5zIPtC68GJdenndGgNaCRkUV3eanemqFqTL4Rr0I5z9gdEZGCn8JWBTMHWQensP8c+vj91GPW/5TXABsw5B/pdQkUrZJs8eUZ0Ow+RCvQFGsOkwIsimPbgoaKJU3skfQpzT97UpUox8Hm9HSEVdwwKkZrdWMx0+xaWhgEWmbDb44hMNQ4jg0kFWue/e8F1Y0jQO/hO5PXmn0RVxML00eRksIBSS9DzElbUgsiiQ3qgByM3J50ywcOtpVed6PMDDzQQ5Hjw9Zr92mDUD4bNYQse438yTC14lCtdG227nW24evdD+pQmtzltHQ==; 31:W4QFQ/wO6RSyjWw52HKTXXKPxqm1tWs5n1rm2QDoUs2OkDFDBfQCqy+uU78aMaIkHuDlNQlgNGOv9ewEn9xl6yPXjiABrG8QvVSikiyR7ul0lY1ox5Dz7S2v0reC9HEl2fval+GWI+2aOOwGLSbq6/hONITgaRGzGKFciOt0G8iiB2X4JStzKe9VBz6L0kcEBUvEVPtZpa0Me0ROJN+ocAjqW3v7JzYfEJXllqTLkMc= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2482: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2482; 20:Bcgj6BpB1UL7BuCVAhL7FOY5OEIG49ldZxcK+9LObPER0EhBcCHOsQLAS11KCOe+znQVgAIOn/sLQEhtiRy5SFlEp7rJvHqH1KmsHwtm6KLI2q7MF0MpOiybOHZc3V96iHoY5lOsx5VgwjiE/TyFWfh9v3Tl+yM5+hR+OZT/4UQ=; 4:f6iYw3stMtviCUaLIhXbsuUgIWgXDe2iEFUEBINQ8kUy1/qVG0Y8kbWnkgIkn6lFe+fV1B5/qERmTaTOvlYZR+/+b8DTEbMKw7XIS8WrTFoh2Sb3IHW/QjxFrCanCkf0rMm7nkMrTlO3oi4nnyZFwHbIM8bEy/Yab0IWwne17aL8R8av9zt00g+eccVnl2BViCTGgydWV/NEOZKKyZWvaupZ2Hqi/TA5vAlfldbjHADxxkdBH9nLN77f9/rXBA5X X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2482; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2482; X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(346002)(376002)(39860400002)(189002)(199003)(4610100001)(72206003)(76176999)(3846002)(54356999)(97736004)(6116002)(6666003)(25786009)(6486002)(101416001)(65816999)(87266999)(50986999)(2476003)(5000100001)(2950100002)(77096006)(81156014)(6916009)(2906002)(5890100001)(66066001)(59896002)(65956001)(5660300001)(64126003)(316002)(16576012)(16526017)(8936002)(81166006)(83506001)(65806001)(16586007)(8676002)(58126008)(189998001)(68736007)(4326008)(36756003)(7736002)(478600001)(305945005)(568964002)(270700001)(86362001)(105586002)(564344004)(33656002)(84326002)(106356001)(53936002)(80316001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2482; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2482; 23:Xe0msqyIuOlLtd9cjjKhxWn17IaClyRrv8eqYztwNj9QHq5bd9hkGX6WFFe6g1GQsnH5frm/yyvhU+4F234DVyKjf/Qi4OTqBtfDjUoTRzEoh/1ER3TetaiD8ioqX4/XMRyd6yn7wD4f3TxzIzBSByEWxUrUzP4hmmhUz6nCu1rqvKd8Wh6tUrEolQjaLT11jYI3gqTtHGsYwwKFJkVrKEv8yqgryhSZnOSDqrydsrBJKyC52BvufLGvJ6XaFJKSpH+kYutrp7Gys8mbRV0+IwlpZ383V5QFc59Z14stZwdd9850J8ED+7aFIyvOhBeMZ4ySDPqSKGhXhBbZgJ8uHCDNxnT1nu+Zq/zQphs+KVZdt1B98PI2/OWu1FBLJC9pFnuxuRptaTZG787jQEbmjzHAXRo1/4WrSgkbxuLvSqd5NdrQ3WuYW/tsHJZiO4FgvZUlG4XiPDFIhGP0gNih/560tlwl19sABy4BQnFr+nAMV3Id4Crt3NGoOEBeyt1vUmz4MYNaNCfFuPY11tX3nTjokMXuOTPVIG67lcAsaUhlJt5htHuhKpVAm1HfRxWI7RnOcUMP5nzmaB68vIiVH0gBkXRe6SpQNTKwa9gTYv9VfZsgmJ2uSBLNGY71qxVdn+elyOe8nx3zhqnTRj6Ee3yVsKwRrzbTqeYF0NGLtXRW9VgqqDpvamW7YWV/ngmNEmvFfs0PJDCFxzT8K9mAH/yWM7rQpWpSWrP+hGpWlJnAXaMVUVME/Pk0q9i+VSKOGoa/lrxTDy99ZawOTRIdpXsX2aAxU0/gI9O4t1spT8CsHMbmW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F7Lx/LxmwilU2zCZKq0vwHXBFcXyCRkJHtJ6zm0+y3TIJhTP1EfMs3OO1M+m6zJeMOxBfla0A==; 24:qaT6NXnwgc+zv92skRqI3An/8JMv0MrB/K6bFZ30HzzpJSM1L+wK2wPeSBSod/fbeTK2drTy1vhOGH9nQn+1o115W2OHMcPT1XD8+a8q3Hg=; 7:3wAfo9xyPsIjr2SlR5vmjk0Yo2/xz4QeG8sGatI1bhPwXrFCo9VrMuNzH79jkuqcUAje4zjP3GTfow2ms/1H/7lkcwp1O5g46PMgog0WGoYFmEhy5Q9M0FB42EzYYB4RSEN+8WrsIg+yd2tdIxTgbZOU1nuvt235KAf9AMXvdOrLcXKy/XOjb2Fe0hwHCI3knp0JXj4momP2oPOWUxTrkGYPJOhDTvfx4rKiO+dmyMM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 11:01:13.3772 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2482 v3: - incorporate "[nsz/math, PATCH] e_expf.c: Support multiarch" by H.J.Lu. - change sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c accordingly From 9f487b750dbbe2a7d10e3ec5624addc3fdc6810d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 12 Sep 2017 12:44:18 +0100 Subject: [PATCH 1/7] Do not wrap expf and exp2f The new generic expf and exp2f code don't need wrappers any more, they set errno inline, so only use the wrappers on targets that need it. (If the wrapper is needed, then the top level wrapper code is included, otherwise empty w_exp*f.c is used to suppress the wrapper.) A powerpc64 expf implementation includes the expf c code directly which needed some changes. 2017-09-25 Szabolcs Nagy H.J. Lu * sysdeps/ieee754/flt-32/e_exp2f.c (__exp2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_expf.c (__expf): Likewise * sysdeps/ieee754/flt-32/w_exp2f.c: New file. * sysdeps/ieee754/flt-32/w_expf.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c: Update for the new expf code. * sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c: New file. * sysdeps/m68k/m680x0/fpu/w_exp2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_expf.c: New file. * sysdeps/i386/fpu/w_exp2f.c: New file. * sysdeps/i386/fpu/w_expf.c: New file. * sysdeps/i386/i686/fpu/multiarch/w_expf.c: New file. * sysdeps/x86_64/fpu/w_expf.c: New file. --- sysdeps/i386/fpu/w_exp2f.c | 1 + sysdeps/i386/fpu/w_expf.c | 1 + sysdeps/i386/i686/fpu/multiarch/w_expf.c | 1 + sysdeps/ieee754/flt-32/e_exp2f.c | 7 +++++-- sysdeps/ieee754/flt-32/e_expf.c | 16 ++++++++++++++-- sysdeps/ieee754/flt-32/w_exp2f.c | 1 + sysdeps/ieee754/flt-32/w_expf.c | 1 + sysdeps/m68k/m680x0/fpu/w_exp2f.c | 1 + sysdeps/m68k/m680x0/fpu/w_expf.c | 1 + sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c | 5 +---- sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c | 1 + sysdeps/x86_64/fpu/w_expf.c | 1 + 12 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 sysdeps/i386/fpu/w_exp2f.c create mode 100644 sysdeps/i386/fpu/w_expf.c create mode 100644 sysdeps/i386/i686/fpu/multiarch/w_expf.c create mode 100644 sysdeps/ieee754/flt-32/w_exp2f.c create mode 100644 sysdeps/ieee754/flt-32/w_expf.c create mode 100644 sysdeps/m68k/m680x0/fpu/w_exp2f.c create mode 100644 sysdeps/m68k/m680x0/fpu/w_expf.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c create mode 100644 sysdeps/x86_64/fpu/w_expf.c diff --git a/sysdeps/i386/fpu/w_exp2f.c b/sysdeps/i386/fpu/w_exp2f.c new file mode 100644 index 0000000000..583065d12a --- /dev/null +++ b/sysdeps/i386/fpu/w_exp2f.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/i386/fpu/w_expf.c b/sysdeps/i386/fpu/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/i386/fpu/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/i386/i686/fpu/multiarch/w_expf.c b/sysdeps/i386/i686/fpu/multiarch/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/i386/i686/fpu/multiarch/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c index 72b7d8829f..b53a919a0d 100644 --- a/sysdeps/ieee754/flt-32/e_exp2f.c +++ b/sysdeps/ieee754/flt-32/e_exp2f.c @@ -18,6 +18,7 @@ #include #include +#include #include "math_config.h" /* @@ -42,7 +43,7 @@ top12 (float x) } float -__ieee754_exp2f (float x) +__exp2f (float x) { uint32_t abstop; uint64_t ki, t; @@ -85,4 +86,6 @@ __ieee754_exp2f (float x) y = y * s; return (float) y; } -strong_alias (__ieee754_exp2f, __exp2f_finite) +strong_alias (__exp2f, __ieee754_exp2f) +strong_alias (__exp2f, __exp2f_finite) +versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27); diff --git a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c index 12239e1862..74a383a02c 100644 --- a/sysdeps/ieee754/flt-32/e_expf.c +++ b/sysdeps/ieee754/flt-32/e_expf.c @@ -16,8 +16,14 @@ License along with the GNU C Library; if not, see . */ +#ifdef __expf +# undef libm_hidden_proto +# define libm_hidden_proto(ignored) +#endif + #include #include +#include #include "math_config.h" /* @@ -42,7 +48,7 @@ top12 (float x) } float -__ieee754_expf (float x) +__expf (float x) { uint32_t abstop; uint64_t ki, t; @@ -99,4 +105,10 @@ __ieee754_expf (float x) y = y * s; return (float) y; } -strong_alias (__ieee754_expf, __expf_finite) + +#ifndef __expf +hidden_def (__expf) +strong_alias (__expf, __ieee754_expf) +strong_alias (__expf, __expf_finite) +versioned_symbol (libm, __expf, expf, GLIBC_2_27); +#endif diff --git a/sysdeps/ieee754/flt-32/w_exp2f.c b/sysdeps/ieee754/flt-32/w_exp2f.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_exp2f.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_expf.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/m68k/m680x0/fpu/w_exp2f.c b/sysdeps/m68k/m680x0/fpu/w_exp2f.c new file mode 100644 index 0000000000..583065d12a --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/w_exp2f.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/m68k/m680x0/fpu/w_expf.c b/sysdeps/m68k/m680x0/fpu/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c index b236290ea2..2cd9a5ec8b 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c @@ -16,9 +16,6 @@ License along with the GNU C Library; if not, see . */ -#undef strong_alias -#define strong_alias(a, b) - -#define __ieee754_expf __ieee754_expf_ppc64 +#define __expf __ieee754_expf_ppc64 #include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/x86_64/fpu/w_expf.c b/sysdeps/x86_64/fpu/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/x86_64/fpu/w_expf.c @@ -0,0 +1 @@ +#include -- 2.11.0 From patchwork Mon Sep 25 11:02:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 818175 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-84912-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="bJKflJEf"; 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 3y11Q66kGRz9t1G for ; Mon, 25 Sep 2017 21:02:38 +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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= bm6tgyJI6QdthO16RaCvAiA78qut2neQwwU34a3TF7ZcpYHOyQZggajmPww1nvQu xP7+EAorZbJGlJQKGHMJ8Qt6RzRZLY5hbpmRexHj+8xj1TuoGltrJ00bkrwE6vdN 6F5XDvRrJPBZyfYHbd7tJPC8M7bCxDjtVbPaE/c+6nY= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=dh00 CXu1CQhv8a5Ig0JZ6F1f67M=; b=bJKflJEfkdFQTDwrtZ34UYHe8rHKufY9x9cb ECCsWb7TmhH+tfp0+hNs4642Z5OfI9fpATOyAj9HJfeZG9pvZUepxR6481DrELCQ Yp137JVmp3ICmAa2pXM0+aPnQaUy4nmjXEppZGdFDZ8sMzs57O3BQGrql1QWyIUk nm6wF40= Received: (qmail 16481 invoked by alias); 25 Sep 2017 11:02:33 -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 16470 invoked by uid 89); 25 Sep 2017 11:02:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=xx, xix, fR, c1 X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <59C8E23D.9030206@arm.com> Date: Mon, 25 Sep 2017 12:02:21 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH 2/7 v2] New generic logf References: <59C8E136.6070606@arm.com> In-Reply-To: <59C8E136.6070606@arm.com> X-ClientProxiedBy: HE1PR05CA0187.eurprd05.prod.outlook.com (2603:10a6:3:f9::11) To DB6PR0802MB2487.eurprd08.prod.outlook.com (2603:10a6:4:a0::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e7902fd-73ae-407c-e5e9-08d50404e841 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0802MB2487; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2487; 3:YAZr7UiJ7s3zcIuwUk1+8tzgoLDhEZ/iVlA/2brT3Lba+4PGICRZxFheFwBtmdAdZFopeCDv6t0kqKH97kTpppWozSSPXYJBpQSbl3v25SJl0w7SO2ZxnoQI9tGMbjqnicnfgxlqeH2GmBjPNTndEM75r+iSiQ/5TwsV+kMh5JoGMj2Q3ZtC/w3W91bd8EUqYW2GObCYpbqTIR5/QuNy6/qIzMgOC2iJz2SDFtw7I7sGEwx0YJYxdDDATKioBSIe; 25:bhBWafl6PIt6VuDFMLfDOp99gIHUq5RWbzHVJCInjwqc5P1ND0oWFI2T22phhqRcNKN6SyMBiGPZ13R63tXuCizgmJSPrgg/fz5CqJMh2QXI9pCUhrk4jHRBpXO/FXNCVHDyiH+28TCdHP366BY1o/EcBYhEzRPW6rRlfEYAymmPgq3MWN80Qa4/9aYiCs5yapoCovAqZLIKKB3MHA6ILXZkBESK51Vn3+eUJQ/RsJJR0xCyo9X63XkFWIQsuFwdltJBlBx/d0Lx3lrN2Vd1r4kWb0if3kYawXqkIbh09FO+QxsLFag9lRKszhCdw3vtVcc/FZdKuVN5fyqsxTtLLw==; 31:kGybj6I9d8Xe4eyb/TvVnmbs5IxgJfQbhhpopE4uu6Jt3snLCytpO0iCyPstEY76sdcGTH9fJp5C7hKkCNNokRwtyeUxsUJoQdGZXYiNaLQM+9kbf1LAdIkL1jC7b2b3dcAtR2i4nb0Z6Y3hgYAOtJRdY6WdXDtPCYqWDwao+jaJa2bu6h6NyZ50phKXatMtzLyq3WlnH12LteGLL3OIfqwhP4VAqXpVLsbp6pvbeck= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2487: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2487; 20:BFiCz0y1Szkeakhse4tE6MaYRm8euCVl5aEUiFWWcIS8w1zQTEWv4/HS99NAyUgQV3HHzb9BszLAUECGS6lWZ+7pL6+rh+gGOb/VKWWjeBzmNnjytfGVI6ZJIi7XLD7S6QHVHI7D30+RGG9Y8QIeVUYm1KjP8QRMyw73ZeUfMQw=; 4:AOaM5mKVXahX/EDcQHoNz6nlNqMNxEO0nTPyEmK/sLAR09ZoNQNrZpdnpC76s92N9WID0Z7LCjiyYLwzYJ+Iw5X4Uri7596w2ICMjrBHzKWQCPEdDWd3+Rymf58XnFXayHGu0s/cTfm8xWzwc4C0fG8/0Xap6VvoBA7zj0HFyBWcHSrCWmSYXWOQH5mG3HgcfktbdiYnEOGPXw45/AomdKB5JGy8QtYM0rFuWbi2dxA0q38hPBLrpJkhKF+KDGlk X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0802MB2487; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0802MB2487; X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(39860400002)(346002)(376002)(189002)(199003)(72206003)(58126008)(8676002)(6666003)(81166006)(53936002)(4326008)(105586002)(33656002)(8936002)(77096006)(59896002)(86362001)(478600001)(2476003)(6116002)(81156014)(6486002)(568964002)(5890100001)(270700001)(68736007)(65816999)(2906002)(3846002)(97736004)(80316001)(316002)(65956001)(66066001)(101416001)(106356001)(305945005)(36756003)(83506001)(16586007)(16576012)(189998001)(564344004)(2950100002)(25786009)(64126003)(87266999)(50986999)(84326002)(76176999)(5660300001)(54356999)(7736002)(6916009)(5000100001)(4610100001)(65806001)(16526017)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2487; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2487; 23:yPZxtSyDUN68Q76m1qCVCEdZy2OoE4vlNL6tClpWmHnRv1kJhyq+AVhfAaV1azIb1HazrdkY/PLEMlemm3FK1Gc1tX6f/ETB2PKLP0Lb/EGZHnhPtCbX9im7Q1agX9UCZzjITkokSRYZFoxXUh0yOO/j7k2yghjjMX7eQuqen4/8EzNhtQW2HyJoc+zivC1IJWyU+VCXJkls0bkSLXL53OWBjfwu3MZ+2kxZedqBAbmCF+hnMA3HCFTD0mKg+X9zjx+c1y68oi9h/j6dE0eTNj6mkErZZlcrnoSaPlt+gNaDnwTo/e/Gwl9nazGseecgPn9qdQyesqvUZ6O776dAyOWGOxk7dZrlKskaRarewu8KT7bA7u6hJXG8Peyr087KA5H6icYRku5tIFmIfy89RqavFXn13cyk8X6CL6DwIW1UFVxHId+KMyVGq8M1J9hwe3sZZ2o1N9ZC99RCyAJRmkjjFmbWypV5SuWuYmxbCJ4JsmhpuMFn4Q1Rv0Ok6Wp3Lf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7iYidIR1+j5cecoMfoGN5lOiKbVeWGjE/3IsAnvonXWrupDNlN3sjEyM2hKUfvGj/pfEBwAPIE71IoMfJQ4j45xsuVpjn01CCZh4lR3SeOamATaHQUt3X5b8L8MnLYNxeSOw5EHhqo9MQ/cwY9u50VIkrbXgf5LSDjXjfDpJprM+lQenjbFlPIPfm3dlHIZhqotgbqo7hbuaSZmrxt6EPOU6n1bDGdY6JrrbkQT9tAieDvsLeVA==; 5:kdVEbv9SXEUfonmMlGnBwYnRenFNF6QXKWPURs4Bw7yAHgtbKmqnX2dqIxb8FA/w27uZBHlM/qdVv/Vn14wQuiTYyX/Dt+PUUbBaQY5SrFR4s8/ie8HudoZzrR9/vr2Phre2A11dkPM+Eazy7sunYg==; 24:aEghtba7tKtOzmyH+k4OKKHXmPKsUMZOTk8oJWoP+6+YF1PLMau0iC8MKN+3xbIanixfUmc5eesBtHtwwHhUdVMmsBg9MhnjKSaZa6rzgHQ=; 7:sVAUh4EfykNCdDOTttgopeqxKhOOkdG6ZU6w3b6efpzdv3xfjIILC90/MngtFgq/xT1QT2lLm2RbDZfOcxhdsiGrmHCu9UzMgi0Y8JcqTitRNTWhUiP1a6Sn7SylE5mfMyxuQJQLUOE3e1gXwauZ4/F1YXnld7s6ybSXbpuTrCdzJDbwnVjAoss/QGXZQsBrQDCZE5BmlIQmKvU/x7zJJAdFtwGzsb+SXbP/s1tTZIQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 11:02:25.8149 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2487 v2: - __logf_data is attribute_hidden From 953dde0ba3351d49a185e57cc1800a3ad7cc35b1 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 4 Sep 2017 17:48:46 +0100 Subject: [PATCH 2/7] New generic logf without wrapper on aarch64: logf reciprocal-throughput: 2.2x faster logf latency: 1.9x faster old worst case error: 0.89 ulp new worst case error: 0.82 ulp aarch64 .text size: -356 bytes aarch64 .rodata size: +248 bytes Uses double precision arithmetics and a lookup table to allow smaller polynomial and avoid the use of division. Data is in a separate translation unit with fixed layout to prevent the compiler generating suboptimal literal access. Errors are handled inline according to POSIX rules, but this patch keeps the wrapper with SVID compatible error handling. Needs libm-test-ulps adjustment for clogf in non-nearest rounding mode. 2017-09-19 Szabolcs Nagy * math/Makefile (type-float-routines): Add e_logf_data. * sysdeps/ieee754/flt-32/e_logf.c: New implementation. * sysdeps/ieee754/flt-32/e_logf_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h (__logf_data): Define. (LOGF_TABLE_BITS, LOGF_POLY_ORDER): Define. * sysdeps/i386/fpu/e_logf_data.c: New file. * sysdeps/ia64/fpu/e_logf_data.c: New file. * sysdeps/m68k/m680x0/fpu/e_logf_data.c: New file. --- math/Makefile | 2 +- sysdeps/i386/fpu/e_logf_data.c | 1 + sysdeps/ia64/fpu/e_logf_data.c | 1 + sysdeps/ieee754/flt-32/e_logf.c | 148 +++++++++++++++++----------------- sysdeps/ieee754/flt-32/e_logf_data.c | 44 ++++++++++ sysdeps/ieee754/flt-32/math_config.h | 12 +++ sysdeps/m68k/m680x0/fpu/e_logf_data.c | 1 + 7 files changed, 135 insertions(+), 74 deletions(-) create mode 100644 sysdeps/i386/fpu/e_logf_data.c create mode 100644 sysdeps/ia64/fpu/e_logf_data.c create mode 100644 sysdeps/ieee754/flt-32/e_logf_data.c create mode 100644 sysdeps/m68k/m680x0/fpu/e_logf_data.c diff --git a/math/Makefile b/math/Makefile index 04586156f8..919fec13ef 100644 --- a/math/Makefile +++ b/math/Makefile @@ -115,7 +115,7 @@ type-double-routines := branred doasin dosincos halfulp mpa mpatan2 \ # float support type-float-suffix := f -type-float-routines := k_rem_pio2f math_errf e_exp2f_data +type-float-routines := k_rem_pio2f math_errf e_exp2f_data e_logf_data # _Float128 support type-float128-suffix := f128 diff --git a/sysdeps/i386/fpu/e_logf_data.c b/sysdeps/i386/fpu/e_logf_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/i386/fpu/e_logf_data.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ia64/fpu/e_logf_data.c b/sysdeps/ia64/fpu/e_logf_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ia64/fpu/e_logf_data.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/flt-32/e_logf.c b/sysdeps/ieee754/flt-32/e_logf.c index cf75e11781..b8d262441f 100644 --- a/sysdeps/ieee754/flt-32/e_logf.c +++ b/sysdeps/ieee754/flt-32/e_logf.c @@ -1,85 +1,87 @@ -/* e_logf.c -- float version of e_log.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ +/* Single-precision log function. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. -/* - * ==================================================== - * 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. - * ==================================================== - */ + 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 "math_config.h" -static const float -ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ -ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ -two25 = 3.355443200e+07, /* 0x4c000000 */ -Lg1 = 6.6666668653e-01, /* 3F2AAAAB */ -Lg2 = 4.0000000596e-01, /* 3ECCCCCD */ -Lg3 = 2.8571429849e-01, /* 3E924925 */ -Lg4 = 2.2222198546e-01, /* 3E638E29 */ -Lg5 = 1.8183572590e-01, /* 3E3A3325 */ -Lg6 = 1.5313838422e-01, /* 3E1CD04F */ -Lg7 = 1.4798198640e-01; /* 3E178897 */ +/* +LOGF_TABLE_BITS = 4 +LOGF_POLY_ORDER = 4 -static const float zero = 0.0; +ULP error: 0.818 (nearest rounding.) +Relative error: 1.957 * 2^-26 (before rounding.) +*/ + +#define T __logf_data.tab +#define A __logf_data.poly +#define Ln2 __logf_data.ln2 +#define N (1 << LOGF_TABLE_BITS) +#define OFF 0x3f330000 float -__ieee754_logf(float x) +__ieee754_logf (float x) { - float hfsq,f,s,z,R,w,t1,t2,dk; - int32_t k,ix,i,j; + /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ + double_t z, r, r2, y, y0, invc, logc; + uint32_t ix, iz, tmp; + int k, i; + + ix = asuint (x); +#if WANT_ROUNDING + /* Fix sign of zero with downward rounding when x==1. */ + if (__glibc_unlikely (ix == 0x3f800000)) + return 0; +#endif + if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000)) + { + /* x < 0x1p-126 or inf or nan. */ + if (ix * 2 == 0) + return __math_divzerof (1); + if (ix == 0x7f800000) /* log(inf) == inf. */ + return x; + if ((ix & 0x80000000) || ix * 2 >= 0xff000000) + return __math_invalidf (x); + /* x is subnormal, normalize it. */ + ix = asuint (x * 0x1p23f); + ix -= 23 << 23; + } + + /* x = 2^k z; where z is in range [OFF,2*OFF] and exact. + The range is split into N subintervals. + The ith subinterval contains z and c is near its center. */ + tmp = ix - OFF; + i = (tmp >> (23 - LOGF_TABLE_BITS)) % N; + k = (int32_t) tmp >> 23; /* arithmetic shift */ + iz = ix - (tmp & 0x1ff << 23); + invc = T[i].invc; + logc = T[i].logc; + z = (double_t) asfloat (iz); - GET_FLOAT_WORD(ix,x); + /* log(x) = log1p(z/c-1) + log(c) + k*Ln2 */ + r = z * invc - 1; + y0 = logc + (double_t) k * Ln2; - k=0; - if (ix < 0x00800000) { /* x < 2**-126 */ - if (__builtin_expect((ix&0x7fffffff)==0, 0)) - return -two25/zero; /* log(+-0)=-inf */ - if (__builtin_expect(ix<0, 0)) - return (x-x)/(x-x); /* log(-#) = NaN */ - k -= 25; x *= two25; /* subnormal number, scale up x */ - GET_FLOAT_WORD(ix,x); - } - if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x; - k += (ix>>23)-127; - ix &= 0x007fffff; - i = (ix+(0x95f64<<3))&0x800000; - SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */ - k += (i>>23); - f = x-(float)1.0; - if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */ - if(f==zero) { - if(k==0) return zero; else {dk=(float)k; - return dk*ln2_hi+dk*ln2_lo;} - } - R = f*f*((float)0.5-(float)0.33333333333333333*f); - if(k==0) return f-R; else {dk=(float)k; - return dk*ln2_hi-((R-dk*ln2_lo)-f);} - } - s = f/((float)2.0+f); - dk = (float)k; - z = s*s; - i = ix-(0x6147a<<3); - w = z*z; - j = (0x6b851<<3)-ix; - t1= w*(Lg2+w*(Lg4+w*Lg6)); - t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); - i |= j; - R = t2+t1; - if(i>0) { - hfsq=(float)0.5*f*f; - if(k==0) return f-(hfsq-s*(hfsq+R)); else - return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f); - } else { - if(k==0) return f-s*(f-R); else - return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); - } + /* Pipelined polynomial evaluation to approximate log1p(r). */ + r2 = r * r; + y = A[1] * r + A[2]; + y = A[0] * r2 + y; + y = y * r2 + (y0 + r); + return (float) y; } strong_alias (__ieee754_logf, __logf_finite) diff --git a/sysdeps/ieee754/flt-32/e_logf_data.c b/sysdeps/ieee754/flt-32/e_logf_data.c new file mode 100644 index 0000000000..ce2a0f8a5c --- /dev/null +++ b/sysdeps/ieee754/flt-32/e_logf_data.c @@ -0,0 +1,44 @@ +/* Data definition for logf. + Copyright (C) 2017 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 "math_config.h" + +const struct logf_data __logf_data = { + .tab = { + { 0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2 }, + { 0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2 }, + { 0x1.49539f0f010bp+0, -0x1.01eae7f513a67p-2 }, + { 0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3 }, + { 0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3 }, + { 0x1.25e227b0b8eap+0, -0x1.1aa2bc79c81p-3 }, + { 0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4 }, + { 0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4 }, + { 0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5 }, + { 0x1p+0, 0x0p+0 }, + { 0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5 }, + { 0x1.ca4b31f026aap-1, 0x1.c5e53aa362eb4p-4 }, + { 0x1.b2036576afce6p-1, 0x1.526e57720db08p-3 }, + { 0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3 }, + { 0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2 }, + { 0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2 }, + }, + .ln2 = 0x1.62e42fefa39efp-1, + .poly = { + -0x1.00ea348b88334p-2, 0x1.5575b0be00b6ap-2, -0x1.ffffef20a4123p-2, + } +}; diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h index 31f0470612..9dde0f98eb 100644 --- a/sysdeps/ieee754/flt-32/math_config.h +++ b/sysdeps/ieee754/flt-32/math_config.h @@ -111,4 +111,16 @@ extern const struct exp2f_data double poly_scaled[EXP2F_POLY_ORDER]; } __exp2f_data attribute_hidden; +#define LOGF_TABLE_BITS 4 +#define LOGF_POLY_ORDER 4 +extern const struct logf_data +{ + struct + { + double invc, logc; + } tab[1 << LOGF_TABLE_BITS]; + double ln2; + double poly[LOGF_POLY_ORDER]; +} __logf_data attribute_hidden; + #endif diff --git a/sysdeps/m68k/m680x0/fpu/e_logf_data.c b/sysdeps/m68k/m680x0/fpu/e_logf_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/e_logf_data.c @@ -0,0 +1 @@ +/* Not needed. */ -- 2.11.0 From patchwork Mon Sep 25 11:03:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 818176 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-84913-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="apXjzzJM"; 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 3y11Rp5YtRz9t1G for ; Mon, 25 Sep 2017 21:04:06 +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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= lsvmHLd87OsKY1RK15U8XKWX2x9leDe/9D5Ht2gxjFYQosL/HcuyK1Dd/K/IWRnv 5LDoHQQ3UFrBmsOJWAFsY4nnoJhQN1K5CgTalcpwZGB/+47R7r3/NMibCbHGEWAh eDxsuTBQbfE5EbVJ98sKeZRqH20bOHwA77pCJHxPJrg= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=21Cq q3Hu1fScBDP39ipvRAJ1rE0=; b=apXjzzJMpFDcWuOzJNHY7kAgS2m0GqR9u1DY UmpnA3GGsfJEGqbIS3yq36ZW6gnbtceZnpWJZztYahs/pDiYRl5UVZ5bppqjJRYe E1hHBRuycsFJl/XAnX6/A02q0CWSYUikgookm2IQdMUaphCLQk/6f6jzYFJI/aUm w8yRfGM= Received: (qmail 18313 invoked by alias); 25 Sep 2017 11:03:59 -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 18284 invoked by uid 89); 25 Sep 2017 11:03:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <59C8E292.6030505@arm.com> Date: Mon, 25 Sep 2017 12:03:46 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH 3/7 v2] New generic log2f References: <59C8E136.6070606@arm.com> In-Reply-To: <59C8E136.6070606@arm.com> X-ClientProxiedBy: VI1PR0401CA0017.eurprd04.prod.outlook.com (2603:10a6:800:4a::27) To AM5PR0802MB2481.eurprd08.prod.outlook.com (2603:10a6:203:97::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: edfe472d-48e2-43fe-e793-08d504051a44 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:AM5PR0802MB2481; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2481; 3:79xpHh9BS/7xGvqbp8F5/RoKKxiVWKeXR3lXDvlMvVxe5wJMlCnZ94ZT7tNm6KuENrKfW0KDQqNMgGql/gl3E1nd89gWRrLPVMaGNvLXKbZJIURgLSQkEcFD9z+1gXAAqIWKAX6PWCisYjzUAb9gvL9QSAeg+J68GD9mjNLHNX8X6C7IaU6dDhdYtmeW65BBGcRl/CWozUn29ZMInuEZD9/60i8f/5hwizexp/C7abyrLVq7E8rrQ49y8EuRupoV; 25:9gD9LOdOcBL95pTLC3LQitZDnlrtZ9XgJtKjk2YtPjB+1PXRXyAyl49HMJdlOj8p6aZM237zLTsENT8opNh3e4LcXdIHd/DPTAOue/ERcUQ9+ynilsLEQDZh2pwTYl2bXgM0ZMtRW9fRDxF5oDM7xd6vGfHrwxQmpKMd7pgKXB6f7dy/Qp/WDztbTkaXy6q9yMecotJKkj8oTA18KjGRFcof1lNJ7fMtrM+E1xYSym71XboDnUQwIawE0gRB+v8mHVlJ+SEiNzyAxDzz5puY1jNV1adC9CNNP2RZHLuwLtS7tD16fqYxyJf3dkoCx6IS0+9BZY8Lx2WvB3n2cIGpjw==; 31:1xOsYvRrN1X/TKH2zwodFhvyYexmZNVWWJ0aFkFgOzmcPXow2KLN6BWyEBGVnjZ+rki+M31g5kO9eDG3qXVWF/OmbL0u+oh3FOP18So6SmO+1EELudHc9RIkBaMe8wjIVa3+JCwyBymIWSrG6bzhz2Q6SOQebG8oCnXbzrZsP1yJzA5RVG3USWTQH/C+DVWZ2kuW/38rhQpGKzTCNVEqj1V35A73Hrqx06KzKHJ/t2E= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2481: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2481; 20:KH8mo2zrCdK7YuFb+cke9xUqp2OXIt3qYDWMaAZbiF0nTqvoLGFxcYy6U/Ss2uNarb8BP+y6Vqt5xVIqTTbQycpPBzt4eUKSlgqD0qdgzEAjVZ+5MCnTbV9QFF8oB0V978h9Xy5aIK4sbTac044q/F6BUq8PWuKxfUU2QITf22M=; 4:BG4O9yhRhBhgjI2X5lR9xTDa356BLv25ekbS2bi6vHi5GD/VBxt26qpfZbf0+9LxEmHCW+1irLqxIfMW0TYqeAn6CjHMrDbcJ53x6a3NHa3TBWRTpSEoEasByZ7lFMFUt64sQXFW5O1eyqboqbQMF4djt/Frh706zUAZZef3Fu5JeovuYcrRaid/RlEZchVotenZPTAJdLtbECbchW3Uf2DCt9xK2HfDGAbGzqsBmO02D2I8n3EFVqE6lmVScQ4E X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2481; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2481; X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(39830400002)(376002)(346002)(199003)(189002)(4610100001)(8676002)(101416001)(7736002)(97736004)(72206003)(36756003)(25786009)(83506001)(66066001)(64126003)(80316001)(65806001)(4326008)(65956001)(84326002)(16526017)(316002)(76176999)(54356999)(58126008)(8936002)(2906002)(5000100001)(53936002)(50986999)(478600001)(16576012)(189998001)(33656002)(2476003)(3846002)(6916009)(6116002)(6666003)(59896002)(2950100002)(105586002)(68736007)(16586007)(65816999)(568964002)(305945005)(87266999)(86362001)(5890100001)(5660300001)(270700001)(106356001)(77096006)(6486002)(564344004)(81156014)(81166006)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2481; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2481; 23:eLRF9LxQ54vyXjcj2fma8FmoZQnA4PRW4Gv7wWR8Z0mIVM9A3FDbQyNAikMZJMFVEUunCgz4aE8Hfrcm1gYG2rAad5C3HKwYQcCvoWbQH8DmW6Z8fj72wodZitPAhs0+D7nTv8b+4AonoCUgrTACHVJwbX8OIf5IRdWVwvVYtw+eLVQ5RZ9DCOfMEfvjTuMSlSo0RGP1I015ZYMPEMFB7lIcnTKrPqSKBQtNs/cXoZp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m.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 11:03:49.8926 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2481 v2: - __log2f_data is attribute_hidden From e931f4585585e39ccb5f1f3a29debe670eb53629 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 4 Sep 2017 17:53:47 +0100 Subject: [PATCH 3/7] New generic log2f Similar to the new logf: double precision arithmetics and a small lookup table is used. The argument reduction step is the same as in the new logf. without wrapper on aarch64: log2f reciprocal-throughput: 2.3x faster log2f latency: 2.1x faster old worst case error: 1.72 ulp new worst case error: 0.75 ulp aarch64 .text size: -252 bytes aarch64 .rodata size: +244 bytes 2017-09-19 Szabolcs Nagy * math/Makefile (type-float-routines): Add e_log2f_data. * sysdeps/ieee754/flt-32/e_log2f.c: New implementation. * sysdeps/ieee754/flt-32/e_log2f_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h (__log2f_data): Define. (LOG2F_TABLE_BITS, LOG2F_POLY_ORDER): Define. * sysdeps/i386/fpu/e_log2f_data.c: New file. * sysdeps/ia64/fpu/e_log2f_data.c: New file. * sysdeps/m68k/m680x0/fpu/e_log2f_data.c: New file. --- math/Makefile | 3 +- sysdeps/i386/fpu/e_log2f_data.c | 1 + sysdeps/ia64/fpu/e_log2f_data.c | 1 + sysdeps/ieee754/flt-32/e_log2f.c | 148 +++++++++++++++++---------------- sysdeps/ieee754/flt-32/e_log2f_data.c | 44 ++++++++++ sysdeps/ieee754/flt-32/math_config.h | 11 +++ sysdeps/m68k/m680x0/fpu/e_log2f_data.c | 1 + 7 files changed, 135 insertions(+), 74 deletions(-) create mode 100644 sysdeps/i386/fpu/e_log2f_data.c create mode 100644 sysdeps/ia64/fpu/e_log2f_data.c create mode 100644 sysdeps/ieee754/flt-32/e_log2f_data.c create mode 100644 sysdeps/m68k/m680x0/fpu/e_log2f_data.c diff --git a/math/Makefile b/math/Makefile index 919fec13ef..b4b3101592 100644 --- a/math/Makefile +++ b/math/Makefile @@ -115,7 +115,8 @@ type-double-routines := branred doasin dosincos halfulp mpa mpatan2 \ # float support type-float-suffix := f -type-float-routines := k_rem_pio2f math_errf e_exp2f_data e_logf_data +type-float-routines := k_rem_pio2f math_errf e_exp2f_data e_logf_data \ + e_log2f_data # _Float128 support type-float128-suffix := f128 diff --git a/sysdeps/i386/fpu/e_log2f_data.c b/sysdeps/i386/fpu/e_log2f_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/i386/fpu/e_log2f_data.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ia64/fpu/e_log2f_data.c b/sysdeps/ia64/fpu/e_log2f_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ia64/fpu/e_log2f_data.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/flt-32/e_log2f.c b/sysdeps/ieee754/flt-32/e_log2f.c index 782d901094..6c42f27843 100644 --- a/sysdeps/ieee754/flt-32/e_log2f.c +++ b/sysdeps/ieee754/flt-32/e_log2f.c @@ -1,86 +1,88 @@ -/* e_logf.c -- float version of e_log.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - * adapted for log2 by Ulrich Drepper - */ +/* Single-precision log2 function. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. -/* - * ==================================================== - * 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. - * ==================================================== - */ + 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 +#include "math_config.h" + +/* +LOG2F_TABLE_BITS = 4 +LOG2F_POLY_ORDER = 4 -static const float -ln2 = 0.69314718055994530942, -two25 = 3.355443200e+07, /* 0x4c000000 */ -Lg1 = 6.6666668653e-01, /* 3F2AAAAB */ -Lg2 = 4.0000000596e-01, /* 3ECCCCCD */ -Lg3 = 2.8571429849e-01, /* 3E924925 */ -Lg4 = 2.2222198546e-01, /* 3E638E29 */ -Lg5 = 1.8183572590e-01, /* 3E3A3325 */ -Lg6 = 1.5313838422e-01, /* 3E1CD04F */ -Lg7 = 1.4798198640e-01; /* 3E178897 */ +ULP error: 0.752 (nearest rounding.) +Relative error: 1.9 * 2^-26 (before rounding.) +*/ -static const float zero = 0.0; +#define N (1 << LOG2F_TABLE_BITS) +#define T __log2f_data.tab +#define A __log2f_data.poly +#define OFF 0x3f330000 float -__ieee754_log2f(float x) +__ieee754_log2f (float x) { - float hfsq,f,s,z,R,w,t1,t2,dk; - int32_t k,ix,i,j; + /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ + double_t z, r, r2, p, y, y0, invc, logc; + uint32_t ix, iz, top, tmp; + int k, i; + + ix = asuint (x); +#if WANT_ROUNDING + /* Fix sign of zero with downward rounding when x==1. */ + if (__glibc_unlikely (ix == 0x3f800000)) + return 0; +#endif + if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000)) + { + /* x < 0x1p-126 or inf or nan. */ + if (ix * 2 == 0) + return __math_divzerof (1); + if (ix == 0x7f800000) /* log2(inf) == inf. */ + return x; + if ((ix & 0x80000000) || ix * 2 >= 0xff000000) + return __math_invalidf (x); + /* x is subnormal, normalize it. */ + ix = asuint (x * 0x1p23f); + ix -= 23 << 23; + } + + /* x = 2^k z; where z is in range [OFF,2*OFF] and exact. + The range is split into N subintervals. + The ith subinterval contains z and c is near its center. */ + tmp = ix - OFF; + i = (tmp >> (23 - LOG2F_TABLE_BITS)) % N; + top = tmp & 0xff800000; + iz = ix - top; + k = (int32_t) tmp >> 23; /* arithmetic shift */ + invc = T[i].invc; + logc = T[i].logc; + z = (double_t) asfloat (iz); - GET_FLOAT_WORD(ix,x); + /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ + r = z * invc - 1; + y0 = logc + (double_t) k; - k=0; - if (ix < 0x00800000) { /* x < 2**-126 */ - if (__builtin_expect((ix&0x7fffffff)==0, 0)) - return -two25/__fabsf (x); /* log(+-0)=-inf */ - if (__builtin_expect(ix<0, 0)) - return (x-x)/(x-x); /* log(-#) = NaN */ - k -= 25; x *= two25; /* subnormal number, scale up x */ - GET_FLOAT_WORD(ix,x); - } - if (__builtin_expect(ix >= 0x7f800000, 0)) return x+x; - k += (ix>>23)-127; - ix &= 0x007fffff; - i = (ix+(0x95f64<<3))&0x800000; - SET_FLOAT_WORD(x,ix|(i^0x3f800000)); /* normalize x or x/2 */ - k += (i>>23); - dk = (float)k; - f = x-(float)1.0; - if((0x007fffff&(15+ix))<16) { /* |f| < 2**-20 */ - if(f==zero) - { - if (FIX_INT_FP_CONVERT_ZERO && dk == 0.0f) - dk = 0.0f; - return dk; - } - R = f*f*((float)0.5-(float)0.33333333333333333*f); - return dk-(R-f)/ln2; - } - s = f/((float)2.0+f); - z = s*s; - i = ix-(0x6147a<<3); - w = z*z; - j = (0x6b851<<3)-ix; - t1= w*(Lg2+w*(Lg4+w*Lg6)); - t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); - i |= j; - R = t2+t1; - if(i>0) { - hfsq=(float)0.5*f*f; - return dk-((hfsq-(s*(hfsq+R)))-f)/ln2; - } else { - return dk-((s*(f-R))-f)/ln2; - } + /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ + r2 = r * r; + y = A[1] * r + A[2]; + y = A[0] * r2 + y; + p = A[3] * r + y0; + y = y * r2 + p; + return (float) y; } strong_alias (__ieee754_log2f, __log2f_finite) diff --git a/sysdeps/ieee754/flt-32/e_log2f_data.c b/sysdeps/ieee754/flt-32/e_log2f_data.c new file mode 100644 index 0000000000..e39de3ba56 --- /dev/null +++ b/sysdeps/ieee754/flt-32/e_log2f_data.c @@ -0,0 +1,44 @@ +/* Data definition for log2f. + Copyright (C) 2017 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 "math_config.h" + +const struct log2f_data __log2f_data = { + .tab = { + { 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 }, + { 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 }, + { 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 }, + { 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 }, + { 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 }, + { 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 }, + { 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 }, + { 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 }, + { 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 }, + { 0x1p+0, 0x0p+0 }, + { 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 }, + { 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 }, + { 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 }, + { 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 }, + { 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 }, + { 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 }, + }, + .poly = { + -0x1.712b6f70a7e4dp-2, 0x1.ecabf496832ep-2, -0x1.715479ffae3dep-1, + 0x1.715475f35c8b8p0, + } +}; diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h index 9dde0f98eb..cca0b53d36 100644 --- a/sysdeps/ieee754/flt-32/math_config.h +++ b/sysdeps/ieee754/flt-32/math_config.h @@ -123,4 +123,15 @@ extern const struct logf_data double poly[LOGF_POLY_ORDER]; } __logf_data attribute_hidden; +#define LOG2F_TABLE_BITS 4 +#define LOG2F_POLY_ORDER 4 +extern const struct log2f_data +{ + struct + { + double invc, logc; + } tab[1 << LOG2F_TABLE_BITS]; + double poly[LOG2F_POLY_ORDER]; +} __log2f_data attribute_hidden; + #endif diff --git a/sysdeps/m68k/m680x0/fpu/e_log2f_data.c b/sysdeps/m68k/m680x0/fpu/e_log2f_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/e_log2f_data.c @@ -0,0 +1 @@ +/* Not needed. */ -- 2.11.0 From patchwork Mon Sep 25 11:04:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 818177 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-84914-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="kR8PlQII"; 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 3y11Sn4yMmz9t4Z for ; Mon, 25 Sep 2017 21:04: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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= abtzxqCxMFrM5Z+jlhz4o4dc2202g9VKT5rYUDKaMXOYsow73FRgzJ6Cys2Tv3HI I1QKpB/c4f/uK7rRyDsbF1s9wTtEUCqKycTHPBolkIF9bpvxdhPM0oYfjDwGrP4D 6QzYJwAMB3aTNTfGuA4PNN7Q46Ol1UCFUa8W1PS9lgE= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=aP3G Y9exuLcr2TA7+GM+Gj/FC6o=; b=kR8PlQIIxeXfI2apjY0KLi4eUzVvLEP2mXHT rVEb2VmS8IxHDhUmZQimuhDGSCByVQOexHGAjxNpFTdpOFnCKZXqi8L9Yr0fMKhM s/MlXTD0s7BwDGk8xW0RwEzEftRAnN105MABy3vECGa9eNmACe1PhfP8oepKYkvG FfbSQO4= Received: (qmail 22500 invoked by alias); 25 Sep 2017 11:04: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 21028 invoked by uid 89); 25 Sep 2017 11:04:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=zj X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <59C8E2C2.6000509@arm.com> Date: Mon, 25 Sep 2017 12:04:34 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH 4/7 v2] New generic powf References: <59C8E136.6070606@arm.com> In-Reply-To: <59C8E136.6070606@arm.com> X-ClientProxiedBy: DB6PR07CA0006.eurprd07.prod.outlook.com (2603:10a6:6:2d::16) To HE1PR0802MB2489.eurprd08.prod.outlook.com (2603:10a6:3:d8::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbcf463e-aeb6-4096-86a5-08d504053694 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:HE1PR0802MB2489; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2489; 3:RlDU/sHedX/IZkz3N8hOcVllStZml09OMgnTR8CHzh8TRlptBe+uHnOI0BhG6jo8A8vJdUxQMlEqIRJKO/HBPo5eIbtTav1mfmUvqodnzbPHwUYcTTr7SgJGTJh4fEZwO8BefPoNbUQMEbnSi+ZohFboOMlTDflFs+2D9xtMoWHT7/YblMwHuYA+YIUfDLxepbupavfTXIczH9yxk4f7L9NzmX3MdECltQoym51NnMMkK8uGojaPzKYdLIKOtHMN; 25:2nmTgB89lSqYWxGePvYEIzMUJS1iOo4KZFCLO4M0X+q1txH85+BANIYchKSSlAHpQxlKTZwp2uhH3xjLHSC1XU21jmxz404/UBdyihGDsuEyopO0lKt1d1Cb3foso7vsymzcf7LjNIfzqKeAtXe9MzZ+GGInuZ50hOWaz6OGMU1ecU6jaZSZ0+4XSGHDihJbiehDkI4FZxoC4D5UbIwCQ7J0o4q+zQGO7x3PEt+qWRpMuBlTaChLiOfBeXNOIWbly9ufrXkM3eM0qfMoDLpS2NGIayPZWdGrF1HjYzzi9aSITbU6L5U8mp7tv6ooKqunGK9fKrVgzjSZMaGk6SNUCQ==; 31:ZPyy3425ycXt2jo9SzHagbSBS92Qv1mPnqE/9d8h5xMfTGX9EXRbqKbBKvda8w3MHyJjSbEVYp1in8ODzflJjD1UjBdf2Oo6CSdjjo09UGKsyy4nz8cSRP+/EhL6g/CobKcyIrAchk+15KT8pNS9RciaZ+0fgVW2CScsh6uxwX1RFjY3mI/qmAror4HzLpcyYYbq0QjGcF1P7IkxQBQDL3QzqDo+b3Rrgof4NqPKTJo= X-MS-TrafficTypeDiagnostic: HE1PR0802MB2489: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2489; 20:O/H9f+1qQmQGSKZlSVeTflLCOde2Ha/9Joo8T+r0ETZq2FSPHLX5cqyIk7y/QLd6qJMwq5fmoN4BRjZuEC1V7U7vESBbp5IH6Q2w5ObKuEN8yK6juojd5AHtFcJM6NAq+/dBUqsqm1MuFrRAc99A7RNfgPs3bFwG6EJ0m6nr6wg=; 4:Yf2XUOrcVRjEDWwInNntXjOoWAZUckwdUKVyhjltCqmtNKvMF5IHakCtv8v9c4QhqHgXYZtEHjaqCLREpDMjLZZg3NiYobTl2fMMEUZOTAoQiHGRw1iglIUc1qvmZWLIBkfqHGUWCCgd7xTORhikUXrlU54YF82+9+ZQdqXAcPKEOoZqlf56KBS0x0dyQPZPoDLSrCNRkwY5rIojlOOyvPpiNrpxi4qyEJ8UyJCRvHrSL6uEzhhsT9lOUad8rM/e X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0802MB2489; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0802MB2489; X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(346002)(39860400002)(376002)(189002)(199003)(97736004)(16586007)(86362001)(68736007)(65956001)(66066001)(305945005)(65806001)(6916009)(33656002)(2950100002)(478600001)(36756003)(7736002)(72206003)(4610100001)(25786009)(54356999)(76176999)(65816999)(87266999)(5000100001)(59896002)(50986999)(8936002)(81166006)(81156014)(4326008)(64126003)(80316001)(2906002)(84326002)(83506001)(53936002)(58126008)(101416001)(8676002)(5660300001)(3846002)(270700001)(6116002)(568964002)(5890100001)(16576012)(16526017)(2476003)(316002)(6666003)(189998001)(105586002)(564344004)(106356001)(77096006)(6486002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0802MB2489; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2489; 23:+GWHW4r06rEU6I4lGNHBJJGly77KTA2Nz6J+49BSB1MN0Qf1Uh3jPfLvfZCMoE/RTMoO3tItccrR/awCWcVGZFv15olVF7Z2qG+ml1P8NdiJHc1c5bAyr+TKi+Ek6M9agoOOOIY2dpGV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f1KrYRQwTlmocMruns+wYM8r2l8m4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 11:04:37.6250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2489 v2: - __powf_data is attribute_hidden From 22ad3727cd7ff290cee95423f8f74c265229e52d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 4 Sep 2017 17:55:33 +0100 Subject: [PATCH 4/7] New generic powf without wrapper on aarch64: powf reciprocal-throughput: 4.2x faster powf latency: 2.6x faster old worst-case error: 1.11 ulp new worst-case error: 0.82 ulp aarch64 .text size: -780 bytes aarch64 .rodata size: +144 bytes powf(x,y) is implemented as exp2(y*log2(x)) with the same algorithms that are used in exp2f and log2f, except that the log2f polynomial is larger for extra precision and its output (and exp2f input) may be scaled by a power of 2 (POWF_SCALE) to simplify the argument reduction step of exp2 (possible when efficient round and convert toint operation is available). The special case handling tries to minimize the checks in the hot path. When the input of exp2_inline is checked, int arithmetics is used as that was faster on the tested aarch64 cores. 2017-09-19 Szabolcs Nagy * math/Makefile (type-float-routines): Add e_powf_log2_data. * sysdeps/ieee754/flt-32/e_powf.c: New implementation. * sysdeps/ieee754/flt-32/e_powf_log2_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h (__powf_data): Define. (issignalingf_inline): Likewise. (POWF_LOG2_TABLE_BITS): Likewise. (POWF_LOG2_POLY_ORDER): Likewise. (POWF_SCALE_BITS): Likewise. (POWF_SCALE): Likewise. * sysdeps/i386/fpu/e_powf_log2_data.c: New file. * sysdeps/ia64/fpu/e_powf_log2_data.c: New file. * sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c: New file. --- math/Makefile | 2 +- sysdeps/i386/fpu/e_powf_log2_data.c | 1 + sysdeps/ia64/fpu/e_powf_log2_data.c | 1 + sysdeps/ieee754/flt-32/e_powf.c | 388 ++++++++++++++--------------- sysdeps/ieee754/flt-32/e_powf_log2_data.c | 45 ++++ sysdeps/ieee754/flt-32/math_config.h | 27 ++ sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c | 1 + 7 files changed, 265 insertions(+), 200 deletions(-) create mode 100644 sysdeps/i386/fpu/e_powf_log2_data.c create mode 100644 sysdeps/ia64/fpu/e_powf_log2_data.c create mode 100644 sysdeps/ieee754/flt-32/e_powf_log2_data.c create mode 100644 sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c diff --git a/math/Makefile b/math/Makefile index b4b3101592..6c8aa3e413 100644 --- a/math/Makefile +++ b/math/Makefile @@ -116,7 +116,7 @@ type-double-routines := branred doasin dosincos halfulp mpa mpatan2 \ # float support type-float-suffix := f type-float-routines := k_rem_pio2f math_errf e_exp2f_data e_logf_data \ - e_log2f_data + e_log2f_data e_powf_log2_data # _Float128 support type-float128-suffix := f128 diff --git a/sysdeps/i386/fpu/e_powf_log2_data.c b/sysdeps/i386/fpu/e_powf_log2_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/i386/fpu/e_powf_log2_data.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ia64/fpu/e_powf_log2_data.c b/sysdeps/ia64/fpu/e_powf_log2_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ia64/fpu/e_powf_log2_data.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c index ce8e11f1ea..644a18d05e 100644 --- a/sysdeps/ieee754/flt-32/e_powf.c +++ b/sysdeps/ieee754/flt-32/e_powf.c @@ -1,7 +1,5 @@ -/* e_powf.c -- float version of e_pow.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ -/* Copyright (C) 2017 Free Software Foundation, Inc. +/* Single-precision pow function. + Copyright (C) 2017 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 @@ -18,210 +16,202 @@ License along with the GNU C Library; if not, see . */ -/* - * ==================================================== - * 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. - * ==================================================== - */ - #include -#include - -static const float huge = 1.0e+30, tiny = 1.0e-30; - -static const float -bp[] = {1.0, 1.5,}, -zero = 0.0, -one = 1.0, -two = 2.0, -two24 = 16777216.0, /* 0x4b800000 */ - /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */ -L1 = 6.0000002384e-01, /* 0x3f19999a */ -L2 = 4.2857143283e-01, /* 0x3edb6db7 */ -L3 = 3.3333334327e-01, /* 0x3eaaaaab */ -L4 = 2.7272811532e-01, /* 0x3e8ba305 */ -L5 = 2.3066075146e-01, /* 0x3e6c3255 */ -L6 = 2.0697501302e-01, /* 0x3e53f142 */ -P1 = 1.6666667163e-01, /* 0x3e2aaaab */ -P2 = -2.7777778450e-03, /* 0xbb360b61 */ -P3 = 6.6137559770e-05, /* 0x388ab355 */ -P4 = -1.6533901999e-06, /* 0xb5ddea0e */ -P5 = 4.1381369442e-08, /* 0x3331bb4c */ -ovt = 4.2995665694e-08; /* -(128-log2(ovfl+.5ulp)) */ - -static const double - dp[] = { 0.0, 0x1.2b803473f7ad1p-1, }, /* log2(1.5) */ - lg2 = M_LN2, - cp = 2.0/3.0/M_LN2, - invln2 = 1.0/M_LN2; +#include +#include "math_config.h" -float -__ieee754_powf(float x, float y) +/* +POWF_LOG2_POLY_ORDER = 5 +EXP2F_TABLE_BITS = 5 + +ULP error: 0.82 (~ 0.5 + relerr*2^24) +relerr: 1.27 * 2^-26 (Relative error ~= 128*Ln2*relerr_log2 + relerr_exp2) +relerr_log2: 1.83 * 2^-33 (Relative error of logx.) +relerr_exp2: 1.69 * 2^-34 (Relative error of exp2(ylogx).) +*/ + +#define N (1 << POWF_LOG2_TABLE_BITS) +#define T __powf_log2_data.tab +#define A __powf_log2_data.poly +#define OFF 0x3f330000 + +/* Subnormal input is normalized so ix has negative biased exponent. + Output is multiplied by N (POWF_SCALE) if TOINT_INTRINICS is set. */ +static inline double_t +log2_inline (uint32_t ix) { - float z, ax, s; - double d1, d2; - int32_t i,j,k,yisint,n; - int32_t hx,hy,ix,iy; - - GET_FLOAT_WORD(hy,y); - iy = hy&0x7fffffff; - - /* y==zero: x**0 = 1 */ - if(iy==0 && !issignaling (x)) return one; - - /* x==+-1 */ - if(x == 1.0 && !issignaling (y)) return one; - if(x == -1.0 && isinf(y)) return one; - - GET_FLOAT_WORD(hx,x); - ix = hx&0x7fffffff; - - /* +-NaN return x+y */ - if(__builtin_expect(ix > 0x7f800000 || - iy > 0x7f800000, 0)) - return x+y; - - /* special value of y */ - if (__builtin_expect(iy==0x7f800000, 0)) { /* y is +-inf */ - if (ix==0x3f800000) - return y - y; /* inf**+-1 is NaN */ - else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */ - return (hy>=0)? y: zero; - else /* (|x|<1)**-,+inf = inf,0 */ - return (hy<0)?-y: zero; - } - if(iy==0x3f800000) { /* y is +-1 */ - if(hy<0) return one/x; else return x; - } - if(hy==0x40000000) return x*x; /* y is 2 */ - if(hy==0x3f000000) { /* y is 0.5 */ - if(__builtin_expect(hx>=0, 1)) /* x >= +0 */ - return __ieee754_sqrtf(x); - } + /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ + double_t z, r, r2, r4, p, q, y, y0, invc, logc; + uint32_t iz, top, tmp; + int k, i; + + /* x = 2^k z; where z is in range [OFF,2*OFF] and exact. + The range is split into N subintervals. + The ith subinterval contains z and c is near its center. */ + tmp = ix - OFF; + i = (tmp >> (23 - POWF_LOG2_TABLE_BITS)) % N; + top = tmp & 0xff800000; + iz = ix - top; + k = (int32_t) top >> (23 - POWF_SCALE_BITS); /* arithmetic shift */ + invc = T[i].invc; + logc = T[i].logc; + z = (double_t) asfloat (iz); + + /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ + r = z * invc - 1; + y0 = logc + (double_t) k; + + /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ + r2 = r * r; + y = A[0] * r + A[1]; + p = A[2] * r + A[3]; + r4 = r2 * r2; + q = A[4] * r + y0; + q = p * r2 + q; + y = y * r4 + q; + return y; +} - /* determine if y is an odd int when x < 0 - * yisint = 0 ... y is not an integer - * yisint = 1 ... y is an odd int - * yisint = 2 ... y is an even int - */ - yisint = 0; - if(hx<0) { - if(iy>=0x4b800000) yisint = 2; /* even integer y */ - else if(iy>=0x3f800000) { - k = (iy>>23)-0x7f; /* exponent */ - j = iy>>(23-k); - if((j<<(23-k))==iy) yisint = 2-(j&1); - } - } +#undef N +#undef T +#define N (1 << EXP2F_TABLE_BITS) +#define T __exp2f_data.tab +#define SIGN_BIAS (1 << (EXP2F_TABLE_BITS + 11)) + +/* The output of log2 and thus the input of exp2 is either scaled by N + (in case of fast toint intrinsics) or not. The unscaled xd must be + in [-1021,1023], sign_bias sets the sign of the result. */ +static inline double_t +exp2_inline (double_t xd, unsigned long sign_bias) +{ + uint64_t ki, ski, t; + /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ + double_t kd, z, r, r2, y, s; + +#if TOINT_INTRINSICS +# define C __exp2f_data.poly_scaled + /* N*x = k + r with r in [-1/2, 1/2] */ + kd = roundtoint (xd); /* k */ + ki = converttoint (xd); +#else +# define C __exp2f_data.poly +# define SHIFT __exp2f_data.shift_scaled + /* x = k/N + r with r in [-1/(2N), 1/(2N)] */ + kd = (double) (xd + SHIFT); /* Rounding to double precision is required. */ + ki = asuint64 (kd); + kd -= SHIFT; /* k/N */ +#endif + r = xd - kd; + + /* exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1) */ + t = T[ki % N]; + ski = ki + sign_bias; + t += ski << (52 - EXP2F_TABLE_BITS); + s = asdouble (t); + z = C[0] * r + C[1]; + r2 = r * r; + y = C[2] * r + 1; + y = z * r2 + y; + y = y * s; + return y; +} - ax = fabsf(x); - /* special value of x */ - if(__builtin_expect(ix==0x7f800000||ix==0||ix==0x3f800000, 0)){ - z = ax; /*x is +-0,+-inf,+-1*/ - if(hy<0) z = one/z; /* z = (1/|x|) */ - if(hx<0) { - if(((ix-0x3f800000)|yisint)==0) { - z = (z-z)/(z-z); /* (-1)**non-int is NaN */ - } else if(yisint==1) - z = -z; /* (x<0)**odd = -(|x|**odd) */ - } - return z; - } +/* Returns 0 if not int, 1 if odd int, 2 if even int. */ +static inline int +checkint (uint32_t iy) +{ + int e = iy >> 23 & 0xff; + if (e < 0x7f) + return 0; + if (e > 0x7f + 23) + return 2; + if (iy & ((1 << (0x7f + 23 - e)) - 1)) + return 0; + if (iy & (1 << (0x7f + 23 - e))) + return 1; + return 2; +} - /* (x<0)**(non-int) is NaN */ - if(__builtin_expect(((((uint32_t)hx>>31)-1)|yisint)==0, 0)) - return (x-x)/(x-x); - - /* |y| is huge */ - if(__builtin_expect(iy>0x4d000000, 0)) { /* if |y| > 2**27 */ - /* over/underflow if x is not close to one */ - if(ix<0x3f7ffff8) return (hy<0)? huge*huge:tiny*tiny; - if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny; - /* now |1-x| is tiny <= 2**-20, suffice to compute - log(x) by x-x^2/2+x^3/3-x^4/4 */ - d2 = ax-1; /* d2 has 20 trailing zeros. */ - d2 = d2 * invln2 - - (d2 * d2) * (0.5 - d2 * (0.333333333333 - d2 * 0.25)) * invln2; - } else { - /* Avoid internal underflow for tiny y. The exact value - of y does not matter if |y| <= 2**-32. */ - if (iy < 0x2f800000) - SET_FLOAT_WORD (y, (hy & 0x80000000) | 0x2f800000); - n = 0; - /* take care subnormal number */ - if(ix<0x00800000) - {ax *= two24; n -= 24; GET_FLOAT_WORD(ix,ax); } - n += ((ix)>>23)-0x7f; - j = ix&0x007fffff; - /* determine interval */ - ix = j|0x3f800000; /* normalize ix */ - if(j<=0x1cc471) k=0; /* |x|= 2u * 0x7f800000 - 1; +} - s = one; /* s (sign of result -ve**odd) = -1 else = 1 */ - if(((((uint32_t)hx>>31)-1)|(yisint-1))==0) - s = -one; /* (-ve)**(odd int) */ - - /* compute y * d2 */ - d1 = y * d2; - z = d1; - GET_FLOAT_WORD(j,z); - if (__builtin_expect(j>0x43000000, 0)) /* if z > 128 */ - return s*huge*huge; /* overflow */ - else if (__builtin_expect(j==0x43000000, 0)) { /* if z == 128 */ - if(ovt>(z-d1)) return s*huge*huge; /* overflow */ +float +__ieee754_powf (float x, float y) +{ + unsigned long sign_bias = 0; + uint32_t ix, iy; + + ix = asuint (x); + iy = asuint (y); + if (__glibc_unlikely (ix - 0x00800000 >= 0x7f800000 - 0x00800000 + || zeroinfnan (iy))) + { + /* Either (x < 0x1p-126 or inf or nan) or (y is 0 or inf or nan). */ + if (__glibc_unlikely (zeroinfnan (iy))) + { + if (2 * iy == 0) + return issignalingf_inline (x) ? x + y : 1.0f; + if (ix == 0x3f800000) + return issignalingf_inline (y) ? x + y : 1.0f; + if (2 * ix > 2u * 0x7f800000 || 2 * iy > 2u * 0x7f800000) + return x + y; + if (2 * ix == 2 * 0x3f800000) + return 1.0f; + if ((2 * ix < 2 * 0x3f800000) == !(iy & 0x80000000)) + return 0.0f; /* |x|<1 && y==inf or |x|>1 && y==-inf. */ + return y * y; + } + if (__glibc_unlikely (zeroinfnan (ix))) + { + float_t x2 = x * x; + if (ix & 0x80000000 && checkint (iy) == 1) + { + x2 = -x2; + sign_bias = 1; + } +#if WANT_ERRNO + if (2 * ix == 0 && iy & 0x80000000) + return __math_divzerof (sign_bias); +#endif + return iy & 0x80000000 ? 1 / x2 : x2; } - else if (__builtin_expect((j&0x7fffffff)>0x43160000, 0))/* z <= -150 */ - return s*tiny*tiny; /* underflow */ - else if (__builtin_expect((uint32_t) j==0xc3160000, 0)){/* z == -150*/ - if(0.0<=(z-d1)) return s*tiny*tiny; /* underflow */ + /* x and y are non-zero finite. */ + if (ix & 0x80000000) + { + /* Finite x < 0. */ + int yint = checkint (iy); + if (yint == 0) + return __math_invalidf (x); + if (yint == 1) + sign_bias = SIGN_BIAS; + ix &= 0x7fffffff; } - /* - * compute 2**d1 - */ - i = j&0x7fffffff; - k = (i>>23)-0x7f; - n = 0; - if(i>0x3f000000) { /* if |z| > 0.5, set n = [z+0.5] */ - n = j+(0x00800000>>(k+1)); - k = ((n&0x7fffffff)>>23)-0x7f; /* new k for n */ - SET_FLOAT_WORD(z,n&~(0x007fffff>>k)); - n = ((n&0x007fffff)|0x00800000)>>(23-k); - if(j<0) n = -n; - d1 -= z; + if (ix < 0x00800000) + { + /* Normalize subnormal x so exponent becomes negative. */ + ix = asuint (x * 0x1p23f); + ix &= 0x7fffffff; + ix -= 23 << 23; } - d1 = d1 * lg2; - d2 = d1*d1; - d2 = d1 - d2*(P1+d2*(P2+d2*(P3+d2*(P4+d2*P5)))); - d2 = (d1*d2)/(d2-two); - z = one - (d2-d1); - GET_FLOAT_WORD(j,z); - j += (n<<23); - if((j>>23)<=0) /* subnormal output */ - { - z = __scalbnf (z, n); - float force_underflow = z * z; - math_force_eval (force_underflow); - } - else SET_FLOAT_WORD(z,j); - return s*z; + } + double_t logx = log2_inline (ix); + double_t ylogx = y * logx; /* Note: cannot overflow, y is single prec. */ + if (__glibc_unlikely ((asuint64 (ylogx) >> 47 & 0xffff) + >= asuint64 (126.0 * POWF_SCALE) >> 47)) + { + /* |y*log(x)| >= 126. */ + if (ylogx > 0x1.fffffffd1d571p+6 * POWF_SCALE) + return __math_oflowf (sign_bias); + if (ylogx <= -150.0 * POWF_SCALE) + return __math_uflowf (sign_bias); +#if WANT_ERRNO_UFLOW + if (ylogx < -149.0 * POWF_SCALE) + return __math_may_uflowf (sign_bias); +#endif + } + return (float) exp2_inline (ylogx, sign_bias); } strong_alias (__ieee754_powf, __powf_finite) diff --git a/sysdeps/ieee754/flt-32/e_powf_log2_data.c b/sysdeps/ieee754/flt-32/e_powf_log2_data.c new file mode 100644 index 0000000000..7cff06f59b --- /dev/null +++ b/sysdeps/ieee754/flt-32/e_powf_log2_data.c @@ -0,0 +1,45 @@ +/* Data definition for powf. + Copyright (C) 2017 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 "math_config.h" + +const struct powf_log2_data __powf_log2_data = { + .tab = { + { 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 * POWF_SCALE }, + { 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 * POWF_SCALE }, + { 0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 * POWF_SCALE }, + { 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 * POWF_SCALE }, + { 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 * POWF_SCALE }, + { 0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 * POWF_SCALE }, + { 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 * POWF_SCALE }, + { 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 * POWF_SCALE }, + { 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 * POWF_SCALE }, + { 0x1p+0, 0x0p+0 * POWF_SCALE }, + { 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 * POWF_SCALE }, + { 0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 * POWF_SCALE }, + { 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 * POWF_SCALE }, + { 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 * POWF_SCALE }, + { 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 * POWF_SCALE }, + { 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 * POWF_SCALE }, + }, + .poly = { + 0x1.27616c9496e0bp-2 * POWF_SCALE, -0x1.71969a075c67ap-2 * POWF_SCALE, + 0x1.ec70a6ca7baddp-2 * POWF_SCALE, -0x1.7154748bef6c8p-1 * POWF_SCALE, + 0x1.71547652ab82bp0 * POWF_SCALE, + } +}; diff --git a/sysdeps/ieee754/flt-32/math_config.h b/sysdeps/ieee754/flt-32/math_config.h index cca0b53d36..aeff4808c6 100644 --- a/sysdeps/ieee754/flt-32/math_config.h +++ b/sysdeps/ieee754/flt-32/math_config.h @@ -21,6 +21,7 @@ #include #include +#include #include #ifndef WANT_ROUNDING @@ -90,6 +91,15 @@ asdouble (uint64_t i) return u.f; } +static inline int +issignalingf_inline (float x) +{ + uint32_t ix = asuint (x); + if (HIGH_ORDER_BIT_IS_SET_FOR_SNAN) + return (ix & 0x7fc00000) == 0x7fc00000; + return 2 * (ix ^ 0x00400000) > 2u * 0x7fc00000; +} + #define NOINLINE __attribute__ ((noinline)) attribute_hidden float __math_oflowf (unsigned long); @@ -134,4 +144,21 @@ extern const struct log2f_data double poly[LOG2F_POLY_ORDER]; } __log2f_data attribute_hidden; +#define POWF_LOG2_TABLE_BITS 4 +#define POWF_LOG2_POLY_ORDER 5 +#if TOINT_INTRINSICS +#define POWF_SCALE_BITS EXP2F_TABLE_BITS +#else +#define POWF_SCALE_BITS 0 +#endif +#define POWF_SCALE ((double) (1 << POWF_SCALE_BITS)) +extern const struct powf_log2_data +{ + struct + { + double invc, logc; + } tab[1 << POWF_LOG2_TABLE_BITS]; + double poly[POWF_LOG2_POLY_ORDER]; +} __powf_log2_data attribute_hidden; + #endif diff --git a/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c b/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/e_powf_log2_data.c @@ -0,0 +1 @@ +/* Not needed. */ -- 2.11.0 From patchwork Mon Sep 25 11:05:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 818178 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-84915-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="jCGgaqm4"; 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 3y11V15lH3z9t4Z for ; Mon, 25 Sep 2017 21:06:01 +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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= fUo4jY0d+qpcFclAi6NkqtuocXQsftt0DQUsTjA4BE+5r8WHnYPTAaea7U0M4TP0 DTHWV+eMzVboeo+4i+3hAPQvlWgxkBpO0Ex8BOfwl5slp/mCvf6hy8tfNHDFhmmD NCSXkts2EBqb8+A2Yivd1Akr5DnOw1QcEeigWGXaa5o= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=EMJ5 z2wlKSxAdp3T2LmxdrK83vs=; b=jCGgaqm4jnvnR4jzQrggCUcjsfY2npErZXQn qK/fVwh4VuDuIGCeiIdjPckh/wKBSfvyIoL55OI3Y1ywaIWDpe5UtpwgGoDlqSHl xOfl7BF9rRZgbWTTFVHwUCGI50KgCgmsYhFzj9r9/WUC7fOyZN92Y5g5Mb1DndsB mrps0No= Received: (qmail 46951 invoked by alias); 25 Sep 2017 11:05:50 -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 46096 invoked by uid 89); 25 Sep 2017 11:05:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <59C8E302.4020808@arm.com> Date: Mon, 25 Sep 2017 12:05:38 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH 5/7] New symbol version for logf, log2f and powf without SVID compat References: <59C8E136.6070606@arm.com> In-Reply-To: <59C8E136.6070606@arm.com> X-ClientProxiedBy: DB6PR07CA0019.eurprd07.prod.outlook.com (2603:10a6:6:2d::29) To AM5PR0802MB2481.eurprd08.prod.outlook.com (2603:10a6:203:97::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 723a202a-4713-4e2b-6bbc-08d504055c6e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:AM5PR0802MB2481; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2481; 3:IXXXc4ZGzuLC735SPPAE7aDrWhPMm7OazTATf3nBUKPlY7tuZ5D0kFdSK+IiNvegj4Zf+yp1x37Mtq9XIPGAtyaWQ/mEd05imh4QN7U6AZs9Cg4QvSp+DfzueIFoMIX+m0SfviYFd1D1eBPl4gNxVwNX0zODSzWcguZEth0hAtpyUXuoMMAQy9oFWRmaHPbsJUOLpXIw0KQeFByqfRuDxa7vb/EdhG+Qri7iHOZ+9q0Dl/Dwmm4ckXPczr3vnph+; 25:DWoexqa3Twn19Pj7b72TQQPIBGzi4n+5zj3wDZEm9MtiIhQs7baY5JHkZZ5g1uTnWffQlGOTlpZZRXWg3+7PRzI5Ghb6dOPYZlBozc68DBepJZLSSSsga7ExWVsedrOla+UmCIZWcUIsLm0HqSpNoK0FrKUT28rg9zhr42XrQbpYArVkmmj2ZghTZHrXPOnAlzYZg8e8kumpijuofFSTvx8pjPYPSaSpmGKtxXl+8IE=; 31:vNhPH51D4tURI+p0dqq0Lb3h/08/kiwd67jSCQphepi468Vr0itulobohnIWRgj9vME60L9XG/WF8FcdCEY+DRdspXsZk+jQCm6+GSs2x9d1cLu0LzviaFQW4EBMu3wu; 20:/jWcVAsJ9VzDrauVP1P566blCKE1bRIjIRh5taCeCy6RbQSP36J1WnSvweaiNm966oUth82pfPHYuh8sRVkuWoLnAcMr8oewsc/dDWLNix0Wf2MJ2XEuUBfsIEBsGN1BE7MaDAIk11aAtY23NnidAU0bdBZ5ConkRe4lGTByu8Y= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2481: NoDisclaimer: True X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2481; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2481; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2481; 4:Gx+yKL914ORHd/71Ia+gguRUFe9IkFHffjotDkAybfrYl7rzuvvHV6DpqZHgMYahCkDiAjIdwYDxLRCwVBeakgdOonfXWCgSKhtSY+St6G3+uQp4C9Dg5Nc9JIsKly53WxFfR6jJ2mQ0+MkaHtCk0w== X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(39860400002)(376002)(346002)(199003)(189002)(4610100001)(8676002)(101416001)(7736002)(97736004)(72206003)(36756003)(25786009)(83506001)(66066001)(64126003)(80316001)(65806001)(4326008)(65956001)(84326002)(16526017)(316002)(76176999)(54356999)(58126008)(8936002)(2906002)(5000100001)(53936002)(50986999)(478600001)(16576012)(33656002)(2476003)(3846002)(6916009)(6116002)(6666003)(59896002)(2950100002)(105586002)(68736007)(16586007)(65816999)(568964002)(19618925003)(305945005)(87266999)(86362001)(5890100001)(270700001)(106356001)(77096006)(6486002)(564344004)(81156014)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2481; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2481; 23:D8/rJDT5EYttRTmNUk1Nrs87DG2kYFtxPQ44TA73menznlhGfwycUYNrx3yGTLPj4gJaGYxn42XW4TCzUZfqaeBDs32socXffjcNY3nni3PFyk/GoCRfRk5Axq3zQ7cqMI8D/zwRDYMAay+OAvIZtqAq4fUmFyR68a2/O2th+PhXGwT1OXq8Ywas0h8L2SdB4/Sc5ZNpR8w6MLVgXI04aQxH9QmZmvEZ3Lo3O0tw2cXqkxWxEJ8iDA5YXz8K7XaOa4HCq1h13d3bLMAgnaz9SYSkL/R8s/iA+Z9PJgpZ7FQWz0Iw6EGUUjOnAxqzHefYMMGM3wiPqludejh9AUgiydDg7CfhkFkc1xVmqvffsJ5lDW2iyE0N/yABwPePkW5ES+12q1gFhX82L/0Hxbl1trTqy98AwMV0MX2h8jxJDzxjvLQNdU4yzQGoW9lcHsB9GmandodRoqhLkI+EB6yL/kGlYPxq8WLo3ObwfCemC4Ag26rKoj90acOpJ3j3HT59FXyo0dD5p0W2IZy1lfmwKRoVZYbnYTVYBxdmbx0UBUGCIW93tVZNawomHogxa6FpCmFAQQ6fKQlkFk+ac4NbDU7EhIs+8e1sdQpPbvIgzjYZFQTg4g9KQ8q3JcRAoG+OoGT/lTG496FTGKHy4czbuA4cZtjoqvfwXamBTGDPpBjKXaQrI5194K1b/au395lB1vEVlDiNZZOuEdl8AWEedYAxBg4ATePJf2w4Q8BBBhu28Ac9XmW3H3p0db2oAWOOC4C3fhFOfEMmFtZfRo4suNJ0M4MvLsxARxCQL7s9u9EYrtGHZA2LKxn/ZJtaqlEzkvPV1y4uKDGTRYbX6Lbgk/ErqAzgQb4N7qGPQJ67ah5IW6UysW7LGf2knmdYKePs8/fM5MHsY6+qLB0byA/gONaMHuqjR0mC2mn2HsnBsJk2WcxRLCy0YitLmZe4YbjNp50UwvkOnejERfrgT5wX991Vu5ff367UgkRjvOYk6DGns25kLDD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TPbJhVYNxovBejpXomUVRpiFsOgSEAYlbcr/LBs+MjvaGXRMibgUI5J93b7kCWACSdULMQRwRxTGA7yBGZG7x+MyG1Sitc/Ik1DKDcUXUcxc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 11:05:41.1287 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2481 unchanged. From e061d511a685390887b661ac4d8b22b00b05e086 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 13 Sep 2017 17:19:51 +0100 Subject: [PATCH 5/7] New symbol version for logf, log2f and powf without SVID compat This patch changes the logf, log2f and powf error handling semantics to only set errno accoring to POSIX rules. New symbol version is introduced at GLIBC_2.27. The old wrappers are kept for compat symbols. ia64 needed assembly change to have the new and compat versioned symbol map to the same function. All linux libm abilists are updated. 2017-09-19 Szabolcs Nagy * math/Versions (logf): New libm symbol at GLIBC_2.27. (log2f): Likewise. (powf): Likewise. * math/w_log2f.c: New file. * math/w_logf.c: New file. * math/w_powf.c: New file. * math/w_log2f_compat.c (__log2f_compat): For compat symbol only. * math/w_logf_compat.c (__logf_compat): Likewise. * math/w_powf_compat.c (__powf_compat): Likewise. * sysdeps/ia64/fpu/e_log2f.S: Add versioned symbols. * sysdeps/ia64/fpu/e_logf.S: Likewise. * sysdeps/ia64/fpu/e_powf.S: Likewise. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. --- math/Versions | 2 +- math/w_log2f.c | 7 +++++++ math/w_log2f_compat.c | 6 +++--- math/w_logf.c | 7 +++++++ math/w_logf_compat.c | 6 +++--- math/w_powf.c | 7 +++++++ math/w_powf_compat.c | 6 +++--- sysdeps/ia64/fpu/e_log2f.S | 10 ++++++++-- sysdeps/ia64/fpu/e_logf.S | 6 ++++++ sysdeps/ia64/fpu/e_powf.S | 10 ++++++++-- sysdeps/unix/sysv/linux/aarch64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/alpha/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/arm/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/hppa/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/i386/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/ia64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/microblaze/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/mips/mips32/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/mips/mips64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/nios2/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist | 3 +++ sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/sh/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/x86_64/64/libm.abilist | 3 +++ sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist | 3 +++ 36 files changed, 131 insertions(+), 14 deletions(-) create mode 100644 math/w_log2f.c create mode 100644 math/w_logf.c create mode 100644 math/w_powf.c diff --git a/math/Versions b/math/Versions index 380f6a2a1a..2fbdb2f266 100644 --- a/math/Versions +++ b/math/Versions @@ -230,6 +230,6 @@ libm { fromfpx; fromfpxf; fromfpxl; ufromfpx; ufromfpxf; ufromfpxl; } GLIBC_2.27 { - expf; exp2f; + expf; exp2f; logf; log2f; powf; } } diff --git a/math/w_log2f.c b/math/w_log2f.c new file mode 100644 index 0000000000..cda0c3a644 --- /dev/null +++ b/math/w_log2f.c @@ -0,0 +1,7 @@ +#include +#undef __USE_WRAPPER_TEMPLATE +#define __USE_WRAPPER_TEMPLATE 1 +#undef declare_mgen_alias +#define declare_mgen_alias(a, b) +#include +versioned_symbol (libm, __log2f, log2f, GLIBC_2_27); diff --git a/math/w_log2f_compat.c b/math/w_log2f_compat.c index 295c1620f7..3caa310c51 100644 --- a/math/w_log2f_compat.c +++ b/math/w_log2f_compat.c @@ -23,10 +23,10 @@ #include -#if LIBM_SVID_COMPAT +#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27) /* wrapper log2f(x) */ float -__log2f (float x) +__log2f_compat (float x) { if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) { @@ -44,5 +44,5 @@ __log2f (float x) return __ieee754_log2f (x); } -libm_alias_float (__log2, log2) +compat_symbol (libm, __log2f_compat, log2f, GLIBC_2_1); #endif diff --git a/math/w_logf.c b/math/w_logf.c new file mode 100644 index 0000000000..d960e016d7 --- /dev/null +++ b/math/w_logf.c @@ -0,0 +1,7 @@ +#include +#undef __USE_WRAPPER_TEMPLATE +#define __USE_WRAPPER_TEMPLATE 1 +#undef declare_mgen_alias +#define declare_mgen_alias(a, b) +#include +versioned_symbol (libm, __logf, logf, GLIBC_2_27); diff --git a/math/w_logf_compat.c b/math/w_logf_compat.c index 7cdacdf921..936b3a6e67 100644 --- a/math/w_logf_compat.c +++ b/math/w_logf_compat.c @@ -23,10 +23,10 @@ #include -#if LIBM_SVID_COMPAT +#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27) /* wrapper logf(x) */ float -__logf (float x) +__logf_compat (float x) { if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_) { @@ -44,5 +44,5 @@ __logf (float x) return __ieee754_logf (x); } -libm_alias_float (__log, log) +compat_symbol (libm, __logf_compat, logf, GLIBC_2_0); #endif diff --git a/math/w_powf.c b/math/w_powf.c new file mode 100644 index 0000000000..a18348329e --- /dev/null +++ b/math/w_powf.c @@ -0,0 +1,7 @@ +#include +#undef __USE_WRAPPER_TEMPLATE +#define __USE_WRAPPER_TEMPLATE 1 +#undef declare_mgen_alias +#define declare_mgen_alias(a, b) +#include +versioned_symbol (libm, __powf, powf, GLIBC_2_27); diff --git a/math/w_powf_compat.c b/math/w_powf_compat.c index 39e818af7e..7745639efe 100644 --- a/math/w_powf_compat.c +++ b/math/w_powf_compat.c @@ -22,10 +22,10 @@ #include -#if LIBM_SVID_COMPAT +#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27) /* wrapper powf */ float -__powf (float x, float y) +__powf_compat (float x, float y) { float z = __ieee754_powf (x, y); if (__glibc_unlikely (!isfinite (z))) @@ -60,5 +60,5 @@ __powf (float x, float y) return z; } -libm_alias_float (__pow, pow) +compat_symbol (libm, __powf_compat, powf, GLIBC_2_0); #endif diff --git a/sysdeps/ia64/fpu/e_log2f.S b/sysdeps/ia64/fpu/e_log2f.S index 2c3f18f360..9b754d1043 100644 --- a/sysdeps/ia64/fpu/e_log2f.S +++ b/sysdeps/ia64/fpu/e_log2f.S @@ -252,7 +252,7 @@ LOCAL_OBJECT_END(T_table) .section .text -GLOBAL_LIBM_ENTRY(log2f) +GLOBAL_LIBM_ENTRY(__log2f) { .mfi alloc r32=ar.pfs,1,4,4,0 @@ -491,7 +491,13 @@ SPECIAL_log2f: br.ret.sptk b0;; } -GLOBAL_LIBM_END(log2f) +GLOBAL_LIBM_END(__log2f) +#ifdef SHARED +.symver __log2f,log2f@@GLIBC_2.27 +.weak __log2f_compat +.set __log2f_compat,__log2f +.symver __log2f_compat,log2f@GLIBC_2.2 +#endif LOCAL_LIBM_ENTRY(__libm_error_region) diff --git a/sysdeps/ia64/fpu/e_logf.S b/sysdeps/ia64/fpu/e_logf.S index 2dda2186d0..d5f5437793 100644 --- a/sysdeps/ia64/fpu/e_logf.S +++ b/sysdeps/ia64/fpu/e_logf.S @@ -1088,6 +1088,12 @@ logf_libm_err: nop.i 0 };; GLOBAL_IEEE754_END(logf) +#ifdef SHARED +.symver logf,logf@@GLIBC_2.27 +.weak __logf_compat +.set __logf_compat,__logf +.symver __logf_compat,logf@GLIBC_2.2 +#endif // Stack operations when calling error support. diff --git a/sysdeps/ia64/fpu/e_powf.S b/sysdeps/ia64/fpu/e_powf.S index d61bc79e5e..388391624f 100644 --- a/sysdeps/ia64/fpu/e_powf.S +++ b/sysdeps/ia64/fpu/e_powf.S @@ -868,7 +868,7 @@ data8 0xEAC0C6E7DD24392F , 0x00003FFF LOCAL_OBJECT_END(pow_tbl2) .section .text -GLOBAL_LIBM_ENTRY(powf) +GLOBAL_LIBM_ENTRY(__powf) // Get exponent of x. Will be used to calculate K. { .mfi @@ -2002,7 +2002,13 @@ POW_OVER_UNDER_ERROR: } ;; -GLOBAL_LIBM_END(powf) +GLOBAL_LIBM_END(__powf) +#ifdef SHARED +.symver __powf,powf@@GLIBC_2.27 +.weak __powf_compat +.set __powf_compat,__powf +.symver __powf_compat,powf@GLIBC_2.2 +#endif LOCAL_LIBM_ENTRY(__libm_error_region) diff --git a/sysdeps/unix/sysv/linux/aarch64/libm.abilist b/sysdeps/unix/sysv/linux/aarch64/libm.abilist index 10102eeaff..3f0190ae03 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libm.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libm.abilist @@ -463,3 +463,6 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F diff --git a/sysdeps/unix/sysv/linux/alpha/libm.abilist b/sysdeps/unix/sysv/linux/alpha/libm.abilist index e09a115aa9..78edc5e3d9 100644 --- a/sysdeps/unix/sysv/linux/alpha/libm.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libm.abilist @@ -473,6 +473,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.3.4 GLIBC_2.3.4 A GLIBC_2.3.4 __c1_cabsf F GLIBC_2.3.4 __c1_cacosf F diff --git a/sysdeps/unix/sysv/linux/arm/libm.abilist b/sysdeps/unix/sysv/linux/arm/libm.abilist index 8095876449..b3fd4a27b2 100644 --- a/sysdeps/unix/sysv/linux/arm/libm.abilist +++ b/sysdeps/unix/sysv/linux/arm/libm.abilist @@ -120,6 +120,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _LIB_VERSION D 0x4 GLIBC_2.4 __clog10 F diff --git a/sysdeps/unix/sysv/linux/hppa/libm.abilist b/sysdeps/unix/sysv/linux/hppa/libm.abilist index 19d40ef50d..ffa61bf1b1 100644 --- a/sysdeps/unix/sysv/linux/hppa/libm.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libm.abilist @@ -432,5 +432,8 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 exp2l F diff --git a/sysdeps/unix/sysv/linux/i386/libm.abilist b/sysdeps/unix/sysv/linux/i386/libm.abilist index 791fba28e5..1a7e6bf449 100644 --- a/sysdeps/unix/sysv/linux/i386/libm.abilist +++ b/sysdeps/unix/sysv/linux/i386/libm.abilist @@ -614,4 +614,7 @@ GLIBC_2.26 ynf128 F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A diff --git a/sysdeps/unix/sysv/linux/ia64/libm.abilist b/sysdeps/unix/sysv/linux/ia64/libm.abilist index 65a0fbe56a..7e15735eae 100644 --- a/sysdeps/unix/sysv/linux/ia64/libm.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libm.abilist @@ -543,4 +543,7 @@ GLIBC_2.26 ynf128 F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist index 8095876449..b3fd4a27b2 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist @@ -120,6 +120,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 _LIB_VERSION D 0x4 GLIBC_2.4 __clog10 F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist index 5e692dda7b..aae61169f9 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist @@ -474,4 +474,7 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A diff --git a/sysdeps/unix/sysv/linux/microblaze/libm.abilist b/sysdeps/unix/sysv/linux/microblaze/libm.abilist index 65f1d5b451..0d3b4b1e90 100644 --- a/sysdeps/unix/sysv/linux/microblaze/libm.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/libm.abilist @@ -431,3 +431,6 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist index c32ea5b96a..d32d58d4e4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libm.abilist @@ -433,6 +433,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 exp2l F _gp_disp _gp_disp A diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist index 18b2aa2404..f33ba0576b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/libm.abilist @@ -465,4 +465,7 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A diff --git a/sysdeps/unix/sysv/linux/nios2/libm.abilist b/sysdeps/unix/sysv/linux/nios2/libm.abilist index e492a68e9d..0fe34e98fa 100644 --- a/sysdeps/unix/sysv/linux/nios2/libm.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libm.abilist @@ -431,3 +431,6 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist index ad8f0372f4..ed013deefd 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist @@ -476,6 +476,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 __clog10l F GLIBC_2.4 __finitel F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist index 9c26b5b809..6f2873dc80 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist @@ -475,6 +475,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 __clog10l F GLIBC_2.4 __finitel F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist index 8e36699f28..723be46c20 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist @@ -608,3 +608,6 @@ GLIBC_2.26 ynf128 F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist index 9ca0c3ccfc..f3aeac2e1e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist @@ -151,6 +151,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.3 GLIBC_2.3 A GLIBC_2.3 _LIB_VERSION D 0x4 GLIBC_2.3 __clog10 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist index 8a79f0137f..2b758e80fd 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist @@ -463,6 +463,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 __clog10l F GLIBC_2.4 __finitel F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist index df81853618..62c9bb57a8 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist @@ -461,6 +461,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 __clog10l F GLIBC_2.4 __finitel F diff --git a/sysdeps/unix/sysv/linux/sh/libm.abilist b/sysdeps/unix/sysv/linux/sh/libm.abilist index 6b6a42dc9c..a57fbc0eac 100644 --- a/sysdeps/unix/sysv/linux/sh/libm.abilist +++ b/sysdeps/unix/sysv/linux/sh/libm.abilist @@ -432,5 +432,8 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 exp2l F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist index 24d67d22e1..f8f10e5952 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist @@ -467,6 +467,9 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A GLIBC_2.4 __clog10l F GLIBC_2.4 __finitel F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist index 2fdccc0de3..b5412c9b48 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist @@ -464,4 +464,7 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist index 98bc348f91..b711e87026 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist @@ -432,3 +432,6 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist index 98bc348f91..b711e87026 100644 --- a/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist @@ -432,3 +432,6 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F diff --git a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist b/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist index 98bc348f91..b711e87026 100644 --- a/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist +++ b/sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist @@ -432,3 +432,6 @@ GLIBC_2.25 ufromfpxl F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist index e6fd3fe3df..201c2ab1b1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libm.abilist @@ -603,4 +603,7 @@ GLIBC_2.26 ynf128 F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F GLIBC_2.4 GLIBC_2.4 A diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist index afa7b98697..10e389a96a 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist @@ -602,3 +602,6 @@ GLIBC_2.26 ynf128 F GLIBC_2.27 GLIBC_2.27 A GLIBC_2.27 exp2f F GLIBC_2.27 expf F +GLIBC_2.27 log2f F +GLIBC_2.27 logf F +GLIBC_2.27 powf F -- 2.11.0 From patchwork Mon Sep 25 11:06:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 818179 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-84916-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="R5Rwp6h1"; 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 3y11Vr2BT1z9t4Z for ; Mon, 25 Sep 2017 21:06:44 +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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= W95B4Ofl/5H/dS5PG2cAZCmDvnvmrI9D/IY871N0zfRTXerbs1somOy+yHDpOsAt TapE2af+0nDMuday8nB+FljXyTerfsEB+7sgZ4qJilVrFjdE9cA8bwVxgkBX/5ve 9UjYBr+Y3gnORHdTdZf18FIL4w2eOfBs3glZz9kstfk= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=TNWc RTaekn5uHdvs17Ry0b1kTU4=; b=R5Rwp6h1VWgoRBmP3dtUh4lYcV/5wNgV+Y4I 73jCNDZO/287/L+7PHOzTNqIaGxw70taIcwuv6hUsEaERrX6mBey66cjTz5+/YjC NeZvEV8WXPsvPCCLg4eCYZ9SnMyHeyScrvfT+QDSuiUW+0TxaohOFFfCB3UVfpBE dChQKW4= Received: (qmail 78470 invoked by alias); 25 Sep 2017 11:06:36 -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 77695 invoked by uid 89); 25 Sep 2017 11:06:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <59C8E332.8040800@arm.com> Date: Mon, 25 Sep 2017 12:06:26 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH 6/7] Do not wrap logf, log2f and powf References: <59C8E136.6070606@arm.com> In-Reply-To: <59C8E136.6070606@arm.com> X-ClientProxiedBy: DB6PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:6:2::35) To HE1PR0802MB2489.eurprd08.prod.outlook.com (2603:10a6:3:d8::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7265e916-b319-44a3-c367-08d504057a39 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:HE1PR0802MB2489; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2489; 3:1QeHCjlT+u+fgQr+CsdNPNRSE06MYh++nIt7k9989hTb4d2vfUqpvQvXFfXplBO0yh7UI+ObZZuxsMGz8z4tdr+5tC8z8E7SclCAZes11CvIHooHmzKxYXkJLS23FiteKlI9ff4heNuJPZx3JLa5IJfynyfozc6jaKbsQYLfr0nCGl7Pq9mGBCpuUnCdTZx9D4X86p9/+/GxHHXKXBmw59QBnjpDt8+WFDD+SQVrto0sRB7a5M9XlU8GYzltX5Uj; 25:GOrhLYjamPq1GZtY4EOmdTtR7XZMRxw3KCTyitY+JChk77e1k2ZstaWYEhcBGf/DgUtow8YFHxA/sW4n74RIQhhjGdh+rhxzHFMLAWt42heve8KgQEouvQbcjwL77Umi25DBPUfd1XRFdMLPCKllYf4y4tdB39LMp1IzccY9B9rKJuprYDSZaImZun2c6BG434auNqgKatue1uqBp9agRK1oxSn/ey0cMGmAKhTlaTw=; 31:X41e67EotGByw4KwsxtyUWTxG9jv+0rvK0JSuGDPF7ZglvH1VmuReYq2gshXxkJzdLF9yDe+jP0UE/1JVnB1QdjelKIN1IKyBPmwW2Ckn/4eN18UCcK8Ez9kI6KzV9SH; 20:wM5r/CDfDYxdF1rVbeAz5tXxfS4Kv9MykiVombkA4GXmrjrrZm1/cjSTpLgRTkNwC70Gmj3BMp5Cd4dDysTIRQwSuTcxZ+1pMQxR7EW0OHzF/E0JN2kBY9p4Wc4/lG0hykba96+tY8EWGw+Y2rAFaN7ygPGIdnFt5BN0Td+IuJg= X-MS-TrafficTypeDiagnostic: HE1PR0802MB2489: NoDisclaimer: True X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0802MB2489; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0802MB2489; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2489; 4:O/V3o3XsxYsJjZpMjLMkidnk6+9TrGYWE2x6dEMmGVm6t8ohR3nC/6iT8MLsrQbao9BZGyzFMNHNOrcaxbHMYBf34GIjqH0Sv1W+85T5u2i4N1xb2CVJjGZ+z9VcY20b2sov9VQ+JxJJdH3fpAoSKg== X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(346002)(39860400002)(376002)(189002)(199003)(97736004)(16586007)(86362001)(68736007)(65956001)(66066001)(305945005)(65806001)(6916009)(33656002)(2950100002)(478600001)(36756003)(7736002)(72206003)(4610100001)(25786009)(54356999)(76176999)(65816999)(87266999)(5000100001)(59896002)(50986999)(8936002)(81166006)(81156014)(4326008)(64126003)(80316001)(2906002)(84326002)(83506001)(53936002)(58126008)(101416001)(8676002)(3846002)(270700001)(6116002)(568964002)(5890100001)(19618925003)(16576012)(16526017)(2476003)(316002)(6666003)(105586002)(564344004)(106356001)(77096006)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0802MB2489; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2489; 23:LsGDMdBv0U+0rK73cvnjwdQwpO6eyD9HSYQucXwYB403JJvIZuA1ZdetcuAwr0GqM4wsGjpSIm2PwfYyWV2cgvCGlCUofdozay4Xj8WLtsVs63WIqMSsi64/SAs1HylgGU6VNtPcQEkaCnpkwgTA01DAq5qJR4ktT39/fSKJWaIRXu8MniNQ53/JAUUIvcmGEL0T1gcGZ9H+w3UQcOmGyukJQauqMiOlu/RaOjmiVk+77dQgeb6oesSo33tz2QuVXBWwKSVbkXcTAfxBwwSdh8qE9vAu4BDx8bqE063VjY7Hq9luVVBGayaCayZLH2lIT2swXhycHXztOZOjFBXaogByfrvR7jC4TwRXSwbod6nSFSQNbHdHzPkvQXic/X4fH9L27Rb65chPRlq5PfBLeqL8Jsy519L46uP2vYniInQyB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5E7/dyNKlkgv82Kx3prX1k7NJPUv+gzwS0XrVuIwvoCebFILHBCc8r4C3zyNRhdVyOkoe71lZ41VVB00JpNnacncpQGStlLastbuflw4+PpgtnVSn0nM6n6QBn6roWhnzX7Xi2Tl+Ep0FZohRnebZPTmZYief/Sn+q6viHMND0+xS42v+mwRcPr1Nt7+Q=; 5:V/t8BS8n4usRGCdlIofXbgvfH0lrL/zDOldWj+GAiAThTs4QuHdTJEr9h6YPMM+LnkLeSNQ1MxtH8eDpY6VSLPHGOb4lVB4VBTGvEaxzV6ShVL9fgzQ9nktXA0w/Zj/o9P0qmeqvkxd+YN9NLCBmIw==; 24:L1TQoaa3r1Fba+G5PmHS2OFktHURWhDV3bSNkj1Yli4kNe+c509F42kPGyozbllJgeiKq+l41tfUHiWG065roRwGXnmyERHtYiOhG9vBLI4=; 7:QhwIDZin5lU6XG2mqmL/sG+VG6BS+dkH6zFlOyB5deTV6eN72l5rukW+beA7OuEAjySagq/6wCD0dZBDD/kVxM4nH4f0MVVrjjoQ+/o3mDB0b5uO1kVJQhOVHarsPZ9jHjRWtZwbY1/ECq65du3qXQzRVeOLzYcb8fn+ugFGoVv2nMoHQDjchLZ4vVEXfb89wx2oKHGc/yIwSdBmNMwiurZtuqdAfSyt4LJcJIBN/AI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 11:06:30.7402 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2489 unchanged. From f94527d72b2e4e7fe0f0339d0a35aaa91646401b Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 13 Sep 2017 18:14:26 +0100 Subject: [PATCH 6/7] Do not wrap logf, log2f and powf The new generic logf, log2f and powf code don't need wrappers any more, they set errno inline so only use the wrappers on targets that need it. 2017-09-19 Szabolcs Nagy * sysdeps/ieee754/flt-32/e_log2f.c (__log2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_logf.c (__logf): Likewise * sysdeps/ieee754/flt-32/e_powf.c (__powf): Likewise * sysdeps/ieee754/flt-32/w_log2f.c: New file. * sysdeps/ieee754/flt-32/w_logf.c: New file. * sysdeps/ieee754/flt-32/w_powf.c: New file. * sysdeps/i386/fpu/w_log2f.c: New file. * sysdeps/i386/fpu/w_logf.c: New file. * sysdeps/i386/fpu/w_powf.c: New file. * sysdeps/m68k/m680x0/fpu/w_log2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_logf.c: New file. * sysdeps/m68k/m680x0/fpu/w_powf.c: New file. --- sysdeps/i386/fpu/w_log2f.c | 1 + sysdeps/i386/fpu/w_logf.c | 1 + sysdeps/i386/fpu/w_powf.c | 1 + sysdeps/ieee754/flt-32/e_log2f.c | 7 +++++-- sysdeps/ieee754/flt-32/e_logf.c | 7 +++++-- sysdeps/ieee754/flt-32/e_powf.c | 7 +++++-- sysdeps/ieee754/flt-32/w_log2f.c | 1 + sysdeps/ieee754/flt-32/w_logf.c | 1 + sysdeps/ieee754/flt-32/w_powf.c | 1 + sysdeps/m68k/m680x0/fpu/w_log2f.c | 1 + sysdeps/m68k/m680x0/fpu/w_logf.c | 1 + sysdeps/m68k/m680x0/fpu/w_powf.c | 1 + 12 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 sysdeps/i386/fpu/w_log2f.c create mode 100644 sysdeps/i386/fpu/w_logf.c create mode 100644 sysdeps/i386/fpu/w_powf.c create mode 100644 sysdeps/ieee754/flt-32/w_log2f.c create mode 100644 sysdeps/ieee754/flt-32/w_logf.c create mode 100644 sysdeps/ieee754/flt-32/w_powf.c create mode 100644 sysdeps/m68k/m680x0/fpu/w_log2f.c create mode 100644 sysdeps/m68k/m680x0/fpu/w_logf.c create mode 100644 sysdeps/m68k/m680x0/fpu/w_powf.c diff --git a/sysdeps/i386/fpu/w_log2f.c b/sysdeps/i386/fpu/w_log2f.c new file mode 100644 index 0000000000..3f5c71cec2 --- /dev/null +++ b/sysdeps/i386/fpu/w_log2f.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/i386/fpu/w_logf.c b/sysdeps/i386/fpu/w_logf.c new file mode 100644 index 0000000000..ea48d1356e --- /dev/null +++ b/sysdeps/i386/fpu/w_logf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/i386/fpu/w_powf.c b/sysdeps/i386/fpu/w_powf.c new file mode 100644 index 0000000000..d133216f5b --- /dev/null +++ b/sysdeps/i386/fpu/w_powf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/ieee754/flt-32/e_log2f.c b/sysdeps/ieee754/flt-32/e_log2f.c index 6c42f27843..a3506dcfd1 100644 --- a/sysdeps/ieee754/flt-32/e_log2f.c +++ b/sysdeps/ieee754/flt-32/e_log2f.c @@ -18,6 +18,7 @@ #include #include +#include #include "math_config.h" /* @@ -34,7 +35,7 @@ Relative error: 1.9 * 2^-26 (before rounding.) #define OFF 0x3f330000 float -__ieee754_log2f (float x) +__log2f (float x) { /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ double_t z, r, r2, p, y, y0, invc, logc; @@ -85,4 +86,6 @@ __ieee754_log2f (float x) y = y * r2 + p; return (float) y; } -strong_alias (__ieee754_log2f, __log2f_finite) +strong_alias (__log2f, __ieee754_log2f) +strong_alias (__log2f, __log2f_finite) +versioned_symbol (libm, __log2f, log2f, GLIBC_2_27); diff --git a/sysdeps/ieee754/flt-32/e_logf.c b/sysdeps/ieee754/flt-32/e_logf.c index b8d262441f..ba537d5236 100644 --- a/sysdeps/ieee754/flt-32/e_logf.c +++ b/sysdeps/ieee754/flt-32/e_logf.c @@ -18,6 +18,7 @@ #include #include +#include #include "math_config.h" /* @@ -35,7 +36,7 @@ Relative error: 1.957 * 2^-26 (before rounding.) #define OFF 0x3f330000 float -__ieee754_logf (float x) +__logf (float x) { /* double_t for better performance on targets with FLT_EVAL_METHOD==2. */ double_t z, r, r2, y, y0, invc, logc; @@ -84,4 +85,6 @@ __ieee754_logf (float x) y = y * r2 + (y0 + r); return (float) y; } -strong_alias (__ieee754_logf, __logf_finite) +strong_alias (__logf, __ieee754_logf) +strong_alias (__logf, __logf_finite) +versioned_symbol (libm, __logf, logf, GLIBC_2_27); diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c index 644a18d05e..4368f49be2 100644 --- a/sysdeps/ieee754/flt-32/e_powf.c +++ b/sysdeps/ieee754/flt-32/e_powf.c @@ -18,6 +18,7 @@ #include #include +#include #include "math_config.h" /* @@ -139,7 +140,7 @@ zeroinfnan (uint32_t ix) } float -__ieee754_powf (float x, float y) +__powf (float x, float y) { unsigned long sign_bias = 0; uint32_t ix, iy; @@ -214,4 +215,6 @@ __ieee754_powf (float x, float y) } return (float) exp2_inline (ylogx, sign_bias); } -strong_alias (__ieee754_powf, __powf_finite) +strong_alias (__powf, __ieee754_powf) +strong_alias (__powf, __powf_finite) +versioned_symbol (libm, __powf, powf, GLIBC_2_27); diff --git a/sysdeps/ieee754/flt-32/w_log2f.c b/sysdeps/ieee754/flt-32/w_log2f.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_log2f.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/flt-32/w_logf.c b/sysdeps/ieee754/flt-32/w_logf.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_logf.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/flt-32/w_powf.c b/sysdeps/ieee754/flt-32/w_powf.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_powf.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/m68k/m680x0/fpu/w_log2f.c b/sysdeps/m68k/m680x0/fpu/w_log2f.c new file mode 100644 index 0000000000..3f5c71cec2 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/w_log2f.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/m68k/m680x0/fpu/w_logf.c b/sysdeps/m68k/m680x0/fpu/w_logf.c new file mode 100644 index 0000000000..ea48d1356e --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/w_logf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/m68k/m680x0/fpu/w_powf.c b/sysdeps/m68k/m680x0/fpu/w_powf.c new file mode 100644 index 0000000000..d133216f5b --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/w_powf.c @@ -0,0 +1 @@ +#include -- 2.11.0 From patchwork Mon Sep 25 11:07:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 818180 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-84917-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="P5bgTsQO"; 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 3y11WV28DXz9t4Z for ; Mon, 25 Sep 2017 21: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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= bolIwsC8bcHIam+6sAVK7QvtfPNLzl+9Saz8Z1dAISyVRD290gQhYZoqPaKzJTvw MlOr0pNn4pr/0oAmOCYH+r1lGIZgyZv0sP6PVLtiKJ7ehDUyeHve0U9tazto4uzR +SQDmQLCcCIYUJYEK7Tt4Us1WoNvXRCnnKKzOSCNCsI= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=NFMT wg1Rvi1UfuSkvep71f3MzcA=; b=P5bgTsQOA9H2mzR4tCAW/xl2DvQfJ3/sYH4y hFKi65X1/rFOubrwy37AYwsJtnS1jmyJYPHEV2iR4ep4HUs0QtDK28UyhdSlDWSo 5++yH4rHr57moyC4Hup0Uoxgfq0ibLFRJmV4/3IpOH0FWnOfm1tc1DIJ73hvhMDi N8fqnpw= Received: (qmail 120713 invoked by alias); 25 Sep 2017 11:07:12 -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 119798 invoked by uid 89); 25 Sep 2017 11:07:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; Message-ID: <59C8E354.8050002@arm.com> Date: Mon, 25 Sep 2017 12:07:00 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: GNU C Library CC: nd@arm.com Subject: [PATCH 7/7] AArch64: update libm-test-ulps References: <59C8E136.6070606@arm.com> In-Reply-To: <59C8E136.6070606@arm.com> X-ClientProxiedBy: DB6PR0902CA0005.eurprd09.prod.outlook.com (2603:10a6:6:2::18) To DB6PR0802MB2487.eurprd08.prod.outlook.com (2603:10a6:4:a0::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c45efa82-2348-4116-f099-08d504058cde X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0802MB2487; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2487; 3:+4EiTCgXD6fmYnHr+FZIgRPV/jCcGngJC03DXRSsOZdCS7fsvOlChwSY3lLOnLlAR5yuVJG5SwLoPkKBcy3/A50WzUX8SCXIaizMxmscWrsGCMWGEunx6ehq8+rBNdhI/JiGlIPqkzLMP4TtnyuFWYZIHtf54MhVRH+SX1m5eBDMONO72g7oJ94EFD1K/G1/8jVtdLe5pLHUowa268v4eqFcRHKNKO7O712KXouBR4PLZdiX09R2QCRLrtYByL+o; 25:cdd4okXSY72WK9YXqZ9wK3XJuR2wVELsuy68BiNPA2p/Xrgdrkoh7JuSxucp0cuMZnGlU4DIp2NMdN3gEDXKzeHCWFTDKdYlJEOoZgwxnXsNPQEtlCweTQPs18sZaaUovcZ2NJABF5t968+OhTou5tgdwUatEqdVFwEhGP55hb6wT20sTO9h47WjVgw85I9V1Ix3Qoz2smu+cK1tJgoXt2M0a9/ZcvEuUCV8VfYx0EU=; 31:5Si7fmBb5K9nj8Y3GNXMSJw2ZIrguDtvk1jkpd+I9p9U+1/PWlw/uCi2o29SkjH7NC2+UPRpP1PXFfGvvGuhEJnEiWZDIkNvGQKgoofmx48eyPGFNpzzOvknqtye/D9T; 20:/GAuJYikmf5n86+UAsw6uVd8m/Wt2umHTFtxMwGOUzHlvnCjEa6s8QvBve9rrny0Jllgc9Di9qEhPM3OdTL0v0tmfE7TE4dmE+roinj01vaFxaIX5wNEkzPMHWARd1qtS7QMS4YdKqJzOiN4u2lPPQBpTlFbGv5mWRQhoEB4Iyc= X-MS-TrafficTypeDiagnostic: DB6PR0802MB2487: NoDisclaimer: True X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0802MB2487; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0802MB2487; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2487; 4:40vlInnoeZ3vVclLab2Lo1xaEftsB1O0siAT4BVM+MAwkb9EC78DXnxzsPPlf90p55JwtWuoqvBlbXm+K/Nd7CLfOV0hHasr8e6efbX2VXm4gTo3+0pJUf+4FXALe6xUPMaakvPEBudlX/QVEByTBg== X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(39860400002)(346002)(376002)(189002)(199003)(72206003)(58126008)(19618925003)(8676002)(81166006)(53936002)(4326008)(105586002)(33656002)(8936002)(77096006)(59896002)(86362001)(478600001)(230783001)(2476003)(6116002)(81156014)(6486002)(568964002)(5890100001)(270700001)(68736007)(15650500001)(65816999)(2906002)(3846002)(97736004)(80316001)(316002)(65956001)(66066001)(101416001)(106356001)(305945005)(36756003)(83506001)(16586007)(16576012)(564344004)(2950100002)(25786009)(64126003)(87266999)(50986999)(84326002)(76176999)(54356999)(7736002)(6916009)(5000100001)(4610100001)(65806001)(16526017); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2487; H:[10.2.206.69]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1; DB6PR0802MB2487; 23:0Uotc2K1c5teMjuEFmz6yLgsh5YxBojL551K1iezEz2MLfV1CHMY263eCCPOOTdQMFOKzq5E8NdsGkKgVHF5fEXtt7YlCudYHv1Or1ixYvN8mAq6By9dBsBqpl0weJ+nnQpYTtycupV8mTNnTni3UmZPihDPy2PqkgB82ezBs4y5jzjpxbac7KouOAZS+6Gw5o18Ptx9VUF8jjKQwrISqRiyGNb8ZGeQnMn5DZeeBCwq6W1ZSC+GL99nXmJNcS9Lx0RNsIsabIbb0vryPqnHHEq0lt4eahmZZyeBMyzQ3wtvYd8IFNcg3PJM+shivC7kHQ7wKWZht3PaGf0qI0KMDzw4AInoxwHZzo2F/5nG5P1fDd4MRnGjfjbRyj1OOjhfiHlfrmi3f8IQc5lqn6vJhMxht4YE/6DBlkt/QLzCWTJNKVC209TC72yFd39h10hZVYdf872kBj1aRaxACSHFn62+QWghRAr3UDDgjoPGAyVcvU/kAt2bp234C1K3KlK0rs4cvh3NIrtyvyMMvb1i7fskPXRLaF+6Q8nlC4iGGZhX+myrC1DNc/iLglAaBSw7RG87aLn6BzxD8/9LeuaLJX+/CQ5eJbocsxE03QZ1tAgeNMgReuWVphwPPrzQj7NOk7UJx7pQG61WBiIP0llHyD7qUg0AGMbsnjCz4WL9zkMfHdE6iD002XjMTBYihfUEBlh/qOJv/bTyuESp8tq71wV19Rmnj5z8m5Z+7Ut5oJSOMT1IQmWXqpC0A01uw/aDCExPs+eRZGcRodnM/iPJCfh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FBBsjfoJ8jO7/Q8b3bMHoQWUP5FxLYaJIxra9Z4hUex7c3J2GGdBuRCn8X932cxVBQ3W0qdCkNig2X8RLc=; 7:v49uIPIaK33l7/DS8XSCmC3W+Yng2JWzDAjXhFAQ0pOGMmxPSum7r3Jf/bJvmKyMv+WpHznjU4XTc0VyLnPYytrJbbFZyUzEooQ8romh3AEXhwMGn+7iTt8SaqKFz85Hqv/rBFRBH8k+WHqbW9IqolIf4zASHMbF9Ft+AOpoXMHm+svLcyXVrlcakZCQ8byao6OxxzjHrNLn7+ltajkcG5hUjF6cBh3Lc/4y4KqMmPQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 11:07:02.6936 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2487 unchanged. From 49465364630917b0d410e374c9873e47dcb7c055 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 18 Sep 2017 13:37:08 +0100 Subject: [PATCH 7/7] AArch64: update libm-test-ulps Update for new expf and logf. 2017-09-19 Szabolcs Nagy * sysdeps/aarch64/libm-test-ulps: Update. --- sysdeps/aarch64/libm-test-ulps | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sysdeps/aarch64/libm-test-ulps b/sysdeps/aarch64/libm-test-ulps index 797a8ef8cb..234fc6c489 100644 --- a/sysdeps/aarch64/libm-test-ulps +++ b/sysdeps/aarch64/libm-test-ulps @@ -917,9 +917,9 @@ ldouble: 2 Function: Real part of "clog10_downward": double: 5 -float: 4 +float: 5 idouble: 5 -ifloat: 4 +ifloat: 5 ildouble: 3 ldouble: 3 @@ -1583,15 +1583,21 @@ ldouble: 2 Function: "exp_downward": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "exp_towardzero": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "exp_upward": double: 1 +float: 1 idouble: 1 +ifloat: 1 Function: "expm1": double: 1 -- 2.11.0