public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 3/3][rs6000] Enable x86-compat vector intrinsics testing
@ 2018-12-04 15:01 Paul Clarke
  2018-12-04 22:08 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Clarke @ 2018-12-04 15:01 UTC (permalink / raw)
  To: gcc-patches, Segher Boessenkool

The testsuite tests for the compatibility implementations of x86 vector
intrinsics for "powerpc" had been inadvertently made to PASS
without actually running the test code.

This patch removes the code which kept the tests from running the actual
test code.

2018-12-03  Paul A. Clarke  <pc@us.ibm.com>

[gcc/testsuite]

	PR target/88316
	* gcc.target/powerpc/bmi-check.h: Remove test for
	__BUILTIN_CPU_SUPPORTS__, thereby enabling test code to run.
	* gcc.target/powerpc/bmi2-check.h: Likewise.
	* gcc.target/powerpc/mmx-check.h: Likewise.
	* gcc.target/powerpc/sse-check.h: Likewise.
	* gcc.target/powerpc/sse2-check.h: Likewise.
	* gcc.target/powerpc/sse3-check.h: Likewise.
	* gcc.target/powerpc/ssse3-check.h: Likewise.

Index: gcc/testsuite/gcc.target/powerpc/bmi-check.h
===================================================================
diff --git a/trunk/gcc/testsuite/gcc.target/powerpc/bmi-check.h b/trunk/gcc/testsuite/gcc.target/powerpc/bmi-check.h
--- a/trunk/gcc/testsuite/gcc.target/powerpc/bmi-check.h	(revision 266157)
+++ b/trunk/gcc/testsuite/gcc.target/powerpc/bmi-check.h	(working copy)
@@ -13,19 +13,9 @@ do_test (void)
 int
 main ()
 {
-#ifdef __BUILTIN_CPU_SUPPORTS__
-  /* Need 64-bit for 64-bit longs as single instruction.  */
-  if ( __builtin_cpu_supports ("ppc64") )
-    {
-      do_test ();
+  do_test ();
 #ifdef DEBUG
-      printf ("PASSED\n");
+  printf ("PASSED\n");
 #endif
-    }
-#ifdef DEBUG
-  else
-    printf ("SKIPPED\n");
-#endif
-#endif /* __BUILTIN_CPU_SUPPORTS__ */
   return 0;
 }
Index: gcc/testsuite/gcc.target/powerpc/bmi2-check.h
===================================================================
diff --git a/trunk/gcc/testsuite/gcc.target/powerpc/bmi2-check.h b/trunk/gcc/testsuite/gcc.target/powerpc/bmi2-check.h
--- a/trunk/gcc/testsuite/gcc.target/powerpc/bmi2-check.h	(revision 266157)
+++ b/trunk/gcc/testsuite/gcc.target/powerpc/bmi2-check.h	(working copy)
@@ -13,22 +13,10 @@ do_test (void)
 int
 main ()
 {
-#ifdef __BUILTIN_CPU_SUPPORTS__
-  /* The BMI2 test for pext test requires the Bit Permute doubleword
-     (bpermd) instruction added in PowerISA 2.06 along with the VSX
-     facility.  So we can test for arch_2_06.  */
-  if ( __builtin_cpu_supports ("arch_2_06") )
-    {
-      do_test ();
+  do_test ();
 #ifdef DEBUG
-      printf ("PASSED\n");
+  printf ("PASSED\n");
 #endif
-    }
-#ifdef DEBUG
-  else
-    printf ("SKIPPED\n");
-#endif
-#endif /* __BUILTIN_CPU_SUPPORTS__ */
   return 0;
 }
 
Index: gcc/testsuite/gcc.target/powerpc/mmx-check.h
===================================================================
diff --git a/trunk/gcc/testsuite/gcc.target/powerpc/mmx-check.h b/trunk/gcc/testsuite/gcc.target/powerpc/mmx-check.h
--- a/trunk/gcc/testsuite/gcc.target/powerpc/mmx-check.h	(revision 266157)
+++ b/trunk/gcc/testsuite/gcc.target/powerpc/mmx-check.h	(working copy)
@@ -13,23 +13,9 @@ do_test (void)
 int
 main ()
   {
-#ifdef __BUILTIN_CPU_SUPPORTS__
-    /* Many MMX intrinsics are simpler / faster to implement by
-       transferring the __m64 (long int) to vector registers for SIMD
-       operations.  To be efficient we also need the direct register
-       transfer instructions from POWER8.  So we can test for
-       arch_2_07.  */
-    if ( __builtin_cpu_supports ("arch_2_07") )
-      {
-	do_test ();
+    do_test ();
 #ifdef DEBUG
-	printf ("PASSED\n");
+    printf ("PASSED\n");
 #endif
-      }
-#ifdef DEBUG
-    else
-      printf ("SKIPPED\n");
-#endif
-#endif /* __BUILTIN_CPU_SUPPORTS__ */
     return 0;
   }
