Kewen:

On Tue, 2023-07-04 at 10:49 +0800, Kewen.Lin wrote:
> 

<snip>

> > 
> > The tests are broken up into a seriers of files for related
> > tests.  The
> 
> s/seriers/series/

Fixed

> 
> > new tests are runnable tests to verify the builtin argument types
> > and the
> > functional correctness of each test rather then verifying the type
> > and
> > number of instructions generated.
> > 
> > gcc/testsuite/
> >     * gcc.target/powerpc/vsx-vector-6-1op.c: New test file.
> >     * gcc.target/powerpc/vsx-vector-6-2lop.c: New test file.
> >     * gcc.target/powerpc/vsx-vector-6-2op.c: New test file.
> >     * gcc.target/powerpc/vsx-vector-6-3op.c: New test file.
> >     * gcc.target/powerpc/vsx-vector-6-cmp-all.c: New test file.
> >     * gcc.target/powerpc/vsx-vector-6-cmp.c: New test file.
> 
> Missing "func-" in the names ...

Fixed.

> 
> >     * gcc.target/powerpc/vsx-vector-6.h: Remove test file.
> >     * gcc.target/powerpc/vsx-vector-6-p7.h: Remove test file.
> >     * gcc.target/powerpc/vsx-vector-6-p8.h: Remove test file.
> >     * gcc.target/powerpc/vsx-vector-6-p9.h: Remove test file.
> 
> should be vsx-vector-6-p{7,8,9}.c, "git gcc-verify" should catch
> these.

Fixed, ran git gcc-verify which found a couple more little file name
typos.
> 
> > ---
> >  .../powerpc/vsx-vector-6-func-1op.c           | 141 ++++++++++
> >  .../powerpc/vsx-vector-6-func-2lop.c          | 217
> > +++++++++++++++
> >  .../powerpc/vsx-vector-6-func-2op.c           | 133 +++++++++
> >  .../powerpc/vsx-vector-6-func-3op.c           | 257
> > ++++++++++++++++++
> >  .../powerpc/vsx-vector-6-func-cmp-all.c       | 211 ++++++++++++++
> >  .../powerpc/vsx-vector-6-func-cmp.c           | 121 +++++++++
> >  .../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 ---
> >  10 files changed, 1080 insertions(+), 282 deletions(-)
> >  create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-
> > func-1op.c
> >  create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-
> > func-2lop.c
> >  create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-
> > func-2op.c
> >  create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-
> > func-3op.c
> >  create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-
> > func-cmp-all.c
> >  create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-vector-6-
> > func-cmp.c
> >  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.c b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op.c
> > new file mode 100644
> > index 00000000000..52c7ae3e983
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.target/powerpc/vsx-vector-6-func-1op.c
> > @@ -0,0 +1,141 @@
> > +/* { dg-do run { target lp64 } } */
> > +/* { dg-skip-if "" { powerpc*-*-darwin* } } */
> > +/* { dg-options "-O2 -save-temps" } */
> 
> I just noticed that we missed an effective target check here to
> ensure the
> support of those bifs during the test run, and since it's a runnable
> test
> case, also need to ensure the generated hw insn supported, it's
> "vsx_hw"
> like:
> 
> /* { dg-require-effective-target vsx_hw } */
> 
> And adding "-mvsx" to the dg-options.

Add the effective-target and -mvsx to all of the tests.

> 
> This is also applied for the other test cases.
> 
> But as the discussion on xxlor and the different effective target
> requirements
> on compilation part and run part, I think we can separate each of
> these cases into
> two files, one for compilation and the other for run, for example,
> for this
> case, update FLOAT_TEST by adding one more global variable like
> 
> #define FLOAT_TEST(NAME)
>   vector float f_##NAME##_result; \
>   void ... \
>   f_##NAME##_result = vec_##NAME(f_src);\
>   }
>   // moving the checking code to its main.
> 
> move #include <altivec.h>, FLOAT_TEST(NAME), DOUBLE_TEST(NAME)
> defines
> and their uses into vsx-vector-6-func-1op.h.
> 
> 
> **For compilation file vsx-vector-6-func-1op.c**:
> 
> Include this header file into vsx-vector-6-func-1op.c, which has the
> 
> /* { dg-do compile { target lp64 } } */
> /* { dg-require-effective-target powerpc_vsx_ok } */
> /* { dg-options "-O2 -mvsx" } */
> 
> #include "vsx-vector-6-func-1op.h"
> 
> Then put the expected insn check here, like 
> 
> /* { dg-final { scan-assembler-times {\mxvabssp\M} 1 } } */
> ...
> 
> By organizing it like this, these scan-assembler-times would only
> focus on what
> are generated for bifs (excluding possible noises from main function
> for running).
> 
> 
> **For runnable file vsx-vector-6-func-1op-run.c**:
> 
> /* { dg-do compile { target lp64 } } */
> /* { dg-require-effective-target vsx_hw } */
> /* { dg-options "-O2 -mvsx" } */
> 
> #include "vsx-vector-6-func-1op.h"
> 
> We can add a new macro to invoke {FLOAT,DOUBLE}_TEST, further check
> the
> {d,f}_##NAME##_result and {d,f}_##NAME##_expected, and use it in
> main.
> 
> This test case can only focus on runtime result checking.

So redid the tests creating the compile and run tests as requested.  I
moved the common stuff, functions to call builtins, include files etc.
in the .h files.  The compile test has the instruction count checks
with the functions that call the builtins included into them.  The run
test has the function calls included in them and then uses macros to
generate the code to check the results.  I did look thru the assembly
code to see that the generated code is actually doing the calls to the
builtins to calculate the results and not being statically computed at
compile time.  I work on a previous version of the patch, I noticed
precomputing of the results by the compiler seemed to happen on some of
the simpler tests like add and subtract when the data setup and
computations were all in the main program.
              
                       Carl 


> 
> 
> BR,
> Kewen
> 
> > 
<snip>

Reply via email to