From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124437 invoked by alias); 24 Jul 2019 16:23:58 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 124429 invoked by uid 89); 24 Jul 2019 16:23:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=ISA, HX-Languages-Length:1123 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; Wed, 24 Jul 2019 16:23:57 +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 1hqK3S-0002xm-0C from joseph_myers@mentor.com ; Wed, 24 Jul 2019 09:23:50 -0700 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; Wed, 24 Jul 2019 17:23:46 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.90_1) (envelope-from ) id 1hqK3N-0007RD-Af; Wed, 24 Jul 2019 16:23:45 +0000 Date: Wed, 24 Jul 2019 16:23:00 -0000 From: Joseph Myers To: Tejas Joshi CC: , Martin Jambor , Subject: Re: [GSoC-19] Implementing narrowing functions like fadd In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2019-07/txt/msg00167.txt.bz2 On Tue, 23 Jul 2019, Tejas Joshi wrote: > Also, CASE_MATHFN and CASE_MATHFN_FLOATN cases in builtins.c expand > normal, F and L variants which are assigned to respective fcode > built_in_function. This makes any function defined in builtins.def to > have F and L variants mandatory. How these narrowing functions are > supposed to be handled? Do we define another macro expansion like > CASE_MATHFN or have a manual case handling in mathfn_built_in_2? > Attached patch is what I have tried so far. You'll need something different from CASE_MATHFN - these are a different kind of functions that need handling in a different way, because they are parametrized over certain *pairs* of types, rather than over a single type. (The main case for these being built-in is probably not folding for constant arguments - it's generating appropriate instructions when building with -fno-math-errno for processors that have appropriate narrowing instructions, such as Power ISA 2.07 or later, which I think means POWER8 or later.) -- Joseph S. Myers joseph@codesourcery.com