From patchwork Wed Sep 19 09:19:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 29462 Received: (qmail 97856 invoked by alias); 19 Sep 2018 09:19:30 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 97393 invoked by uid 89); 19 Sep 2018 09:19:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WqkYdGG2qGgMc1lewd1/PEjNb2zdGxDavMy5h2oJtZQ=; b=Kb0bzp27zE+z6tw0B1OKkwZBu1tyflGOORl0tqGPwAf/4uuM8Kby4O8mQ+MUVh6cOfz1zkeAyx7dpZenZj3njAgBjVPxXcmktky3Zv8XoQvSaTwGpXZ0GAyX0dHOueSqBoYZuX3tzGkI26+Mxr2sRNxjY/2dEv+8gOXI3/QlxVg= Cc: nd@arm.com, GNU C Library Subject: Re: [PATCH 3/3] Add new pow implementation To: Joseph Myers References: <391ac2f9-9ee4-ac23-b791-09f0438c2b91@arm.com> From: Szabolcs Nagy Message-ID: Date: Wed, 19 Sep 2018 10:19:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Return-Path: szabolcs.nagy@arm.com Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs.Nagy@arm.com; On 17/09/18 23:19, Joseph Myers wrote: > On Tue, 11 Sep 2018, Szabolcs Nagy wrote: > >> +/* Returns 0 if not int, 1 if odd int, 2 if even int. */ >> +static inline int >> +checkint (uint64_t iy) > > The comment needs to explain that this function is not called with an > argument representing floating-point 0, Inf or NaN (since it wouldn't be > correct for 0 at least). > > OK with that change. > Thanks for the reviews, i committed the patch and separately fixed the comment in powf too in the same way with the attached obvious patch. From d734727837b5135c4c4c540d8c53e5a06aa7556a Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 19 Sep 2018 10:09:41 +0100 Subject: [PATCH] Fix the documentation comment of checkint in powf checkint in powf is not supposed to be used with 0, inf or nan inputs. * sysdeps/ieee754/flt-32/e_powf.c (checkint): Fix documentation. --- ChangeLog | 4 ++++ sysdeps/ieee754/flt-32/e_powf.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 57ba532bd6..cecbdf4985 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-09-19 Szabolcs Nagy + + * sysdeps/ieee754/flt-32/e_powf.c (checkint): Fix documentation. + 2018-09-19 Szabolcs Nagy * NEWS: Mention pow improvements. diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c index ece83f0dd2..d0c912188f 100644 --- a/sysdeps/ieee754/flt-32/e_powf.c +++ b/sysdeps/ieee754/flt-32/e_powf.c @@ -118,7 +118,8 @@ exp2_inline (double_t xd, uint32_t sign_bias) return y; } -/* Returns 0 if not int, 1 if odd int, 2 if even int. */ +/* Returns 0 if not int, 1 if odd int, 2 if even int. The argument is + the bit representation of a non-zero finite floating-point value. */ static inline int checkint (uint32_t iy) { -- 2.14.1