From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88089 invoked by alias); 14 Sep 2017 19:02:50 -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 87360 invoked by uid 89); 14 Sep 2017 19:02:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Sep 2017 19:02:48 +0000 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8EIwd29104042 for ; Thu, 14 Sep 2017 15:02:46 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cyur8n39q-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 14 Sep 2017 15:02:45 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Sep 2017 13:02:45 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 14 Sep 2017 13:02:43 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8EJ2X5k63045880; Thu, 14 Sep 2017 12:02:42 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B0C1C6037; Thu, 14 Sep 2017 13:02:42 -0600 (MDT) Received: from ibm-tiger.the-meissners.org (unknown [9.32.77.111]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 6957AC604A; Thu, 14 Sep 2017 13:02:42 -0600 (MDT) Received: by ibm-tiger.the-meissners.org (Postfix, from userid 500) id B921B43A66; Thu, 14 Sep 2017 15:02:41 -0400 (EDT) Date: Thu, 14 Sep 2017 19:02:00 -0000 From: Michael Meissner To: Joseph Myers Cc: Michael Meissner , GCC Patches , Segher Boessenkool , David Edelsohn , Bill Schmidt Subject: Re: [PATCH], Add support for __builtin_{sqrt,fma}f128 on PowerPC ISA 3.0 Mail-Followup-To: Michael Meissner , Joseph Myers , GCC Patches , Segher Boessenkool , David Edelsohn , Bill Schmidt References: <20170913214600.GA24598@ibm-tiger.the-meissners.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17091419-0004-0000-0000-000012EC7C5B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007734; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000227; SDB=6.00917024; UDB=6.00460552; IPR=6.00697251; BA=6.00005589; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017155; XFM=3.00000015; UTC=2017-09-14 19:02:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091419-0005-0000-0000-0000841765B6 Message-Id: <20170914190241.GA16163@ibm-tiger.the-meissners.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-14_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709140285 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00931.txt.bz2 On Wed, Sep 13, 2017 at 10:49:43PM +0000, Joseph Myers wrote: > On Wed, 13 Sep 2017, Michael Meissner wrote: > > > This patch adds support on PowerPC ISA 3.0 for the built-in function > > __builtin_sqrtf128 generating the XSSQRTQP hardware square root instruction and > > the built-in function __builtin_fmaf128 generating XSMADDQP, XSMSUBQP, > > XSNMADDQP, and XSNMSUBQP fused multiply-add instructions. > > Is there a reason for these to be architecture-specific rather than > generic everywhere _Float128 is supported? (With the fmaf128 / sqrtf128 > names available as well as the __builtin_* variants of those.) I wanted to get in the PowerPC stuff ASAP, so the library people can start using it. I do think for at least some of the built-ins (sqrt, fma, lrint, etc.) it makes sense, and at some point I was going to look at it. In the grand scheme of things, it is only a temporary measure, and the real end goal is to enable switching long double to be float128. However, that will take multiple releases to get there. > Full support for _FloatN/_FloatNx variants of all the existing built-in > functions might be complicated, and run into potential issues with startup > cost of creating large numbers of extra built-in functions (it's > desirable, but possibly hard, which is why I excluded it from the initial > _FloatN / _FloatNx support patches). But adding just these two functions > to builtins.def and making them fold / expand appropriately ought to be > much simpler. (I realise sqrt goes through internal-fn.def and > DEF_INTERNAL_FLT_FN expects a particular set of functions for standard > types, so maybe some duplication would be involved to get the built-in > function expanded appropriately, i.e. using an insn pattern or a call to > an external sqrtf128 function according to whether such an insn pattern is > available. fma ought not to involve much more than adding an extra case > where CASE_FLT_FN (BUILT_IN_FMA) is used.) Yeah, but I wanted to get the easy stuff in there right now before looking at the machine independent support. > > While I was at it, I changed the documentation so that it no longer documents > > the 'q' built-in functions (to mirror libquadmath) but instead just documented > > the 'f128' functions that matches glibc 2.26 and the technical report that > > added the _FloatF128 date. > > Those *f128 built-in functions (inf / huge_val / nan / nans / fabs / > copysign) are not target-specific; they exist for all _FloatN / _FloatNx > types for all targets with such types. So it doesn't seem appropriate to > document them in a target-specific section of the manual, beyond a brief > cross-reference to the documentation of the functions as > target-independent. Right now we just document a few of the 'q' functions that were added before you added the f128 versions. I was trying to harmonize things. Originally, I was going to make both __builtin_sqrtq and __builtin_sqrtf128, but Segher and David didn't want that. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797