From patchwork Wed Jun 3 16:25:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco X-Patchwork-Id: 480022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 D5BA81401AF for ; Thu, 4 Jun 2015 02:25:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sourceware.org header.i=@sourceware.org header.b=XeiPQFXF; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=ojO0miENO2BHLkf0cc+C8lmmWtah7oYBDtBHwYEPg7N C5FvlnBBt59LIyoiGTsP1kYCNkO5hTO9EIkkDZBsGa2LON0puqK17dn8eteiEGN1 wIEUcoSO+e+9st37eL5ukaAPPeKSgXkT6EklZMPHw0Mf3k1EhkT2aCjFBnsssPkU = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-type:content-transfer-encoding; s=default; bh=QVGJtsVW77+OhTEq/GzLPrSpQ5g=; b=XeiPQFXFvmQNi5Joa /FYE2ymrqb2faITBxOAU9R121IjFqcXRPsY3LAifOs2OzgsSH5ppv+wkv+XtMxh0 uOF5tXJjXu2w4yBC4pcruQWboVf4F0c6AmNSjYe1JF6fagpII52fHQ0AO1/CRDpV kI/HQDjaac+862OXstcw+GCUOw= Received: (qmail 95919 invoked by alias); 3 Jun 2015 16:25:23 -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 95908 invoked by uid 89); 3 Jun 2015 16:25:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com From: "Wilco Dijkstra" To: "'Joseph Myers'" Cc: "GNU C Library" References: <000201d09e0d$fdbc6490$f9352db0$@com> <000601d09e11$f6ca4c70$e45ee550$@com> In-Reply-To: Subject: RE: [COMMITTED] Use C99 math macros Date: Wed, 3 Jun 2015 17:25:06 +0100 Message-ID: <000701d09e19$da1bcb50$8e5361f0$@com> MIME-Version: 1.0 X-MC-Unique: Ttc3UhwvQLOUiRS5JQrriQ-1 > Joseph Myers wrote: > On Wed, 3 Jun 2015, Wilco Dijkstra wrote: > > > > Joseph Myers wrote: > > > On Wed, 3 Jun 2015, Wilco Dijkstra wrote: > > > > > > > diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-finite.c b/sysdeps/ieee754/ldbl-opt/nldbl- > > > finite.c > > > > > > > - return __finite (x); > > > > + return finite (x); > > > > > > Are you sure about this change? "finite", as opposed to isfinite, is a > > > non-type-generic BSD function; I'd expect this to cause the "finite" > > > function name to be used for the call instead of __finite. (Using > > > isfinite here should be fine.) > > > > Good catch - that's a typo, I meant isfinite indeed. There are a few > > other calls to finite so I don't think it causes namespace issues: OK, committed as cbf3....9ed5: diff --git a/ChangeLog b/ChangeLog index 987e71f..33d9f66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2015-06-03 Wilco Dijkstra + * sysdeps/ieee754/ldbl-128ibm/s_fmal.c (__fmal): Replace finite with + isfinite. + * sysdeps/ieee754/ldbl-96/s_fma.c (__fma): Likewise. + * sysdeps/ieee754/ldbl-opt/nldbl-finite.c (__finitel): Likewise. + +2015-06-03 Wilco Dijkstra + * math/e_exp10.c: Replace __isinf*, __isnan*, __finite* and __signbit* with standard C99 macros. * math/e_exp10l.c: Likewise. diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c index 1c15e7e..837444a 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_fmal.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_fmal.c @@ -26,7 +26,7 @@ __fmal (long double x, long double y, long double z) /* An IBM long double 128 is really just 2 IEEE64 doubles, and in * the case of inf/nan only the first double counts. So we use the * (double) cast to avoid any data movement. */ - if ((finite ((double)x) && finite ((double)y)) && isinf ((double)z)) + if ((isfinite ((double)x) && isfinite ((double)y)) && isinf ((double)z)) return (z); /* If z is zero and x are y are nonzero, compute the result diff --git a/sysdeps/ieee754/ldbl-96/s_fma.c b/sysdeps/ieee754/ldbl-96/s_fma.c index 19736ef..8fd238c 100644 --- a/sysdeps/ieee754/ldbl-96/s_fma.c +++ b/sysdeps/ieee754/ldbl-96/s_fma.c @@ -34,7 +34,7 @@ __fma (double x, double y, double z) { /* If z is Inf, but x and y are finite, the result should be z rather than NaN. */ - if (finite (x) && finite (y)) + if (isfinite (x) && isfinite (y)) return (z + x) + y; return (x * y) + z; } diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-finite.c b/sysdeps/ieee754/ldbl-opt/nldbl-finite.c index af96238..fc51508 100644 --- a/sysdeps/ieee754/ldbl-opt/nldbl-finite.c +++ b/sysdeps/ieee754/ldbl-opt/nldbl-finite.c @@ -4,7 +4,7 @@ int attribute_hidden __finitel (double x) { - return finite (x); + return isfinite (x); } extern __typeof (__finitel) finitel attribute_hidden; weak_alias (__finitel, finitel)