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 3470038582A5 for ; Mon, 1 Aug 2022 17:24:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3470038582A5 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 271HN1LT011186; Mon, 1 Aug 2022 12:23:01 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 271HN1vR011182; Mon, 1 Aug 2022 12:23:01 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 1 Aug 2022 12:23:00 -0500 From: Segher Boessenkool To: "Kewen.Lin" Cc: HAO CHEN GUI , David , Peter Bergner , gcc-patches Subject: Re: [PATCH, rs6000] Add multiply-add expand pattern [PR103109] Message-ID: <20220801172300.GG25951@gate.crashing.org> References: <5a55cacd-539d-e3d6-3b3d-c7c30a76a564@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a55cacd-539d-e3d6-3b3d-c7c30a76a564@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Mon, 01 Aug 2022 17:24:03 -0000 On Mon, Aug 01, 2022 at 02:19:32PM +0800, Kewen.Lin wrote: > > new file mode 100644 > > index 00000000000..256e05d5677 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.target/powerpc/pr103109.c > > @@ -0,0 +1,16 @@ > > +/* { dg-do compile { target { lp64 } } } */ > > Since the guard is TARGET_POWERPC64, should use has_arch_ppc64? Yes, we should almost never have lp64 in testcases anymore, since now we have has_arch_ppc64. Previously we had only has_powerpc64, which is a very different thing unfortunately. > > +/* { dg-require-effective-target powerpc_p9modulo_ok } */ > > Need effective target int128 as well? Yes. This was hidden by the lp64 test, which skips on -m32 already :-) > > +/* { dg-options "-mdejagnu-cpu=power9 -O2" } */ > > +/* { dg-final { scan-assembler-times {\mmaddld\M} 2 } } */ > > +/* { dg-final { scan-assembler-times {\mmaddhd\M} 1 } } */ > > +/* { dg-final { scan-assembler-times {\mmaddhdu\M} 1 } } */ > > + > > +__int128 test (long a, long b, long c) > > +{ > > + return (__int128) a * (__int128) b + (__int128) c; > > +} > > + > > +unsigned __int128 testu (unsigned long a, unsigned long b, unsigned long c) > > +{ > > + return (unsigned __int128) a * (unsigned __int128) b + (unsigned __int128) c; > > +} (You only need to cast the first here always, the rest is promoted automatically). > Not sure there is some coverage for this kind of multiply-add (promoted first > then mul and add), if no, it seems better to add one runnable test case. Good point. We won't automatically see it from the compiler build itself for example, int128 isn't used there. Segher