Index: gcc/testsuite/gcc.target/powerpc/sse-check.h
===================================================================
diff --git a/trunk/gcc/testsuite/gcc.target/powerpc/sse-check.h b/trunk/gcc/testsuite/gcc.target/powerpc/sse-check.h
--- a/trunk/gcc/testsuite/gcc.target/powerpc/sse-check.h	(revision 266157)
+++ b/trunk/gcc/testsuite/gcc.target/powerpc/sse-check.h	(working copy)
@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include "m128-check.h"
 
-#define DEBUG 1
+// #define DEBUG 1
 
 #define TEST sse_test
 
@@ -17,25 +17,10 @@ do_test (void)
 int
 main ()
   {
-#ifdef __BUILTIN_CPU_SUPPORTS__
-    /* Most SSE intrinsic operations can be implemented via VMX
-       instructions, but some operations may be faster / simpler
-       using the POWER8 VSX instructions.  This is especially true
-       when we are transferring / converting to / from __m64 types.
-       The direct register transfer instructions from POWER8 are
-       especially important.  So we test for arch_2_07.  */
-    if ( __builtin_cpu_supports ("arch_2_07") )
-      {
-	do_test ();
+    do_test ();
 #ifdef DEBUG
-	printf ("PASSED\n");
+    printf ("PASSED\n");
 #endif
-      }
-#ifdef DEBUG
-    else
-    printf ("SKIPPED\n");
-#endif
-#endif /* __BUILTIN_CPU_SUPPORTS__ */
     return 0;
   }
 
Index: gcc/testsuite/gcc.target/powerpc/sse2-check.h
===================================================================
diff --git a/trunk/gcc/testsuite/gcc.target/powerpc/sse2-check.h b/trunk/gcc/testsuite/gcc.target/powerpc/sse2-check.h
--- a/trunk/gcc/testsuite/gcc.target/powerpc/sse2-check.h	(revision 266157)
+++ b/trunk/gcc/testsuite/gcc.target/powerpc/sse2-check.h	(working copy)
@@ -9,8 +9,6 @@
 /* define DEBUG replace abort with printf on error.  */
 //#define DEBUG 1
 
-#if 1
-
 #define TEST sse2_test
 
 static void sse2_test (void);
@@ -25,28 +23,9 @@ do_test (void)
 int
 main ()
   {
-#ifdef __BUILTIN_CPU_SUPPORTS__
-    /* Most SSE2 (vector double) intrinsic operations require VSX
-       instructions, but some operations may need only VMX
-       instructions.  This also true for SSE2 scalar doubles as they
-       imply that "other half" of the vector remains unchanged or set
-       to zeros.  The VSX scalar operations leave ther "other half"
-       undefined, and require additional merge operations.
-       Some conversions (to/from integer) need the  direct register
-       transfer instructions from POWER8 for best performance.
-       So we test for arch_2_07.  */
-    if ( __builtin_cpu_supports ("arch_2_07") )
-      {
-	do_test ();
+    do_test ();
 #ifdef DEBUG
-	printf ("PASSED\n");
+    printf ("PASSED\n");
 #endif
-      }
-#ifdef DEBUG
-    else
-    printf ("SKIPPED\n");
-#endif
-#endif /* __BUILTIN_CPU_SUPPORTS__ */
     return 0;
   }
