public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Carl Love <cel@us.ibm.com>
Cc: Peter Bergner <bergner@linux.ibm.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v4] rs6000: Update the vsx-vector-6.* tests.
Date: Fri, 7 Jul 2023 10:15:23 +0800	[thread overview]
Message-ID: <875d22cb-d7a7-2d72-ca02-60e3a219349e@linux.ibm.com> (raw)
In-Reply-To: <8623b20d2a26fb43bbff006bdf68f67151fb3ec8.camel@us.ibm.com>

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

  reply	other threads:[~2023-07-07  2:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 15:33 Carl Love
2023-07-07  2:15 ` Kewen.Lin [this message]
2023-07-07 20:36   ` Carl Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875d22cb-d7a7-2d72-ca02-60e3a219349e@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=cel@us.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).