From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128845 invoked by alias); 21 Dec 2018 19:39:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 127963 invoked by uid 89); 21 Dec 2018 19:39:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:CAO9iq9, tinyurl.com, UD:tinyurl.com, nmax X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Dec 2018 19:39:52 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gaQeD-00011t-Qz from joseph_myers@mentor.com ; Fri, 21 Dec 2018 11:39:49 -0800 Received: from digraph.polyomino.org.uk (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 21 Dec 2018 19:39:46 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.90_1) (envelope-from ) id 1gaQe9-0007FT-Pq; Fri, 21 Dec 2018 19:39:45 +0000 Date: Fri, 21 Dec 2018 20:01:00 -0000 From: Joseph Myers To: Steve Kargl CC: Janne Blomqvist , Fortran List , GCC Patches Subject: Re: [PATCH] fortran/69121 -- Make IEEE_SCALB generic In-Reply-To: <20181221193139.GA13849@troutmask.apl.washington.edu> Message-ID: References: <20181220214739.GA86993@troutmask.apl.washington.edu> <20181221062240.GA99794@troutmask.apl.washington.edu> <20181221175953.GA3659@troutmask.apl.washington.edu> <20181221193139.GA13849@troutmask.apl.washington.edu> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2018-12/txt/msg01606.txt.bz2 On Fri, 21 Dec 2018, Steve Kargl wrote: > scalbln(double x, long n) > { > > return (scalbn(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n)); > } > > A search for glibc's libm locates https://tinyurl.com/ybcy8w4t > which is a bit-twiddling routine. Not sure it's worth the > effort. Joseph Myers might have an opinion. Such comparisons are needed in the scalbn / scalbln implementations anyway to deal with large exponents. I suppose where there's a suitable scalbln implementation, and you don't know if the arguments are within the range of int, calling scalbln at least saves code size in the caller and avoids duplicating those range checks. -- Joseph S. Myers joseph@codesourcery.com