From 7ca83c36622cf9f0cc00ba993784b2f7db662ae9 Mon Sep 17 00:00:00 2001 From: Will Schmidt Date: Tue, 17 Jul 2018 15:51:12 +0000 Subject: [PATCH] fold-vec-unpack-char.c: New. [testsuite] 2018-07-06 Will Schmidt * gcc.target/powerpc/fold-vec-unpack-char.c: New. * gcc.target/powerpc/fold-vec-unpack-float.c: New. * gcc.target/powerpc/fold-vec-unpack-int.c: New. * gcc.target/powerpc/fold-vec-unpack-pixel.c: New. * gcc.target/powerpc/fold-vec-unpack-short.c: New. From-SVN: r262827 --- gcc/testsuite/ChangeLog | 8 +++++ .../gcc.target/powerpc/fold-vec-unpack-char.c | 36 +++++++++++++++++++ .../powerpc/fold-vec-unpack-float.c | 23 ++++++++++++ .../gcc.target/powerpc/fold-vec-unpack-int.c | 35 ++++++++++++++++++ .../powerpc/fold-vec-unpack-pixel.c | 23 ++++++++++++ .../powerpc/fold-vec-unpack-short.c | 36 +++++++++++++++++++ 6 files changed, 161 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c create mode 100644 gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9a88fb282b0..bcedfc5c8bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-07-17 Will Schmidt + + * gcc.target/powerpc/fold-vec-unpack-char.c: New. + * gcc.target/powerpc/fold-vec-unpack-float.c: New. + * gcc.target/powerpc/fold-vec-unpack-int.c: New. + * gcc.target/powerpc/fold-vec-unpack-pixel.c: New. + * gcc.target/powerpc/fold-vec-unpack-short.c: New. + 2018-07-17 David Edelsohn * gcc.target/powerpc/pr57150.c: Require longdouble128. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c new file mode 100644 index 00000000000..7f4b3721b20 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c @@ -0,0 +1,36 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with char + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector bool short +testbc_l (vector bool char vbc2) +{ + return vec_unpackl (vbc2); +} + +vector signed short +testsc_l (vector signed char vsc2) +{ + return vec_unpackl (vsc2); +} + +vector bool short +testbc_h (vector bool char vbc2) +{ + return vec_unpackh (vbc2); +} + +vector signed short +testsc_h (vector signed char vsc2) +{ + return vec_unpackh (vsc2); +} + +/* { dg-final { scan-assembler-times "vupkhsb" 2 } } */ +/* { dg-final { scan-assembler-times "vupklsb" 2 } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c new file mode 100644 index 00000000000..78e8eb35e73 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c @@ -0,0 +1,23 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with float + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include + +vector double +testf_l (vector float vf2) +{ + return vec_unpackl (vf2); +} + +vector double +testf_h (vector float vf2) +{ + return vec_unpackh (vf2); +} + +/* { dg-final { scan-assembler-times "xxsldwi" 4 } } */ +/* { dg-final { scan-assembler-times "xvcvspdp" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c new file mode 100644 index 00000000000..621c4eb250d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c @@ -0,0 +1,35 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with int + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include + +vector bool long long +testbi_l (vector bool int vbi2) +{ + return vec_unpackl (vbi2); +} + +vector signed long long +testsi_l (vector signed int vsi2) +{ + return vec_unpackl (vsi2); +} + +vector bool long long +testbi_h (vector bool int vbi2) +{ + return vec_unpackh (vbi2); +} + +vector signed long long +testsi_h (vector signed int vsi2) +{ + return vec_unpackh (vsi2); +} + +/* { dg-final { scan-assembler-times "vupkhsw" 2 } } */ +/* { dg-final { scan-assembler-times "vupklsw" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c new file mode 100644 index 00000000000..8e7d11026e9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c @@ -0,0 +1,23 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with pixel + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector unsigned int +testf_el (vector pixel vpx2) +{ + return vec_unpackl (vpx2); +} + +vector unsigned int +testf_eh (vector pixel vpx2) +{ + return vec_unpackh (vpx2); +} + +/* { dg-final { scan-assembler-times "vupkhpx" 1 } } */ +/* { dg-final { scan-assembler-times "vupklpx" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c new file mode 100644 index 00000000000..da5101271f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c @@ -0,0 +1,36 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with int + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector bool int +testbi_el (vector bool short vbs2) +{ + return vec_unpackl (vbs2); +} + +vector signed int +testsi_el (vector signed short vss2) +{ + return vec_unpackl (vss2); +} + +vector bool int +testbi_eh (vector bool short vbs2) +{ + return vec_unpackh (vbs2); +} + +vector signed int +testsi_eh (vector signed short vss2) +{ + return vec_unpackh (vss2); +} + +/* { dg-final { scan-assembler-times "vupkhsh" 2 } } */ +/* { dg-final { scan-assembler-times "vupklsh" 2 } } */ + -- 2.30.2