Message ID | 20221129134507.185951-3-guojiufu@linux.ibm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp344878wrr; Tue, 29 Nov 2022 05:46:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EtD8Cn9RfaA4NhfqKzIC1Ywh0ppOHfKPYHeuUXsqtG093uEBHueQIdXVqwTwajI2RiFPw X-Received: by 2002:a05:6402:910:b0:468:74:9668 with SMTP id g16-20020a056402091000b0046800749668mr33977927edz.394.1669729618192; Tue, 29 Nov 2022 05:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669729618; cv=none; d=google.com; s=arc-20160816; b=gbRAyrYv4+mxoo7w22KVqDj3W9kLbY2KVs01iHRR3b1pKo7jQFcFejBkYe8kCIYFrh VJI4fXwQq4hxnslsdltooe0AAf5q7TZ4Pa3zTw/tNCmdfVse1zKvtLZ7nkaU7lL7XwfG iNmDeSR8ztboWHO683y5stAZDZczUv8I4Xt4XVpqnZnrT8zGfhsiFoi6XeyGt2IgkPWV yfyv2+6dcWPfTdcaHgBXLzvcy17v2cAa7Vc8N2Dz4TGe2IikCVH/su3Gm6MOFKwG2jco Thu7Ij2I6FTdv+Ixo3aiLNrvLey2Auny6+K/n8vpJ0Yixdu1MNS5pbplMPMBgv+8jZ/B aQXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=/AuYn9z4ZLwsPf72UTPZsmOUYm9vC8saYjhMf7Z6Egk=; b=QPBmuK/+igpEXH4/Q4pcWrW8TK/xvPdfw/JkKlnhuXybRWFLLiDO+L5jorWkjPIXiN lRAmRhCXtR5CDh0EOCBCG00IUDuHxOlPW6PKBcX+aLFas4UyxjOhrZBWsc3iM3M/u2Gp P6Gs8JR9HZHxDL/PI7xVTqZggvVfH7rBChjZ4vyOGWHVubhGdrgePEzMoBOAdLOW4k8E fFQTqSQ83yg9m/Fr/PNo+iRg025ekX20rv0J7eJq6SF2Ae6K5K7j2V/mAgtRK3fsYIFg 7ndmm8x1mx2t3DPw8onCkgsN+cfsdIiqhWABO6P7HPD0eDnf6Rr9cJ/5VMKGcyxuniDC 6zRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ocYjTrF5; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id dd18-20020a1709069b9200b00780805b99ccsi12249385ejc.648.2022.11.29.05.46.58 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 05:46:58 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ocYjTrF5; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 073A03858412 for <ouuuleilei@gmail.com>; Tue, 29 Nov 2022 13:46:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 073A03858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669729617; bh=/AuYn9z4ZLwsPf72UTPZsmOUYm9vC8saYjhMf7Z6Egk=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ocYjTrF5b5MwkJajUHfVplaPCmXjI8JOCi1w5Czuat4pw/brGI3OqIYSXBVUVQ6uz JWi9h8SKH9oqju1flTEjiEk0WVNArViB2UKtXEyfQzCDjlXJO7IQsp03c02+iGAvEX DPaPeAPSlojMsmceM5Ki1IOkJpqmkCl3DMicbQ+Q= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 5F0F93857C43; Tue, 29 Nov 2022 13:45:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F0F93857C43 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ATCmT07016211; Tue, 29 Nov 2022 13:45:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m5jdnsndb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 13:45:16 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2ATCmmba016696; Tue, 29 Nov 2022 13:45:16 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m5jdnsncj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 13:45:16 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2ATD5EQQ007581; Tue, 29 Nov 2022 13:45:13 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma05fra.de.ibm.com with ESMTP id 3m3ae9b06c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 13:45:13 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2ATDchII14746226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Nov 2022 13:38:43 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DADE42042; Tue, 29 Nov 2022 13:45:11 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3161642041; Tue, 29 Nov 2022 13:45:10 +0000 (GMT) Received: from pike.rch.stglabs.ibm.com (unknown [9.5.12.127]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 29 Nov 2022 13:45:10 +0000 (GMT) To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, guojiufu@linux.ibm.com, rguenther@suse.de, jeffreyalaw@gmail.com Subject: [PATCH 3/3] Testcases for move sub blocks on param and ret Date: Tue, 29 Nov 2022 21:45:07 +0800 Message-Id: <20221129134507.185951-3-guojiufu@linux.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221129134507.185951-1-guojiufu@linux.ibm.com> References: <20221129134507.185951-1-guojiufu@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 6VRK9_jKRNBYP1JdbOAdn7L5dIWrmR9G X-Proofpoint-GUID: 0GgASjrcpIaAIj5kFDrmGDgqhRPpaOR1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-29_08,2022-11-29_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 clxscore=1015 adultscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211290078 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jiufu Guo via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jiufu Guo <guojiufu@linux.ibm.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750838404124744185?= X-GMAIL-MSGID: =?utf-8?q?1750838404124744185?= |
Series |
[1/3] Use sub mode to move block for struct parameter
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Jiufu Guo
Nov. 29, 2022, 1:45 p.m. UTC
Hi, This patch is just add test cases, and tested on ppc64{,le}. With previous patches on this serial passed, Bootstrap and regtest passed on ppc64{,le} and x86_64. Is this ok for trunk? BR, Jeff (Jiufu) PR target/65421 gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr65421-1.c: New test. * gcc.target/powerpc/pr65421.c: New test. --- gcc/testsuite/gcc.target/powerpc/pr65421-1.c | 25 ++++++++++++++++++++ gcc/testsuite/gcc.target/powerpc/pr65421.c | 22 +++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr65421-1.c create mode 100644 gcc/testsuite/gcc.target/powerpc/pr65421.c
Comments
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
Hi Segher, Thanks for your comments! Segher Boessenkool <segher@kernel.crashing.org> writes: > 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? Thanks a lot for point out this! Compiling this case on power7 manually, it does not generate these vector load/store insns. To check those insns, power7 is needed. > >> --- /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 :-) Sure, thanks! BR, Jeff (Jiufu) > > > Segher
diff --git a/gcc/testsuite/gcc.target/powerpc/pr65421-1.c b/gcc/testsuite/gcc.target/powerpc/pr65421-1.c new file mode 100644 index 00000000000..a5ea675008e --- /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 } } */ + + diff --git a/gcc/testsuite/gcc.target/powerpc/pr65421.c b/gcc/testsuite/gcc.target/powerpc/pr65421.c new file mode 100644 index 00000000000..27f69e24e29 --- /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 } } */