From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86135 invoked by alias); 30 Aug 2019 20:35:34 -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 86127 invoked by uid 89); 30 Aug 2019 20:35:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=DADDL, faddl, H*f:sk:ri6h867, ieee128 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; Fri, 30 Aug 2019 20:35:33 +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 x7UKZQLV000946; Fri, 30 Aug 2019 15:35:27 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x7UKZPoi000945; Fri, 30 Aug 2019 15:35:25 -0500 Date: Fri, 30 Aug 2019 20:35:00 -0000 From: Segher Boessenkool To: Tejas Joshi Cc: gcc@gcc.gnu.org, joseph@codesourcery.com, Martin Jambor Subject: Re: Expansion of narrowing math built-ins into power instructions Message-ID: <20190830203525.GS31406@gate.crashing.org> References: <20190822062503.GI31406@gate.crashing.org> <20190822095620.GK31406@gate.crashing.org> <20190825164717.GO31406@gate.crashing.org> <20190826074211.GQ31406@gate.crashing.org> 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-08/txt/msg00238.txt.bz2 > > > > [ Please don't top-post ] (I delete everything under your signature, without looking, assuming you just forgot to). On Sat, Aug 31, 2019 at 12:48:42AM +0530, Tejas Joshi wrote: > > For ISA 2.07 (Power 8) you don't have IEEE128 at all, not in hardware > > that is. I don't know if we'll want fadd support in the emulation > > libraries ever; don't worry about it for now, anyway. > > What instructions would need to be expanded for FADDL (long double to > float) and DADDL (long double to double) on power8 (ISA 2.07) and > power9 (ISA 3.0) respectively, along with VSX? (Just as we expanded > FADD to fadds and xsaddsp for vsx). If long double is double, faddl is the same as fadd, and daddl is just normal addition. If long double is double-double, faddl can be done as fadd on the first double precision component of both args, and daddl is just normal addition of those. If long double is IEEE QP, then it is more interesting :-) daddl is xsaddqpo # add qp, with round to odd xscvqpdp # convert qp to dp faddl is xsaddqpo # add qp, with round to odd xscvqpdpo # convert qp to dp, with round to odd xsrsp # convert dp to sp (single precision numbers are stored in double precision format, but this is rounded as single precision) fadds is fadds ; :-) or xsaddsp Both faddl and daddl are the sequences for Power9. There are no instructions for QP format on Power8; see libgcc/config/rs6000/t-float128 for how support for the emulation QP math is built, if you are interested. Segher