diff mbox series

[3/3,rs6000] Enable x86-compat vector intrinsics testing

Message ID 4d64efdb-637d-7c4c-ac7f-bed526e3a689@us.ibm.com
State New
Headers show
Series x86-compat vector intrinsics fixes for BE, 32bit | expand

Commit Message

Paul A. Clarke Dec. 4, 2018, 3 p.m. UTC
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.


--
PC

Comments

Segher Boessenkool Dec. 4, 2018, 10:08 p.m. UTC | #1
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
diff mbox series

Patch

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;
 }