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 8A28D3858C3A for ; Wed, 15 Dec 2021 02:12:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A28D3858C3A 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 1BF2B97n005479; Tue, 14 Dec 2021 20:11:09 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 1BF2B9pS005478; Tue, 14 Dec 2021 20:11:09 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 14 Dec 2021 20:11:08 -0600 From: Segher Boessenkool To: Roger Sayle Cc: "'GCC Patches'" Subject: Re: [PATCH take #2] PR target/43892: Some carry flag (CA) optimizations on PowerPC. Message-ID: <20211215021108.GJ614@gate.crashing.org> References: <03ae01d7e87d$f67f1a80$e37d4f80$@nextmovesoftware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03ae01d7e87d$f67f1a80$e37d4f80$@nextmovesoftware.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 15 Dec 2021 02:12:12 -0000 Hi! On Fri, Dec 03, 2021 at 07:42:52PM -0000, Roger Sayle wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/addcmp.c > @@ -0,0 +1,12 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > + > +unsigned long add_leu(unsigned long a, unsigned long b, unsigned long c) { > + return a + (b <= c); > +} > + > +unsigned long add_geu(unsigned long a, unsigned long b, unsigned long c) { > + return a + (b >= c); > +} > + > +/* { dg-final { scan-assembler-times "addze " 2 } } */ Does this work with -mcpu=power10 after your patch? (It doesn't before it :-) ) > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr43892.c > @@ -0,0 +1,11 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > +unsigned long foo(unsigned long sum, unsigned long x) > +{ > + unsigned long z = sum + x; > + if (sum + x < x) > + z++; > + return z; > +} > + > +/* { dg-final { scan-assembler "addze " } } */ Same question here. Thanks! Segher