From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114821 invoked by alias); 29 Jul 2019 18:40:09 -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 114808 invoked by uid 89); 29 Jul 2019 18:40:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=farm, Google, his, google X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jul 2019 18:40:08 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x6TIe3T5023221; Mon, 29 Jul 2019 13:40:03 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x6TIe2ep023218; Mon, 29 Jul 2019 13:40:02 -0500 Date: Mon, 29 Jul 2019 18:40:00 -0000 From: Segher Boessenkool To: Martin Jambor Cc: Tejas Joshi , Jan Hubicka , Joseph Myers , GCC Mailing List Subject: Re: Expansion of narrowing math built-ins into power instructions Message-ID: <20190729184002.GM31406@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00188.txt.bz2 Hi! On Mon, Jul 29, 2019 at 07:37:53PM +0200, Martin Jambor wrote: > as you might know, Tejas is our Google Summer of Code student working on > adding built-in functions for some new math functions added in ISO/IEC > TS 18661. > > His next step is to expand "functions rounding result to narrower type" > (so fadd, fsub and possibly fmul and fdiv described in > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2314.pdf) into ISA > instructions on targets that have such instructions. And Joseph > suggested when he proposed this project that POWER8 (and I suppose also > 9) is one of them. > > Can you please confirm this and also perhaps point Tejas to the right > pieces of power machine description and target code to emulate to > implement expansion of these functions? It would be very appreciated, > because even though me and Honza are official mentors of the project, we > are not very well versed in ppc target. I think this is refering to the "fadds" and similar Power architecture instructions, which take as inputs any single or double precision numbers, and round the result to single precision? These instructions produce a correct result also for double-precision inputs, from ISA 2.07 (POWER8 and later) on. (The result if OE=1 or UE=1 is undefined). (See 4.3.5.1 in the ISA). In GCC (in rs6000.md) we have the "*add3_fpr" and similar insns, which could be extended to allow DF inputs with an SF output; it doesn't yet allow it. gcc112 is a Power8, and gcc135 is a Power9, and Tejas does have a compile farm account already ;-) Segher