-#endif
Index: gcc/testsuite/gcc.target/powerpc/sse3-check.h
===================================================================
diff --git a/trunk/gcc/testsuite/gcc.target/powerpc/sse3-check.h b/trunk/gcc/testsuite/gcc.target/powerpc/sse3-check.h
--- a/trunk/gcc/testsuite/gcc.target/powerpc/sse3-check.h	(revision 266157)
+++ b/trunk/gcc/testsuite/gcc.target/powerpc/sse3-check.h	(working copy)
@@ -20,24 +20,9 @@ do_test (void)
 int
 main ()
 {
-#ifdef __BUILTIN_CPU_SUPPORTS__
-  /* Most SSE intrinsic operations can be implemented via VMX
-     instructions, but some operations may be faster / simpler
-     using the POWER8 VSX instructions.  This is especially true
-     when we are transferring / converting to / from __m64 types.
-     The direct register transfer instructions from POWER8 are
-     especially important.  So we test for arch_2_07.  */
-  if (__builtin_cpu_supports ("arch_2_07"))
-    {
-      do_test ();
+  do_test ();
 #ifdef DEBUG
-      printf ("PASSED\n");
+  printf ("PASSED\n");
 #endif
-    }
-#ifdef DEBUG
-  else
-    printf ("SKIPPED\n");
-#endif
-#endif /* __BUILTIN_CPU_SUPPORTS__ */
   return 0;
 }
Index: gcc/testsuite/gcc.target/powerpc/ssse3-check.h
===================================================================
diff --git a/trunk/gcc/testsuite/gcc.target/powerpc/ssse3-check.h b/trunk/gcc/testsuite/gcc.target/powerpc/ssse3-check.h
--- a/trunk/gcc/testsuite/gcc.target/powerpc/ssse3-check.h	(revision 266157)
+++ b/trunk/gcc/testsuite/gcc.target/powerpc/ssse3-check.h	(working copy)
@@ -19,24 +19,9 @@ do_test (void)
 int
 main ()
 {
-#ifdef __BUILTIN_CPU_SUPPORTS__
-  /* Most SSE intrinsic operations can be implemented via VMX
-     instructions, but some operations may be faster / simpler
-     using the POWER8 VSX instructions.  This is especially true
-     when we are transferring / converting to / from __m64 types.
-     The direct register transfer instructions from POWER8 are
-     especially important.  So we test for arch_2_07.  */
-  if (__builtin_cpu_supports ("arch_2_07"))
-    {
-      do_test ();
+  do_test ();
 #ifdef DEBUG
-      printf ("PASSED\n");
+  printf ("PASSED\n");
 #endif
-    }
-#ifdef DEBUG
-  else
-    printf ("SKIPPED\n");
-#endif
-#endif /* __BUILTIN_CPU_SUPPORTS__ */
   return 0;
 }

--
PC

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3][rs6000] Enable x86-compat vector intrinsics testing
  2018-12-04 15:01 [PATCH 3/3][rs6000] Enable x86-compat vector intrinsics testing Paul Clarke
@ 2018-12-04 22:08 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2018-12-04 22:08 UTC (permalink / raw)
  To: Paul Clarke; +Cc: gcc-patches

On Tue, Dec 04, 2018 at 09:00:18AM -0600, Paul Clarke wrote:
> The testsuite tests for the compatibility implementations of x86 vector
> intrinsics for "powerpc" had been inadvertently made to PASS
> without actually running the test code.
> 
> This patch removes the code which kept the tests from running the actual
> test code.

So everything just works this way?  Or do many tests fail nastily if you
run it on too old hardware?

> 2018-12-03  Paul A. Clarke  <pc@us.ibm.com>
> 
> [gcc/testsuite]
> 
> 	PR target/88316
> 	* gcc.target/powerpc/bmi-check.h: Remove test for
> 	__BUILTIN_CPU_SUPPORTS__, thereby enabling test code to run.
> 	* gcc.target/powerpc/bmi2-check.h: Likewise.
> 	* gcc.target/powerpc/mmx-check.h: Likewise.
> 	* gcc.target/powerpc/sse-check.h: Likewise.
> 	* gcc.target/powerpc/sse2-check.h: Likewise.
> 	* gcc.target/powerpc/sse3-check.h: Likewise.
> 	* gcc.target/powerpc/ssse3-check.h: Likewise.

Okay for trunk if it all Just Works.  Thanks!

(So do test it on at least a p7, maybe a p6?)


Segher

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-04 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04 15:01 [PATCH 3/3][rs6000] Enable x86-compat vector intrinsics testing Paul Clarke
2018-12-04 22:08 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).