From ee9a9e7b215b0800c5f277029379c632f52e5e1b Mon Sep 17 00:00:00 2001 From: Will Schmidt Date: Wed, 9 Aug 2017 19:02:41 +0000 Subject: [PATCH] fold-vec-madd-double.c: New. [gcc/testsuite] 2017-08-09 Will Schmidt * gcc.target/powerpc/fold-vec-madd-double.c: New. * gcc.target/powerpc/fold-vec-madd-float.c: New. * gcc.target/powerpc/fold-vec-madd-short.c: New. From-SVN: r250996 --- gcc/testsuite/ChangeLog | 6 +++ .../gcc.target/powerpc/fold-vec-madd-double.c | 17 +++++++++ .../gcc.target/powerpc/fold-vec-madd-float.c | 17 +++++++++ .../gcc.target/powerpc/fold-vec-madd-short.c | 38 +++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 97a17e33f16..6e02fad4f4a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-08-09 Will Schmidt + + * gcc.target/powerpc/fold-vec-madd-double.c: New. + * gcc.target/powerpc/fold-vec-madd-float.c: New. + * gcc.target/powerpc/fold-vec-madd-short.c: New. + 2017-08-09 Will Schmidt * gcc.target/powerpc/fold-vec-cntlz-int.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c new file mode 100644 index 00000000000..0fe78241294 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-double.c @@ -0,0 +1,17 @@ +/* Verify that overloaded built-ins for vec_madd with + double inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +vector double +testd_l (vector double vd2, vector double vd3, vector double vd4) +{ + return vec_madd (vd2, vd3, vd4); +} + +/* { dg-final { scan-assembler-times "xvmaddmdp|xvmaddadp" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c new file mode 100644 index 00000000000..fcfe0c38656 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-float.c @@ -0,0 +1,17 @@ +/* Verify that overloaded built-ins for vec_madd with float + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +vector float +testf_l (vector float vf2, vector float vf3, vector float vf4) +{ + return vec_madd (vf2, vf3, vf4); +} + +/* { dg-final { scan-assembler-times "xvmaddmsp|xvmaddasp" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c new file mode 100644 index 00000000000..0e78f3585f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-madd-short.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for vec_madd with short + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector signed short +test_mad_sss (vector signed short vss2, vector signed short vss3, + vector signed short vss4) +{ + return vec_madd (vss2, vss3, vss4); +} + +vector signed short +test_mad_suu (vector signed short vss2, vector unsigned short vus3, + vector unsigned short vus4) +{ + return vec_madd (vss2, vus3, vus4); +} + +vector signed short +test_mad_uss (vector unsigned short vus2, vector signed short vss3, + vector signed short vss4) +{ + return vec_madd (vus2, vss3, vss4); +} + +vector unsigned short +test_mad_uuu (vector unsigned short vus2, vector unsigned short vus3, + vector unsigned short vus4) +{ + return vec_madd (vus2, vus3, vus4); +} + +/* { dg-final { scan-assembler-times "vmladduhm" 4 } } */ -- 2.30.2