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 D536539484B6; Mon, 5 Dec 2022 19:40:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D536539484B6 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 2B5JdiGp008333; Mon, 5 Dec 2022 13:39:44 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 2B5JdhZZ008332; Mon, 5 Dec 2022 13:39:43 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 5 Dec 2022 13:39:43 -0600 From: Segher Boessenkool To: Jiufu Guo Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, rguenther@suse.de, jeffreyalaw@gmail.com Subject: Re: [PATCH 3/3] Testcases for move sub blocks on param and ret Message-ID: <20221205193943.GX25951@gate.crashing.org> References: <20221129134507.185951-1-guojiufu@linux.ibm.com> <20221129134507.185951-3-guojiufu@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221129134507.185951-3-guojiufu@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.0 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 List-Id: Hi! Some comments on the testcases: On Tue, Nov 29, 2022 at 09:45:07PM +0800, Jiufu Guo wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr65421-1.c > @@ -0,0 +1,25 @@ > +/* PR target/65421 */ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > +/* { dg-require-effective-target powerpc_elfv2 } */ > + > +typedef struct SA > +{ > + double a[3]; > + long l; > +} A; > + > +/* 2 vec load, 2 vec store. */ > +A ret_arg_pt (A *a){return *a;} > + > +/* 4 std */ > +A ret_arg (A a) {return a;} > + > +/* 4 std */ > +void st_arg (A a, A *p) {*p = a;} > + > +/* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxv\M|\mlvx\M} 2 } } */ > +/* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstxv\M|\mstvx\M} 2 } } */ > +/* { dg-final { scan-assembler-times {\mstd\M} 8 } } */ You need at least ISA 2.06 (power7) to have {l,st}xvd2x, and elfv2 does not guarantee that. Have you tested on something old as well (say 970) to see if the lvx/stvx is generated as expected? For that you need to have AltiVec enabled as well, so dg-require that? > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr65421.c > @@ -0,0 +1,22 @@ > +/* PR target/65421 */ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > +/* { dg-require-effective-target powerpc_elfv2 } */ > + > +typedef struct SA > +{ > + double a[3]; > +} A; > + > +/* 3 lfd */ > +A ret_arg_pt (A *a){return *a;} > + > +/* blr */ > +A ret_arg (A a) {return a;} > + > +/* 3 stfd */ > +void st_arg (A a, A *p) {*p = a;} > + > +/* { dg-final { scan-assembler-times {\mlfd\M} 3 } } */ > +/* { dg-final { scan-assembler-times {\mstfd\M} 3 } } */ > +/* { dg-final { scan-assembler-times {(?n)^\s+[a-z]} 9 } } */ Comment that last one? Just something as simple as "count insns" is enough :-) Segher