From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21865 invoked by alias); 21 Dec 2018 15:50:01 -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 21827 invoked by uid 89); 21 Dec 2018 15:50:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*f:CAO9iq9Hch7, H*i:sk:6LQ@mai, H*f:sk:rLFOfYZ, H*f:sk:6LQ@mai X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Dec 2018 15:49:58 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id wBLFnugY002966 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 21 Dec 2018 07:49:56 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id wBLFnuf8002965; Fri, 21 Dec 2018 07:49:56 -0800 (PST) (envelope-from sgk) Date: Fri, 21 Dec 2018 15:55:00 -0000 From: Steve Kargl To: Janne Blomqvist Cc: Fortran List , GCC Patches Subject: Re: [PATCH] fortran/69121 -- Make IEEE_SCALB generic Message-ID: <20181221154956.GB2819@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20181220214739.GA86993@troutmask.apl.washington.edu> <20181221062240.GA99794@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2018-12/txt/msg01576.txt.bz2 On Fri, Dec 21, 2018 at 11:07:08AM +0200, Janne Blomqvist wrote: > On Fri, Dec 21, 2018 at 8:22 AM Steve Kargl < > sgk@troutmask.apl.washington.edu> wrote: > > > On Thu, Dec 20, 2018 at 01:47:39PM -0800, Steve Kargl wrote: > > > The attached patch has been tested on x86_64-*-freebsd. > > > > > > OK to commit? > > > > > > 2018-12-20 Steven G. Kargl > > > > > > PR fortran/69121 > > > * libgfortran/ieee/ieee_arithmetic.F90: Provide missing functions > > > in interface for IEEE_SCALB. > > > > > > 2018-12-20 Steven G. Kargl > > > > > > PR fortran/69121 > > > * gfortran.dg/ieee/ieee_9.f90: New test. > > > > Now, tested on i586-*-freebsd. > > > > Hi, looks ok for trunk. > > A few questions popped into my mind while looking into this: > > 1) Why are none of the _gfortran_ieee_scalb_X_Y functions mentioned in > gfortran.map? I guess they should all be there? > > 2) Currently all the intrinsics map to the scalbn{,f,l} builtins. However, > when the integer argument is of kind int64 or int128 we should instead use > scalbln{,f,l}. This also applies to other intrinsics that use scalbn under > the hood. > > To clarify, fixing these is not a prerequisite for accepting the patch (I > already accepted it), but more like topics for further work. Just, sent shorter note in private email to Thomas. No, I'm adding the missing functions to the INTERFACE. This will not compile: program foo use ieee_arithmetic real x integer(8) i x = 2 i = 2_8 print *, ieee_scalb(x,i) end program because the module has a generic interface that does not include the integer(8) argument. FX seems to have wanted to avoid the explosion of functions in the library. In trans-intrinsic.c (conv_intrinsic_ieee_scalb), he does a conversion of the integer(8) to an integer(4). Unfortunately, checking the interface for ieee_scalb occurs before code generation. Compiling the above after my patch, the -ftree-dump-original contains D.3769 = __builtin_scalbnf (x, (integer(kind=4)) MAX_EXPR , -2147483647>); -- Steve