From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id CD38C3858C2C for ; Fri, 26 May 2023 15:03:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD38C3858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 34QF2Tih032620; Fri, 26 May 2023 10:02:29 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 34QF2SqB032619; Fri, 26 May 2023 10:02:28 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 26 May 2023 10:02:28 -0500 From: Segher Boessenkool To: Michael Meissner , gcc-patches@gcc.gnu.org, "Kewen.Lin" , David Edelsohn , Peter Bergner Subject: Re: [PATCH V5, 2/2] PR target/105325: Fix memory constraints for power10 fusion. Message-ID: <20230526150228.GN19790@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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, May 10, 2023 at 11:40:00AM -0400, Michael Meissner wrote: > This patch applies stricter predicates and constraints for LD and LWA > instructions with power10 fusion. These instructions are DS-form instructions, > which means that the bottom 2 bits of the address must be 0. The low two bits of the offset, yes. > --- a/gcc/config/rs6000/genfusion.pl > +++ b/gcc/config/rs6000/genfusion.pl > @@ -129,6 +129,12 @@ sub print_ld_cmpi_p10 > print " \"\"\n"; > print " [(set_attr \"type\" \"fused_load_cmpi\")\n"; > print " (set_attr \"cost\" \"8\")\n"; > + > + if ($extend eq "sign") > + { > + print " (set_attr \"sign_extend\" \"yes\")\n"; > + } You never ever need backslashes like this in Perl code, btw. For example: print qq{ (set_attr "sign_extend" "yes")\n}; or print qq/ (set_attr "sign_extend" "yes")\n/; or print <<"HERE" (set_attr "sign_extend" "yes") HERE or millions of other ways, all of which are much nicer than cramped code that tries to look like C (but has very different semantics in all ways that matter). (Also zillions of ways that are worse still, but that is the price of freedom maybe :-) ) > - # Memory predicate to use. > + # Memory predicate to use. For LWA, use the special LWA_OPERAND. Explain *why*? It is obvious *what*! Maybe just split the series into more patches? > @@ -0,0 +1,26 @@ > +/* { dg-do assemble } */ > +/* { dg-require-effective-target lp64 } */ > +/* { dg-require-effective-target power10_ok } */ power10_ok should no longer exist, btw. Technical debt has to be repaid :-/ This patch is readable btw. Thanks :-) Segher