From: Will Schmidt Date: Wed, 9 Aug 2017 19:06:35 +0000 (+0000) Subject: fold-vec-msum-char.c: New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d9a180f7d5719f4bfcd96df8188ea3a5e24550a;p=gcc.git fold-vec-msum-char.c: New. [gcc/testsuite] 2017-08-09 Will Schmidt * gcc.target/powerpc/fold-vec-msum-char.c: New. * gcc.target/powerpc/fold-vec-msum-short.c: New. From-SVN: r250997 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6e02fad4f4a..b5f06f26d8e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-08-09 Will Schmidt + + * gcc.target/powerpc/fold-vec-msum-char.c: New. + * gcc.target/powerpc/fold-vec-msum-short.c: New. + 2017-08-09 Will Schmidt * gcc.target/powerpc/fold-vec-madd-double.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c new file mode 100644 index 00000000000..53519d50293 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c @@ -0,0 +1,25 @@ +/* Verify that overloaded built-ins for vec_msum() with char inputs + produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector unsigned int +test_msum_ui_uc_uc_ui (vector unsigned char vuc2, vector unsigned char vuc3, + vector unsigned int vui2) +{ + return vec_msum (vuc2, vuc3, vui2); +} + +vector signed int +test_msum_si_sc_uc_si (vector signed char vsc2, vector unsigned char vuc3, + vector signed int vsi2) +{ + return vec_msum (vsc2, vuc3, vsi2); +} + +/* { dg-final { scan-assembler-times "vmsumubm" 1 } } */ +/* { dg-final { scan-assembler-times "vmsummbm" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c new file mode 100644 index 00000000000..61e1d35c0d1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c @@ -0,0 +1,25 @@ +/* Verify that overloaded built-ins for vec_msum with int + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector signed int +test_msum_si (vector signed short vss2, vector signed short vss3, + vector signed int vsi2) +{ + return vec_msum (vss2, vss3, vsi2); +} + +vector unsigned int +test_msum)ui (vector unsigned short vus2, vector unsigned short vus3, + vector unsigned int vui2) +{ + return vec_msum (vus2, vus3, vui2); +} + +/* { dg-final { scan-assembler-times "vmsumshm" 1 } } */ +/* { dg-final { scan-assembler-times "vmsumuhm" 1 } } */