From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 26A013858D38 for ; Fri, 7 Jul 2023 02:15:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26A013858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3672Bs6U003675; Fri, 7 Jul 2023 02:15:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=07EsRexroeWZDI2a77SYKxRoc6aoJsorC/jMKIe8dGA=; b=r9p4v5Vyuf2lQ885yM6jmotwCCU3V2mfUP62j1HPJslL1oxtDBcRVVFcDhnIlzFNsAS0 a6xBY7t9ZSlDDgn2HKftqHNajee5wTOXp2QXAcHTGZEMx2NLeQiFI22+bUP72jYmgcP/ A+Irn2/rNnPVHS3XlUSbrxTLBZBRYamPbCf9p4HOnRr80NYI/qUlPe7Do4FUvjg4EAsM fUOBi8mx2Kgk+EXibHj595Bo/GvrUKVcWMQo/jjVcMdhVItsYHQKiSij5wDG1eFPNRBn d+YK7G/NKpfCTZc5B8gu0jZgL3CQDII6120AQDWogd48jB/o/y0SgRh88fhBx0wfJCCd +Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rp9q4g251-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jul 2023 02:15:32 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3672Cvkt005984; Fri, 7 Jul 2023 02:15:32 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rp9q4g248-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jul 2023 02:15:31 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 366MQtAm011099; Fri, 7 Jul 2023 02:15:29 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3rjbde3qn2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Jul 2023 02:15:29 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3672FRu840632664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Jul 2023 02:15:27 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31A9920040; Fri, 7 Jul 2023 02:15:27 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29C0A20043; Fri, 7 Jul 2023 02:15:25 +0000 (GMT) Received: from [9.197.254.113] (unknown [9.197.254.113]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 7 Jul 2023 02:15:24 +0000 (GMT) Message-ID: <875d22cb-d7a7-2d72-ca02-60e3a219349e@linux.ibm.com> Date: Fri, 7 Jul 2023 10:15:23 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v4] rs6000: Update the vsx-vector-6.* tests. Content-Language: en-US To: Carl Love Cc: Peter Bergner , Segher Boessenkool , David Edelsohn , gcc-patches@gcc.gnu.org References: <8623b20d2a26fb43bbff006bdf68f67151fb3ec8.camel@us.ibm.com> From: "Kewen.Lin" In-Reply-To: <8623b20d2a26fb43bbff006bdf68f67151fb3ec8.camel@us.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: OkxcZD0QK45DetjkSYvOLu5z_Q91bxNF X-Proofpoint-GUID: qaRo0T6ggfp3VPz5etSXfYiW7wkbjgU2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-06_17,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 spamscore=0 suspectscore=0 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307070017 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,NICE_REPLY_A,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Carl, on 2023/7/6 23:33, Carl Love wrote: > GCC maintainers: > > Ver 4. Fixed a few typos. Redid the tests to create separate run and > compile tests. Thanks! This new version looks good, excepting that we need vsx_hw for run and two nits, see below. > > Ver 3. Added __attribute__ ((noipa)) to the test files. Changed some > of the scan-assembler-times checks to cover multiple similar > instructions. Change the function check macro to a macro to generate a > function to do the test and check the results. Retested on the various > processor types and BE/LE versions. > > Ver 2. Switched to using code macros to generate the call to the > builtin and test the results. Added in instruction counts for the key > instruction for the builtin. Moved the tests into an additional > function call to ensure the compile doesn't replace the builtin call > code with the statically computed results. The compiler was doing this > for a few of the simpler tests. > > The following patch takes the tests in vsx-vector-6-p7.h, vsx-vector- > 6-p8.h, vsx-vector-6-p9.h and reorganizes them into a series of smaller > test files by functionality rather than processor version. > > Tested the patch on Power 8 LE/BE, Power 9 LE/BE and Power 10 LE with > no regresions. > > Please let me know if this patch is acceptable for mainline. Thanks. > > Carl > > > > ----------------------------------------------------------------- > rs6000: Update the vsx-vector-6.* tests. > > The vsx-vector-6.h file is included into the processor specific test files > vsx-vector-6.p7.c, vsx-vector-6.p8.c, and vsx-vector-6.p9.c. The .h file > contains a large number of vsx vector builtin tests. The processor > specific files contain the number of instructions that the tests are > expected to generate for that processor. The tests are compile only. > > This patch reworks the tests into a series of files for related tests. > The new tests consist of a runnable test to verify the builtin argument > types and the functional correctness of each builtin. There is also a > compile only test that verifies the builtins generate the expected number > of instructions for the various builtin tests. > > gcc/testsuite/ > * gcc.target/powerpc/vsx-vector-6-func-1op.h: New test file. > * gcc.target/powerpc/vsx-vector-6-func-1op-run.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-1op-compile.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-2lop.h: New test file. > * gcc.target/powerpc/vsx-vector-6-func-2lop-run.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-2lop-compile.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-2op.h: New test file. > * gcc.target/powerpc/vsx-vector-6-func-2op-run.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-2op-compile.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-3op.h: New test file. > * gcc.target/powerpc/vsx-vector-6-func-3op-run.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-3op-compile.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-cmp-all.h: New test file. > * gcc.target/powerpc/vsx-vector-6-func-cmp-all-run.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-cmp-all-compile.c: New test > file. > * gcc.target/powerpc/vsx-vector-6-func-cmp.h: New test file. > * gcc.target/powerpc/vsx-vector-6-func-cmp-run.c: New test file. > * gcc.target/powerpc/vsx-vector-6-func-cmp-compile.c: New test file. > * gcc.target/powerpc/vsx-vector-6.h: Remove test file. > * gcc.target/powerpc/vsx-vector-6.p7.c: Remove test file. > * gcc.target/powerpc/vsx-vector-6.p8.c: Remove test file. > * gcc.target/powerpc/vsx-vector-6.p9.c: Remove test file. > --- > .../powerpc/vsx-vector-6-func-1op-compile.c | 22 ++ > .../powerpc/vsx-vector-6-func-1op-run.c | 98 ++++++++ > .../powerpc/vsx-vector-6-func-1op.h | 43 ++++ > .../powerpc/vsx-vector-6-func-2lop-compile.c | 14 ++ > .../powerpc/vsx-vector-6-func-2lop-run.c | 177 ++++++++++++++ > .../powerpc/vsx-vector-6-func-2lop.h | 47 ++++ > .../powerpc/vsx-vector-6-func-2op-compile.c | 21 ++ > .../powerpc/vsx-vector-6-func-2op-run.c | 96 ++++++++ > .../powerpc/vsx-vector-6-func-2op.h | 42 ++++ > .../powerpc/vsx-vector-6-func-3op-compile.c | 17 ++ > .../powerpc/vsx-vector-6-func-3op-run.c | 229 ++++++++++++++++++ > .../powerpc/vsx-vector-6-func-3op.h | 73 ++++++ > .../vsx-vector-6-func-cmp-all-compile.c | 17 ++ > .../powerpc/vsx-vector-6-func-cmp-all-run.c | 147 +++++++++++ > .../powerpc/vsx-vector-6-func-cmp-all.h | 76 ++++++ > .../powerpc/vsx-vector-6-func-cmp-compile.c | 16 ++ > .../powerpc/vsx-vector-6-func-cmp-run.c | 92 +++++++ > .../powerpc/vsx-vector-6-func-cmp.h | 40 +++ > .../gcc.target/powerpc/vsx-vector-6.h | 154 ------------ > .../gcc.target/powerpc/vsx-vector-6.p7.c | 43 ---- > .../gcc.target/powerpc/vsx-vector-6.p8.c | 43 ---- > .../gcc.target/powerpc/vsx-vector-6.p9.c | 42 ---- > 22 files changed, 1267 insertions(+), 282 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-compile.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-run.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op.h > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-2lop-compile.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-2lop-run.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-2lop.h > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-2op-compile.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-2op-run.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-2op.h > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-3op-compile.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-3op-run.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-3op.h > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-cmp-all-compile.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-cmp-all-run.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-cmp-all.h > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-cmp-compile.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-cmp-run.c > create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-cmp.h > delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6.h > delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p7.c > delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p8.c > delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6.p9.c > > diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-compile.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-compile.c > new file mode 100644 > index 00000000000..6b7d73ed66c > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-compile.c Nit: Maybe remove "-compile" from the name as when there is "-run" variant people are easy to realize this is for compilation, the name without "-compile" seems more neat. With this name change, you have to update the comment referring it in its related header file accordingly. ("sed -i 's/-compile//g' vsx-vector-6-func-*.h" recommended, similar patterns could be used for the two other comments below.) > @@ -0,0 +1,22 @@ > +/* { dg-do compile { target lp64 } } */ > +/* { dg-require-effective-target powerpc_vsx_ok } */ > +/* { dg-options "-O2 -save-temps -mvsx" } */ Nit: We don't need "-save-temps" any more for all the test cases in this patch. > + > +/* This file just generates calls to the various builtins and verifies the > + expected number of instructions for each builtin were generated. */ > + > +#include "vsx-vector-6-func-1op.h" > + > +/* { dg-final { scan-assembler-times {\mxvabssp\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrspip\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrspim\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrspi\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrspic\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrspiz\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvabsdp\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrdpip\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrdpim\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrdpi\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrdpic\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvrdpiz\M} 1 } } */ > +/* { dg-final { scan-assembler-times {\mxvsqrtdp\M} 1 } } */ > diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-run.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-run.c > new file mode 100644 > index 00000000000..150e372e428 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op-run.c > @@ -0,0 +1,98 @@ > +/* { dg-do run { target lp64 } } */ > +/* { dg-require-effective-target powerpc_vsx_ok } */ We need vsx_hw for those *-run.c cases instead, as powerpc_vsx_ok doesn't guarantee the test env can support vsx instructions, it just ensures it can be compiled. /* { dg-require-effective-target vsx_hw } */ All "*-run.c" cases need changes. BR, Kewen