From 27e7087f51cef38da59c87e210af64f240a3ff23 Mon Sep 17 00:00:00 2001 From: Carl Love Date: Wed, 7 Dec 2016 16:21:16 +0000 Subject: [PATCH] builtins-3.c: Move built-in tests for P8 and P9 to their own test file. 2016-12-07 Carl Love * gcc.target/powerpc/builtins-3.c: Move built-in tests for P8 and P9 to their own test file. This allows precise constraints on the effective target and compile options. * gcc.target/powerpc/builtins-3-p8.c: New file for the vector compare P8 built-in tests. * gcc.target/powerpc/builtins-3-p9.c: New file for the vector compare P9 built-in tests. From-SVN: r243370 --- gcc/testsuite/ChangeLog | 10 ++++ .../gcc.target/powerpc/builtins-3-p8.c | 17 +++++++ .../gcc.target/powerpc/builtins-3-p9.c | 42 +++++++++++++++ gcc/testsuite/gcc.target/powerpc/builtins-3.c | 51 +++---------------- 4 files changed, 77 insertions(+), 43 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c create mode 100644 gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1d6195896dc..6153fe74d2d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2016-12-07 Carl Love + + * gcc.target/powerpc/builtins-3.c: Move built-in tests for P8 and + P9 to their own test file. This allows precise constraints on the + effective target and compile options. + * gcc.target/powerpc/builtins-3-p8.c: New file for the vector + compare P8 built-in tests. + * gcc.target/powerpc/builtins-3-p9.c: New file for the vector + compare P9 built-in tests. + 2016-12-07 Uros Bizjak * gcc.target/i386/pr77761.c: Require int128 effective target. diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c new file mode 100644 index 00000000000..e52795cc29b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mcpu=power8" } */ + +#include + +vector bool long long +test_eq_long_long (vector bool long long x, vector bool long long y) +{ + return vec_cmpeq (x, y); +} + +/* Expected test results: + + test_eq_long_long 1 vcmpequd inst */ + +/* { dg-final { scan-assembler-times "vcmpequd" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c new file mode 100644 index 00000000000..d846e29f62b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mcpu=power9" } */ + +#include + +vector bool char +test_ne_char (vector bool char x, vector bool char y) +{ + return vec_cmpne (x, y); +} + +vector bool short +test_ne_short (vector bool short x, vector bool short y) +{ + return vec_cmpne (x, y); +} + +vector bool int +test_ne_int (vector bool int x, vector bool int y) +{ + return vec_cmpne (x, y); +} + +vector bool long +test_ne_long (vector bool long x, vector bool long y) +{ + return vec_cmpne (x, y); +} + +/* Expected test results: + + test_ne_char 1 vcmpneb + test_ne_short 1 vcmpneh + test_ne_int 1 vcmpnew + test_ne_long 1 vcmpequd, 1 xxlnor inst */ + +/* { dg-final { scan-assembler-times "vcmpneb" 1 } } */ +/* { dg-final { scan-assembler-times "vcmpneh" 1 } } */ +/* { dg-final { scan-assembler-times "vcmpnew" 1 } } */ +/* { dg-final { scan-assembler-times "vcmpequd" 1 } } */ +/* { dg-final { scan-assembler-times "xxlnor" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-3.c b/gcc/testsuite/gcc.target/powerpc/builtins-3.c index 1a096541c8e..1d243ce5e49 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-3.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ /* { dg-options "-maltivec -mvsx" } */ #include @@ -22,48 +22,13 @@ test_eq_int (vector bool int x, vector bool int y) return vec_cmpeq (x, y); } -vector bool long -test_eq_long (vector bool long x, vector bool long y) -{ - return vec_cmpeq (x, y); -} - -vector bool char -test_ne_char (vector bool char x, vector bool char y) -{ - return vec_cmpne (x, y); -} - -vector bool short -test_ne_short (vector bool short x, vector bool short y) -{ - return vec_cmpne (x, y); -} - -vector bool int -test_ne_int (vector bool int x, vector bool int y) -{ - return vec_cmpne (x, y); -} - -vector bool long -test_ne_long (vector bool long x, vector bool long y) -{ - return vec_cmpne (x, y); -} -/* Note: vec_cmpne is implemented as vcmpeq and then NOT'ed - using the xxlnor instruction. +/* Expected test results: - Expected test results: - test_eq_char 1 vcmpeq inst - test_eq_short 1 vcmpeq inst - test_eq_int 1 vcmpeq inst - test_eq_long 1 vcmpeq inst - test_ne_char 1 vcmpeq, 1 xxlnor inst - test_ne_short 1 vcmpeq, 1 xxlnor inst - test_ne_int 1 vcmpeq, 1 xxlnor inst - test_ne_long 1 vcmpeq, 1 xxlnor inst */ + test_eq_char 1 vcmpequb inst + test_eq_short 1 vcmpequh inst + test_eq_int 1 vcmpequw inst */ -/* { dg-final { scan-assembler-times "vcmpeq" 8 } } */ -/* { dg-final { scan-assembler-times "xxlnor" 4 } } */ +/* { dg-final { scan-assembler-times "vcmpequb" 1 } } */ +/* { dg-final { scan-assembler-times "vcmpequh" 1 } } */ +/* { dg-final { scan-assembler-times "vcmpequw" 1 } } */ -- 2.30.2