From patchwork Mon Dec 4 16:59:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 24711 Received: (qmail 66454 invoked by alias); 4 Dec 2017 16:59:16 -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 66445 invoked by uid 89); 4 Dec 2017 16:59:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Mon, 4 Dec 2017 16:59:10 +0000 From: Joseph Myers To: Subject: Use __floor not floor in sinf [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) The new sinf implementation introduced localplt failures for all platforms where the compiler did not inline the calls to floor (converted to trunc by machine-independent optimizations). This patch changes the calls to use __floor as normal in libm. We can't use the public function names floor / floorf / floorl / floorf128 in libm code in the absence of appropriate asms to redirect floor/trunc calls, if not inlined, to use the internal names instead (while avoiding breaking code building the floor functions themselves) - while having such asms and then calling the public functions unconditionally would be desirable for optimization (few architectures have __floor inlines in math_private.h, and once the built-in function is used you don't need them), using __floor is the minimum safe fix for the present test regressions. Tested with build-many-glibcs.py that this fixes the localplt test failure for arm-linux-gnueabi. Committed. 2017-12-04 Joseph Myers * sysdeps/ieee754/flt-32/s_sinf.c (SINF_FUNC): Use __floor instead of floor. diff --git a/sysdeps/ieee754/flt-32/s_sinf.c b/sysdeps/ieee754/flt-32/s_sinf.c index f03dba4..40d3d19 100644 --- a/sysdeps/ieee754/flt-32/s_sinf.c +++ b/sysdeps/ieee754/flt-32/s_sinf.c @@ -177,8 +177,8 @@ SINF_FUNC (float x) { if (abstheta < 0x1p+23) /* |x| < 2^23. */ { - unsigned long int n = floor (abstheta * inv_PI_4) + 1.0; - double x = floor (n / 2.0); + unsigned long int n = __floor (abstheta * inv_PI_4) + 1.0; + double x = __floor (n / 2.0); theta = x * PI_2_lo + (x * PI_2_hi + abstheta); /* Argument reduction needed. */ return reduced (theta, n, signbit);