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 8C1803856DCF for ; Tue, 9 Aug 2022 21:35:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C1803856DCF 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 279LYA9w012126; Tue, 9 Aug 2022 16:34:10 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 279LYA8w012125; Tue, 9 Aug 2022 16:34:10 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 9 Aug 2022 16:34:09 -0500 From: Segher Boessenkool To: "Kewen.Lin" Cc: HAO CHEN GUI , David , Peter Bergner , gcc-patches Subject: Re: [PATCH v2, rs6000] Add multiply-add expand pattern [PR103109] Message-ID: <20220809213408.GU25951@gate.crashing.org> References: <9c7df6aa-c768-114e-4b1e-df6ce65a63b9@linux.ibm.com> <3a98158e-a26a-8e40-151d-6910782b27da@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a98158e-a26a-8e40-151d-6910782b27da@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, 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 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: Tue, 09 Aug 2022 21:35:13 -0000 On Tue, Aug 09, 2022 at 11:14:16AM +0800, Kewen.Lin wrote: > on 2022/8/8 14:04, HAO CHEN GUI wrote: > > +/* { dg-do run { target { has_arch_ppc64 } } } */ > > +/* { dg-options "-O2 -mdejagnu-cpu=power9 -save-temps" } */ > > +/* { dg-require-effective-target int128 } */ > > +/* { dg-require-effective-target p9modulo_hw } */ > > +/* { dg-final { scan-assembler-times {\mmaddld\M} 2 } } */ > > +/* { dg-final { scan-assembler-times {\mmaddhd\M} 1 } } */ > > +/* { dg-final { scan-assembler-times {\mmaddhdu\M} 1 } } */ > > + > > Maybe it's good to split this case into two, one for compiling and the other for running. > Since the generated asm is a test point here, with one separated case for compiling, we > can still have that part of test coverage on hosts which are unable to run this case. > You can move functions multiply_add and multiply_addu into one common header file, then > include it in both source files. Yeah, good point. You cannot make dg-do do different things on different targets. Fortunatelt just duplicating this test and then removing the things not relevant to run resp. compile testing makes things even more clear :-) > Nit: better to add one explicit "return 0;" to avoid possible warning. This is in main(), the C standard requires this to work without return (and it is common). But, before C99 the implicit return value from main() was undefined, so yes, it could warn then. Does it? Segher