From: Will Schmidt Date: Tue, 12 Jun 2018 15:54:17 +0000 (+0000) Subject: fold-vec-load-vec_xl-char.c: New testcase. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4acdcafb999bc36b091a1df895eb2120cd781183;p=gcc.git fold-vec-load-vec_xl-char.c: New testcase. [testsuite] 2018-06-12 Will Schmidt * gcc.target/powerpc/fold-vec-load-vec_xl-char.c: New testcase. * gcc.target/powerpc/fold-vec-load-vec_xl-double.c: New testcase. * gcc.target/powerpc/fold-vec-load-vec_xl-float.c: New testcase. * gcc.target/powerpc/fold-vec-load-vec_xl-int.c: New testcase. * gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c: New testcase. * gcc.target/powerpc/fold-vec-load-vec_xl-short.c: New testcase. From-SVN: r261503 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1155851416e..3cf2bf5e58a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2018-06-12 Will Schmidt + + * gcc.target/powerpc/fold-vec-load-vec_xl-char.c: New testcase. + * gcc.target/powerpc/fold-vec-load-vec_xl-double.c: New testcase. + * gcc.target/powerpc/fold-vec-load-vec_xl-float.c: New testcase. + * gcc.target/powerpc/fold-vec-load-vec_xl-int.c: New testcase. + * gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c: New testcase. + * gcc.target/powerpc/fold-vec-load-vec_xl-short.c: New testcase. + 2018-06-12 Martin Liska * g++.dg/opt/mpx.C: New test. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-char.c new file mode 100644 index 00000000000..04c4f31deef --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-char.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for vec_xl with char + inputs produce the right code. */ + +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed char, signed long long, vector signed char); +BUILD_VAR_TEST( test2, vector signed char, signed int, vector signed char); +BUILD_CST_TEST( test3, vector signed char, 12, vector signed char); + +BUILD_VAR_TEST( test4, vector unsigned char, signed long long, vector unsigned char); +BUILD_VAR_TEST( test5, vector unsigned char, signed int, vector unsigned char); +BUILD_CST_TEST( test6, vector unsigned char, 12, vector unsigned char); + +BUILD_VAR_TEST( test7, vector signed char, signed long long, signed char); +BUILD_VAR_TEST( test8, vector signed char, signed int, signed char); +BUILD_CST_TEST( test9, vector signed char, 12, signed char); + +BUILD_VAR_TEST( test10, vector unsigned char, signed long long, unsigned char); +BUILD_VAR_TEST( test11, vector unsigned char, signed int, unsigned char); +BUILD_CST_TEST( test12, vector unsigned char, 12, unsigned char); + +/* { dg-final { scan-assembler-times {\mlxvw4x\M|\mlxvd2x\M|\mlxvx\M|\mlvx\M} 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-double.c new file mode 100644 index 00000000000..1958d65be89 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-double.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_xl with double + inputs produce the right code. */ + +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector double, signed long long, vector double); +BUILD_VAR_TEST( test2, vector double, signed int, vector double); +BUILD_CST_TEST( test3, vector double, 12, vector double); + +BUILD_VAR_TEST( test4, vector double, signed long long, double); +BUILD_VAR_TEST( test5, vector double, signed int, double); +BUILD_CST_TEST( test6, vector double, 12, double); + +/* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxvx\M|\mlvx\M} 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-float.c new file mode 100644 index 00000000000..5578138d2f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-float.c @@ -0,0 +1,30 @@ +/* Verify that overloaded built-ins for vec_xl with float + inputs produce the right code. */ + +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector float, signed long long, float); +BUILD_VAR_TEST( test2, vector float, signed int, float); +BUILD_CST_TEST( test3, vector float, 12, float); + +BUILD_VAR_TEST( test4, vector float, signed long long, vector float); +BUILD_VAR_TEST( test5, vector float, signed int, vector float); +BUILD_CST_TEST( test6, vector float, 12, vector float); + +/* { dg-final { scan-assembler-times {\mlxvw4x\M|\mlxvd2x\M|\mlxvx\M|\mlvx\M} 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-int.c new file mode 100644 index 00000000000..8ba880ea61f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-int.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for vec_xl with int + inputs produce the right code. */ + +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector int, signed long long, int); +BUILD_VAR_TEST( test2, vector int, signed int, int); +BUILD_CST_TEST( test3, vector int, 12, int); + +BUILD_VAR_TEST( test4, vector int, signed long long, vector int); +BUILD_VAR_TEST( test5, vector int, signed int, vector int); +BUILD_CST_TEST( test6, vector int, 12, vector int); + +BUILD_VAR_TEST( test7, vector unsigned int, signed long long, unsigned int); +BUILD_VAR_TEST( test8, vector unsigned int, signed int, unsigned int); +BUILD_CST_TEST( test9, vector unsigned int, 12, unsigned int); + +BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int); +BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int); +BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int); + +/* { dg-final { scan-assembler-times {\mlxvw4x\M|\mlxvd2x\M|\mlxvx\M|\mlvx\M} 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c new file mode 100644 index 00000000000..6df3c79fd1b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for vec_xl with long long + inputs produce the right code. */ + +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector long long, signed long long, long long); +BUILD_VAR_TEST( test2, vector long long, signed int, long long); +BUILD_CST_TEST( test3, vector long long, 12, long long); + +BUILD_VAR_TEST( test4, vector long long, signed long long, vector long long); +BUILD_VAR_TEST( test5, vector long long, signed int, vector long long); +BUILD_CST_TEST( test6, vector long long, 12, vector long long); + +BUILD_VAR_TEST( test7, vector unsigned long long, signed long long, unsigned long long); +BUILD_VAR_TEST( test8, vector unsigned long long, signed int, unsigned long long); +BUILD_CST_TEST( test9, vector unsigned long long, 12, unsigned long long); + +BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long); +BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long); +BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long); + +/* { dg-final { scan-assembler-times {\mlxvd2x\M|\mlxvx\M|\mlvx\M} 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-short.c new file mode 100644 index 00000000000..c5088ab177e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-short.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for vec_xl with short + inputs produce the right code. */ + +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector short, signed long long, short); +BUILD_VAR_TEST( test2, vector short, signed int, short); +BUILD_CST_TEST( test3, vector short, 12, short); + +BUILD_VAR_TEST( test4, vector short, signed long long, vector short); +BUILD_VAR_TEST( test5, vector short, signed int, vector short); +BUILD_CST_TEST( test6, vector short, 12, vector short); + +BUILD_VAR_TEST( test7, vector unsigned short, signed long long, unsigned short); +BUILD_VAR_TEST( test8, vector unsigned short, signed int, unsigned short); +BUILD_CST_TEST( test9, vector unsigned short, 12, unsigned short); + +BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short); +BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short); +BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short); + +/* { dg-final { scan-assembler-times {\mlxvw4x\M|\mlxvd2x\M|\mlxvx\M|\mlvx\M} 12 } } */