From patchwork Fri Sep 29 13:02:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 23230 Received: (qmail 84468 invoked by alias); 29 Sep 2017 13:02:19 -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 81947 invoked by uid 89); 29 Sep 2017 13:02:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com From: Wilco Dijkstra To: "libc-alpha@sourceware.org" CC: nd Subject: [PATCH] Use fabs(f/l) rather than __fabs Date: Fri, 29 Sep 2017 13:02:12 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0801MB2053; 6:8Q4I2enc3kDw2xVJ9R7upfLqT0X1y1WKhxTf78rjGAZxzepa8JhzbEAjj8/lfQbmU7K/nJCIq43gcQXHNoUXpP21EPrwMDkQyJ4oCqorQjT3q7xcy54GGoXYgfyNRV7Ag4nmjIGnRYbPn/SAsuebxtx/1TQrYhaK1cuiBaQWG78BxBtAsRKOvJO2pXN9it4iiiPDuj7JAfmZXXeN/zn/hqa0XsFET2lPj4jeEPGFO+pI8er7yLFpeFB3FdEeF+534RJOp2cQtIHvTjJ00CDfopWGxdhGDfVDVpAb4qINwF7qc0CQdrq9jjSmO3fAe0Q21E9M+ZbbOg9328GNmWTcqg==; 5:bZUf7yiiKpFn7X+rRyvWyTjamB+kC61F4aG2Df60zawyMYkScAoSn4aNuO51vvChkjZrpqtIrNVENw3Bnh9k8pgTenFz2b9ceCdEDMubKWL1aX5dm9VxhponzfKr2bEJhmIRvrctoZ8FSh9+pLf4CA==; 24:TsQML6gqw9KG3JoveYKegjTP/MVtLmyWPhI6Na4WuNQRcZtv6jl/5q6NHHMwNqzthT09cXrrDPt+eSoFbQg/Pg9IjwXQbQOg/iPtjJ5uQwc=; 7:mcmqfxXTzkAgYK4Av6fBMfQTYdP6yL6G3zv7QYymFndHzsq1LzKstM8ZlSYGQ4bGu/L+a+2RbwUXgFdnhubk//QGYWfhlipPe7/l8+GJ4EujIMq3sLSnYi+agkvoxqKn68wsSs1KubVWtNl/d6yB+v+qRbBcC4m9z8pYr0eu7ONeSOyw+RpXI2kz6bM6L4JSOXuvkxhGxHKy/hXGhtDKzDfKcsU37npcvAAjeRnr3xA= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: d5c4ca58-669a-481a-f2dd-08d5073a4d3c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0801MB2053; x-ms-traffictypediagnostic: DB6PR0801MB2053: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0801MB2053; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0801MB2053; x-forefront-prvs: 0445A82F82 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(377424004)(199003)(54534003)(2501003)(106356001)(6506006)(3280700002)(6436002)(478600001)(3660700001)(7736002)(2906002)(105586002)(2351001)(66066001)(9686003)(7696004)(5660300001)(14454004)(102836003)(53936002)(3846002)(4326008)(6916009)(86362001)(189998001)(5640700003)(72206003)(50986999)(68736007)(25786009)(575784001)(74316002)(316002)(54356999)(99286003)(55016002)(101416001)(6116002)(97736004)(5250100002)(305945005)(2900100001)(8936002)(33656002)(8676002)(81156014)(81166006)(11771545001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0801MB2053; H:DB6PR0801MB2053.eurprd08.prod.outlook.com; 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) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2017 13:02:12.7349 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2053 A few math functions still use __fabs(f/l) rather than fabs, which means they won't be inlined. Rename them so they are inlined. Passes GLIBC tests on AArch64 - no calls to __fabs(f/l). Note given ldbl-128 and ldbl-128ibm already contain uses of fabsl, there is no risk of introducing localplt or namespace issues. OK for commit? ChangeLog: 2017-09-29 Wilco Dijkstra * sysdeps/ieee754/dbl-64/e_lgamma_r.c (__ieee754_lgamma_r): Use fabs rather than __fabs. * sysdeps/ieee754/dbl-64/e_log10.c (__ieee754_log10): Likewise. * sysdeps/ieee754/dbl-64/e_log2.c (__ieee754_log2): Likewise. * sysdeps/ieee754/flt-32/e_lgammaf_r.c (__ieee754_lgammaf_r): Use fabsf rather than __fabsf. * sysdeps/ieee754/flt-32/e_log10f.c (__ieee754_log10f): Likewise. * sysdeps/ieee754/flt-32/e_log2f.c (__ieee754_log2f): Likewise. * sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r): Use fabsl rather than __fabsl. * sysdeps/ieee754/ldbl-128/e_log10l.c (__ieee754_log10l): Likewise. * sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c (__ieee754_lgammal_r): Use fabsl rather than __fabsl. * sysdeps/ieee754/ldbl-128ibm/e_log10l.c (__ieee754_log10l): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l): Likewise. diff --git a/sysdeps/ieee754/dbl-64/e_lgamma_r.c b/sysdeps/ieee754/dbl-64/e_lgamma_r.c index b5860d8a2419c143022eb9d6e1e0d747cbdb3e0e..93eda99662da25f38aca82a15b11d244a67335ef 100644 --- a/sysdeps/ieee754/dbl-64/e_lgamma_r.c +++ b/sysdeps/ieee754/dbl-64/e_lgamma_r.c @@ -225,7 +225,7 @@ __ieee754_lgamma_r(double x, int *signgamp) if(hx<0) { if(__builtin_expect(ix>=0x43300000, 0)) /* |x|>=2**52, must be -integer */ - return __fabs (x)/zero; + return fabs (x)/zero; if (x < -2.0 && x > -28.0) return __lgamma_neg (x, signgamp); t = sin_pi(x); diff --git a/sysdeps/ieee754/dbl-64/e_log10.c b/sysdeps/ieee754/dbl-64/e_log10.c index dfb7d056caee5f592048559b448c899aa11e9de2..677cbc4df8739521c50a72d5ab657f438c74c129 100644 --- a/sysdeps/ieee754/dbl-64/e_log10.c +++ b/sysdeps/ieee754/dbl-64/e_log10.c @@ -65,7 +65,7 @@ __ieee754_log10 (double x) if (hx < 0x00100000) { /* x < 2**-1022 */ if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0)) - return -two54 / __fabs (x); /* log(+-0)=-inf */ + return -two54 / fabs (x); /* log(+-0)=-inf */ if (__glibc_unlikely (hx < 0)) return (x - x) / (x - x); /* log(-#) = NaN */ k -= 54; diff --git a/sysdeps/ieee754/dbl-64/e_log2.c b/sysdeps/ieee754/dbl-64/e_log2.c index 2f3da129f83dd0dc2fc7da78cfce3804febdbac5..e4a6aff9a3b5aa68c03603bf4cb8bb78507ea9c6 100644 --- a/sysdeps/ieee754/dbl-64/e_log2.c +++ b/sysdeps/ieee754/dbl-64/e_log2.c @@ -83,7 +83,7 @@ __ieee754_log2 (double x) if (hx < 0x00100000) { /* x < 2**-1022 */ if (__glibc_unlikely (((hx & 0x7fffffff) | lx) == 0)) - return -two54 / __fabs (x); /* log(+-0)=-inf */ + return -two54 / fabs (x); /* log(+-0)=-inf */ if (__glibc_unlikely (hx < 0)) return (x - x) / (x - x); /* log(-#) = NaN */ k -= 54; diff --git a/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c index 1b30dcd84d6849b0be5833a52e7ff1001f639ac7..b0baad6e14a930f9bb062d7446b80003845d497e 100644 --- a/sysdeps/ieee754/flt-32/e_lgammaf_r.c +++ b/sysdeps/ieee754/flt-32/e_lgammaf_r.c @@ -160,7 +160,7 @@ __ieee754_lgammaf_r(float x, int *signgamp) } if(hx<0) { if(ix>=0x4b000000) /* |x|>=2**23, must be -integer */ - return __fabsf (x)/zero; + return fabsf (x)/zero; if (ix > 0x40000000 /* X < 2.0f. */ && ix < 0x41700000 /* X > -15.0f. */) return __lgamma_negf (x, signgamp); diff --git a/sysdeps/ieee754/flt-32/e_log10f.c b/sysdeps/ieee754/flt-32/e_log10f.c index 86dd9b3d96b145e9de12b8c9376991bedc8a6c22..7f1ffdad771a642d9df9d245ac5062ea11aaeefb 100644 --- a/sysdeps/ieee754/flt-32/e_log10f.c +++ b/sysdeps/ieee754/flt-32/e_log10f.c @@ -34,7 +34,7 @@ __ieee754_log10f(float x) k=0; if (hx < 0x00800000) { /* x < 2**-126 */ if (__builtin_expect((hx&0x7fffffff)==0, 0)) - return -two25/__fabsf (x); /* log(+-0)=-inf */ + return -two25/fabsf (x); /* log(+-0)=-inf */ if (__builtin_expect(hx<0, 0)) return (x-x)/(x-x); /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ diff --git a/sysdeps/ieee754/flt-32/e_log2f.c b/sysdeps/ieee754/flt-32/e_log2f.c index 782d901094a95afd6d7558b75f5066a2194904e3..04ab1bbb0267a8df6052c96d353c9fa17a694448 100644 --- a/sysdeps/ieee754/flt-32/e_log2f.c +++ b/sysdeps/ieee754/flt-32/e_log2f.c @@ -43,7 +43,7 @@ __ieee754_log2f(float x) k=0; if (ix < 0x00800000) { /* x < 2**-126 */ if (__builtin_expect((ix&0x7fffffff)==0, 0)) - return -two25/__fabsf (x); /* log(+-0)=-inf */ + 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 */ diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c index a80c9eaf33eba0c1f3ba1fd2809fbca1070a5fba..5c50e4616a94e1aeedb653043d799e9133e8a90f 100644 --- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c +++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c @@ -778,7 +778,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp) q = -x; p = __floorl (q); if (p == q) - return (one / __fabsl (p - p)); + return (one / fabsl (p - p)); _Float128 halfp = p * L(0.5); if (halfp == __floorl (halfp)) *signgamp = -1; diff --git a/sysdeps/ieee754/ldbl-128/e_log10l.c b/sysdeps/ieee754/ldbl-128/e_log10l.c index c992f6e5ee3556c0febf909852495069831445dc..e8f33984f2ceec4dfcbe51696b25595e31385c00 100644 --- a/sysdeps/ieee754/ldbl-128/e_log10l.c +++ b/sysdeps/ieee754/ldbl-128/e_log10l.c @@ -187,7 +187,7 @@ __ieee754_log10l (_Float128 x) /* Test for domain */ GET_LDOUBLE_WORDS64 (hx, lx, x); if (((hx & 0x7fffffffffffffffLL) | lx) == 0) - return (-1 / __fabsl (x)); /* log10l(+-0)=-inf */ + return (-1 / fabsl (x)); /* log10l(+-0)=-inf */ if (hx < 0) return (x - x) / (x - x); if (hx >= 0x7fff000000000000LL) diff --git a/sysdeps/ieee754/ldbl-128/e_log2l.c b/sysdeps/ieee754/ldbl-128/e_log2l.c index cf4a380f16e5751a99adb6f9662295262ee5eb9b..06bf04f5e3f7d30a1ae7ebfb3b88f01398f11f65 100644 --- a/sysdeps/ieee754/ldbl-128/e_log2l.c +++ b/sysdeps/ieee754/ldbl-128/e_log2l.c @@ -181,7 +181,7 @@ __ieee754_log2l (_Float128 x) /* Test for domain */ GET_LDOUBLE_WORDS64 (hx, lx, x); if (((hx & 0x7fffffffffffffffLL) | lx) == 0) - return (-1 / __fabsl (x)); /* log2l(+-0)=-inf */ + return (-1 / fabsl (x)); /* log2l(+-0)=-inf */ if (hx < 0) return (x - x) / (x - x); if (hx >= 0x7fff000000000000LL) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c index f881b8c0a4a1dd7c065f5a3a7a4750c69140d9ea..5b628bedc18075e241695c541af74722917fa9dc 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c @@ -728,7 +728,7 @@ __ieee754_lgammal_r (long double x, int *signgamp) q = -x; p = __floorl (q); if (p == q) - return (one / __fabsl (p - p)); + return (one / fabsl (p - p)); long double halfp = p * 0.5L; if (halfp == __floorl (halfp)) *signgamp = -1; diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c index 1fbfa48e13edea258a07eb45e4aaa2ea491f307d..62e3214ca436f768e07035512dde5019ce184515 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_log10l.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_log10l.c @@ -189,7 +189,7 @@ __ieee754_log10l (long double x) xhi = ldbl_high (x); EXTRACT_WORDS64 (hx, xhi); if ((hx & 0x7fffffffffffffffLL) == 0) - return (-1.0L / __fabsl (x)); /* log10l(+-0)=-inf */ + return (-1.0L / fabsl (x)); /* log10l(+-0)=-inf */ if (hx < 0) return (x - x) / (x - x); if (hx >= 0x7ff0000000000000LL) diff --git a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c index c820dacf08478120dbcf3bf5d20df270909c2cc4..1f8b6e9d7f1c8d32ff954e3d63d2710bab28112d 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_log2l.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_log2l.c @@ -183,7 +183,7 @@ __ieee754_log2l (long double x) xhi = ldbl_high (x); EXTRACT_WORDS64 (hx, xhi); if ((hx & 0x7fffffffffffffffLL) == 0) - return (-1.0L / __fabsl (x)); /* log2l(+-0)=-inf */ + return (-1.0L / fabsl (x)); /* log2l(+-0)=-inf */ if (hx < 0) return (x - x) / (x - x); if (hx >= 0x7ff0000000000000LL)