From 759ebd17e39203678e1fd35611628f6dddc44117 Mon Sep 17 00:00:00 2001 From: Will Schmidt Date: Fri, 27 Oct 2017 17:52:55 +0000 Subject: [PATCH] fold-vec-neg-char.c: New. [testsuite] 2017-10-27 Will Schmidt * gcc.target/powerpc/fold-vec-neg-char.c: New. * gcc.target/powerpc/fold-vec-neg-floatdouble.c: New. * gcc.target/powerpc/fold-vec-neg-int.c: New. * gcc.target/powerpc/fold-vec-neg-longlong.c: New. * gcc.target/powerpc/fold-vec-neg-short.c: New. From-SVN: r254164 --- gcc/testsuite/ChangeLog | 8 +++++++ .../gcc.target/powerpc/fold-vec-neg-char.c | 19 +++++++++++++++ .../powerpc/fold-vec-neg-floatdouble.c | 23 +++++++++++++++++++ .../gcc.target/powerpc/fold-vec-neg-int.c | 18 +++++++++++++++ .../powerpc/fold-vec-neg-longlong.c | 18 +++++++++++++++ .../gcc.target/powerpc/fold-vec-neg-short.c | 18 +++++++++++++++ 6 files changed, 104 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-char.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-floatdouble.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-neg-short.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2fb6daaf214..b8dac7e625a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2017-10-27 Will Schmidt + + * gcc.target/powerpc/fold-vec-neg-char.c: New. + * gcc.target/powerpc/fold-vec-neg-floatdouble.c: New. + * gcc.target/powerpc/fold-vec-neg-int.c: New. + * gcc.target/powerpc/fold-vec-neg-longlong.c: New. + * gcc.target/powerpc/fold-vec-neg-short.c: New. + 2017-10-27 Thomas Koenig PR fortran/56342 diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-char.c new file mode 100644 index 00000000000..19ea3d3184a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-char.c @@ -0,0 +1,19 @@ +/* Verify that overloaded built-ins for vec_neg with char + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector signed char +test2 (vector signed char x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "xxspltib|vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsububm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsb" 0 } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-floatdouble.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-floatdouble.c new file mode 100644 index 00000000000..79ad92465a2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-floatdouble.c @@ -0,0 +1,23 @@ +/* Verify that overloaded built-ins for vec_neg with float and + double inputs for VSX produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +vector float +test1 (vector float x) +{ + return vec_neg (x); +} + +vector double +test2 (vector double x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "xvnegsp" 1 } } */ +/* { dg-final { scan-assembler-times "xvnegdp" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c new file mode 100644 index 00000000000..d6ca1283bc9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-int.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_neg with int + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector signed int +test1 (vector signed int x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "xxspltib|vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsw" 0 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.c new file mode 100644 index 00000000000..48f71788648 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_neg with long long + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include + +vector signed long long +test3 (vector signed long long x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "xxspltib|vspltisw" 1 } } */ +/* { dg-final { scan-assembler-times "vsubudm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsd" 0 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-short.c new file mode 100644 index 00000000000..997a9d48617 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-neg-short.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_neg with short + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector signed short +test3 (vector signed short x) +{ + return vec_neg (x); +} + +/* { dg-final { scan-assembler-times "xxspltib|vspltisw|vxor" 1 } } */ +/* { dg-final { scan-assembler-times "vsubuhm" 1 } } */ +/* { dg-final { scan-assembler-times "vmaxsh" 0 } } */ -- 2.30.2