From f1aa1f93be3d7365ba4a57d2f38bed32fd154f51 Mon Sep 17 00:00:00 2001 From: Will Schmidt Date: Wed, 31 Jan 2018 19:01:27 +0000 Subject: [PATCH] altivec-13.c: Remove VSX-requiring built-ins. [testsuite] 2018-01-31 Will Schmidt * gcc.target/powerpc/altivec-13.c: Remove VSX-requiring built-ins. * gcc.target/powerpc/vsx-13.c: New. From-SVN: r257253 --- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gcc.target/powerpc/altivec-13.c | 25 ++++------- gcc/testsuite/gcc.target/powerpc/vsx-13.c | 42 +++++++++++++++++++ 3 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-13.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 60756dab0ea..7994af53c5c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-31 Will Schmidt + + * gcc.target/powerpc/altivec-13.c: Remove VSX-requiring built-ins. + * gcc.target/powerpc/vsx-13.c: New. + 2018-01-31 Paolo Carlini PR c++/84092 diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-13.c b/gcc/testsuite/gcc.target/powerpc/altivec-13.c index 2315f6ef7d7..31ff5092014 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-13.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-13.c @@ -8,9 +8,12 @@ while not in the Motorola AltiVec PIM, have nevertheless crept into the AltiVec vernacular over the years. */ +/* Tests requiring VSX support (vector long long and vector double) have + been moved over to vsx-13.c. */ + #include -void foo (void) +void foo (void) { vector bool int boolVec1 = (vector bool int) vec_splat_u32(3); vector bool short boolVec2 = (vector bool short) vec_splat_u16(3); @@ -21,12 +24,8 @@ void foo (void) vector signed int vsi1, vsi2, vsiz; vector unsigned int vui1, vui2, vuiz; vector unsigned short int vusi1, vusi2, vusiz; - vector bool long long vubll1, vubll2, vubllz; - vector signed int long long vsill1, vsill2, vsillz; - vector unsigned int long long vuill1, vuill2, vuillz; vector pixel vp1, vp2, vpz; vector float vf1, vf2, vfz; - vector double vd1, vd2, vdz; boolVec1 = vec_sld( boolVec1, boolVec1, 4 ); boolVec2 = vec_sld( boolVec2, boolVec2, 2 ); @@ -36,22 +35,16 @@ void foo (void) vucz = vec_sld( vuc1, vuc2, 1 ); vsiz = vec_sld( vsi1, vsi2, 1 ); vuiz = vec_sld( vui1, vui2, 1 ); - vubllz = vec_sld( vubll1, vubll2, 1 ); - vsillz = vec_sld( vsill1, vsill2, 1 ); - vuillz = vec_sld( vuill1, vuill2, 1 ); vssiz = vec_sld( vssi1, vssi2, 1 ); vusiz = vec_sld( vusi1, vusi2, 1 ); vfz = vec_sld( vf1, vf2, 1 ); - vdz = vec_sld( vd1, vd2, 1 ); vpz = vec_sld( vp1, vp2, 1 ); vucz = vec_srl(vuc1, vuc2); vsiz = vec_srl(vsi1, vuc2); vuiz = vec_srl(vui1, vuc2); - vsillz = vec_srl(vsill1, vuc2); - vuillz = vec_srl(vuill1, vuc2); vpz = vec_srl(vp1, vuc2); vssiz = vec_srl(vssi1, vuc2); vusiz = vec_srl(vusi1, vuc2); @@ -64,10 +57,6 @@ void foo (void) vsiz = vec_sro(vsi1, vuc2); vuiz = vec_sro(vui1, vsc2); vuiz = vec_sro(vui1, vuc2); - vsillz = vec_sro(vsill1, vsc2); - vsillz = vec_sro(vsill1, vuc2); - vuillz = vec_sro(vuill1, vsc2); - vuillz = vec_sro(vuill1, vuc2); vpz = vec_sro(vp1, vsc2); vpz = vec_sro(vp1, vuc2); vssiz = vec_sro(vssi1, vsc2); @@ -83,6 +72,6 @@ void foo (void) vec_srl vsr vec_sro vsro */ -/* { dg-final { scan-assembler-times "vsldoi" 15 } } */ -/* { dg-final { scan-assembler-times "vsr " 8 } } */ -/* { dg-final { scan-assembler-times "vsro" 20 } } */ +/* { dg-final { scan-assembler-times "vsldoi" 11 } } */ +/* { dg-final { scan-assembler-times "vsr " 6 } } */ +/* { dg-final { scan-assembler-times "vsro" 16 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-13.c b/gcc/testsuite/gcc.target/powerpc/vsx-13.c new file mode 100644 index 00000000000..5b4eb68068f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/vsx-13.c @@ -0,0 +1,42 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx" } */ + +/* Variations of tests that require VSX support. This is a variation of + the altivec-13.c testcase. */ + +#include + +void foo (void) +{ + + vector signed char vsc1, vsc2, vscz; + vector unsigned char vuc1, vuc2, vucz; + vector bool long long vubll1, vubll2, vubllz; + vector signed int long long vsill1, vsill2, vsillz; + vector unsigned int long long vuill1, vuill2, vuillz; + vector double vd1, vd2, vdz; + + vubllz = vec_sld( vubll1, vubll2, 1 ); + vsillz = vec_sld( vsill1, vsill2, 1 ); + vuillz = vec_sld( vuill1, vuill2, 1 ); + + vsillz = vec_srl(vsill1, vuc2); + vuillz = vec_srl(vuill1, vuc2); + + vsillz = vec_sro(vsill1, vsc2); + vsillz = vec_sro(vsill1, vuc2); + vuillz = vec_sro(vuill1, vsc2); + vuillz = vec_sro(vuill1, vuc2); + + vdz = vec_sld( vd1, vd2, 1 ); +} + +/* Expected results: + vec_sld vsldoi + vec_srl vsr + vec_sro vsro */ + +/* { dg-final { scan-assembler-times "vsldoi" 4 } } */ +/* { dg-final { scan-assembler-times "vsr " 2 } } */ +/* { dg-final { scan-assembler-times "vsro" 4 } } */ -- 2.30.2