aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorCarl Love <cel@us.ibm.com>2016-12-07 16:21:16 +0000
committerCarl Love <carll@gcc.gnu.org>2016-12-07 16:21:16 +0000
commit27e7087f51cef38da59c87e210af64f240a3ff23 (patch)
tree9d68b8a2562e16716509d7f50f98e9151cf35588 /gcc
parent4dfad1fb0d38174a3c51a4762ab690a11f966212 (diff)
downloadgcc-27e7087f51cef38da59c87e210af64f240a3ff23.zip
gcc-27e7087f51cef38da59c87e210af64f240a3ff23.tar.gz
gcc-27e7087f51cef38da59c87e210af64f240a3ff23.tar.bz2
builtins-3.c: Move built-in tests for P8 and P9 to their own test file.
2016-12-07 Carl Love <cel@us.ibm.com> * 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-3-p8.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-3-p9.c42
-rw-r--r--gcc/testsuite/gcc.target/powerpc/builtins-3.c51
4 files changed, 77 insertions, 43 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1d61958..6153fe7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2016-12-07 Carl Love <cel@us.ibm.com>
+
+ * 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 <ubizjak@gmail.com>
* 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 0000000..e52795c
--- /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 <altivec.h>
+
+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 0000000..d846e29
--- /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 <altivec.h>
+
+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 1a09654..1d243ce 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 <altivec.h>
@@ -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 } } */