From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13365 invoked by alias); 1 Nov 2017 00:26:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 13351 invoked by uid 89); 1 Nov 2017 00:26:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=Patrick, accordance, yyy, letter X-HELO: relay1.mentorg.com Date: Wed, 01 Nov 2017 00:26:00 -0000 From: Joseph Myers To: Patrick McGehearty CC: Subject: Re: [PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86. In-Reply-To: <1509058396-11819-1-git-send-email-patrick.mcgehearty@oracle.com> Message-ID: References: <1509058396-11819-1-git-send-email-patrick.mcgehearty@oracle.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-SW-Source: 2017-11/txt/msg00000.txt.bz2 On Thu, 26 Oct 2017, Patrick McGehearty wrote: > + /* > + Use FE_TONEAREST rounding mode for computing yy.y > + Avoid set/reset of rounding mode if already in FE_TONEAREST mode > + */ Generally, throughout this patch, note GNU standard comment formatting. Sentences should end with "." (and, for other comments, start with a capital letter). No blank line at the top of this comment, or at the end. So /* Use FE_TONEAREST rounding mode for computing yy.y. Avoid set/reset of rounding mode if already in FE_TONEAREST mode. */ (appropriately indented) would be a properly formatted version of this comment. > + if (-xx.x > threshold2) > + { /* set underflow error condition */ > + double force_underflow = tiny * tiny; > + math_force_eval (force_underflow); > + retval = zero; > + return retval; As previously noted, I'd expect force_underflow to be the value returned in this case, not zero, as that's proper (in accordance with glibc's accuracy goals for underflowing values) in FE_UPWARD mode. > +static const double TBL[64] = { > + 0x1.0000000000000p+0, 0x0.0000000000000p+0, > + 0x1.059b0d3158574p+0, 0x1.d73e2a475b465p-55, There should be a comment on the TBL array explaining what the values in it are, like the comment on TBL2. > +/* maximum value for -x to not underflow */ > + threshold2 = 0x1.74910d52d3051p+9, /* 7.45133219101941108420e+02 */ I think you mean not to underflow *to zero in round-to-nearest mode* (since some less-negative values would still result in underflow, but with the result being subnormal not zero). -- Joseph S. Myers joseph@codesourcery.com