From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 26BB43857C62 for ; Wed, 30 Sep 2020 07:02:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 26BB43857C62 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rguenther@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D8836ABAD; Wed, 30 Sep 2020 07:02:34 +0000 (UTC) Date: Wed, 30 Sep 2020 09:02:34 +0200 (CEST) From: Richard Biener Sender: rguenther@c653.arch.suse.de To: Segher Boessenkool cc: gcc-patches@gcc.gnu.org, joseph@codesourcery.com, ". Jakub Jelinek" , Richard Sandiford Subject: Re: [PATCH v2] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193] In-Reply-To: <20200929233806.GW28786@gate.crashing.org> Message-ID: References: <20200904155230.nyssphhldu47hbve@work-tp> <20200929233806.GW28786@gate.crashing.org> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 07:02:37 -0000 On Tue, 29 Sep 2020, Segher Boessenkool wrote: > Hi Raoni, > > Some of this isn't an rs6000 patch, but the subject says it is, so it > might well not draw the attention it needs. > > Adding some Cc:s. > > On Fri, Sep 04, 2020 at 12:52:30PM -0300, Raoni Fassina Firmino wrote: > > There is one pending question raised by Segher, It is about adding > > documentation, I am not sure if it is needed and if so, where it > > should be. I will quote the relevant part of the conversation[2] from > > the v1 thread for context: > > > > > > > +OPTAB_D (fegetround_optab, "fegetround$a") > > > > > +OPTAB_D (feclearexcept_optab, "feclearexcept$a") > > > > > +OPTAB_D (feraiseexcept_optab, "feraiseexcept$a") > > > >? > > > > Should those be documented somewhere? (In gcc/doc/ somewhere). > > > > > > I am lost on that one. I took a look on the docs (I hope looking on the > > > online docs was good enough) and I didn't find a place where i feel it > > > sits well. On the PowerPC target specific sections (6.60.22 Basic > > > PowerPC Built-in Functions), I didn't found it mentioning builtins that > > > are optimizations for the standard library functions, but we do have > > > many of these for Power. Then, on the generic section (6.59 Other > > > Built-in Functions Provided by GCC) it mentions C99 functions that have > > > builtins but it seems like it mentions builtins that have target > > > independent implementation, or at least it dos not say that some > > > builtins may be implemented on only some targets. And in this case > > > there is no implementation (for now) for any other target that is not > > > PowerPc. > > > > > > So, I don't know if or where this should be documented. > > I don't see much about optabs in the docs either. Add some text to > optabs.def itself then? All optabs are documented in doc/md.texi as 'instruction patterns' This is where new optabs need to be documented. > > +(define_expand "feclearexceptsi" > > + [(use (match_operand:SI 1 "const_int_operand" "n")) > > + (set (match_operand:SI 0 "gpc_reg_operand") > > + (const_int 0))] > > + "TARGET_HARD_FLOAT" > > +{ > > + switch (INTVAL (operands[1])) > > + { > > + case 0x2000000: /* FE_INEXACT */ > > + case 0x4000000: /* FE_DIVBYZERO */ > > + case 0x8000000: /* FE_UNDERFLOW */ > > + case 0x10000000: /* FE_OVERFLOW */ > > Please write 0x02000000 etc. instead? > > > +;; int fegraiseexcept(int excepts) > > (typo) > > > +/* { dg-do run } */ > > +/* { dg-require-effective-target fenv_exceptions } */ > > +/* { dg-options "-lm -fno-builtin" } */ > > That -fno-builtin looks very strange... Comment what it is for? > > > +#define FAIL(v, e) printf("ERROR, __builtin_fegetround() returned %d," \ > > + " not the expecected value %d\n", v, e); > > (Typo, "expected") > > The rs6000 part is okay for trunk (with those modifications), after the > generic parts is approved. Thanks! > > > Segher > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imend