This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Require OSXSAVE for AVX run-time tests


Hi,

OSXSAVE is needed for AVX run-time support. This patch adds the OSXSAVE
check for AVX run-time tests.  OK to install?

Thanks.


H.J.
--
2010-07-19  H.J. Lu  <hongjiu.lu@intel.com>

	* gcc.dg/compat/vector-1b_main.c (main): Require OSXSAVE for
	AVX support.
	* gcc.dg/compat/vector-2b_main.c (main): Likewise.
	* gcc.target/i386/aes-avx-check.h (main): Likewise.
	* gcc.target/i386/avx-check.h (main): Likewise.
	* gcc.target/i386/pclmul-avx-check.h (main): Likewise.
	* gcc.target/x86_64/abi/avx/avx-check.h (main): Likewise.

diff --git a/gcc/testsuite/gcc.dg/compat/vector-1b_main.c b/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
index fb5a5a9..43a4ccd 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
@@ -20,7 +20,7 @@ main ()
     return 0;
 
   /* Run AVX vector test only if host has AVX support.  */
-  if (ecx & bit_AVX)
+  if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
     vector_1_x ();
 
   exit (0);
diff --git a/gcc/testsuite/gcc.dg/compat/vector-2b_main.c b/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
index c5a9300..ec60208 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
@@ -20,7 +20,7 @@ main ()
     return 0;
 
   /* Run AVX vector test only if host has AVX support.  */
-  if (ecx & bit_AVX)
+  if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
     vector_2_x ();
 
   exit (0);
diff --git a/gcc/testsuite/gcc.target/i386/aes-avx-check.h b/gcc/testsuite/gcc.target/i386/aes-avx-check.h
index e91e881..36a038e 100644
--- a/gcc/testsuite/gcc.target/i386/aes-avx-check.h
+++ b/gcc/testsuite/gcc.target/i386/aes-avx-check.h
@@ -22,7 +22,8 @@ main ()
     return 0;
 
   /* Run AES + AVX test only if host has AES + AVX support.  */
-  if ((ecx & (bit_AVX | bit_AES)) == (bit_AVX | bit_AES))
+  if ((ecx & (bit_AVX | bit_OSXSAVE | bit_AES))
+      == (bit_AVX | bit_OSXSAVE | bit_AES))
     {
       do_test ();
 #ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/i386/avx-check.h b/gcc/testsuite/gcc.target/i386/avx-check.h
index 7736fc9..b15584a 100644
--- a/gcc/testsuite/gcc.target/i386/avx-check.h
+++ b/gcc/testsuite/gcc.target/i386/avx-check.h
@@ -20,7 +20,7 @@ main ()
     return 0;
 
   /* Run AVX test only if host has AVX support.  */
-  if (ecx & bit_AVX)
+  if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
     {
       do_test ();
 #ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h b/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h
index 550e499..750e25c 100644
--- a/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h
+++ b/gcc/testsuite/gcc.target/i386/pclmul-avx-check.h
@@ -22,7 +22,8 @@ main ()
     return 0;
 
   /* Run PCLMUL + AVX test only if host has PCLMUL + AVX support.  */
-  if ((ecx & (bit_AVX | bit_PCLMUL)) == (bit_AVX | bit_PCLMUL))
+  if ((ecx & (bit_AVX | bit_OSXSAVE | bit_PCLMUL))
+      == (bit_AVX | bit_OSXSAVE | bit_PCLMUL))
     {
       do_test ();
 #ifdef DEBUG
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h b/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
index 7f1f8f9..e66a27e 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/avx-check.h
@@ -12,7 +12,7 @@ main ()
     return 0;
 
   /* Run AVX test only if host has AVX support.  */
-  if (ecx & bit_AVX)
+  if ((ecx & (bit_AVX | bit_OSXSAVE)) == (bit_AVX | bit_OSXSAVE))
     {
       avx_test ();
 #ifdef DEBUG


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]