[gcc(refs/users/marxin/heads/opt-parse-enum-sanity)] PowerPC Add has_arch_pwr* checks

Martin Liska marxin@gcc.gnu.org
Tue Mar 17 15:56:34 GMT 2020


https://gcc.gnu.org/g:aa307bd027d4cd3af9d9c25f3e97c64735fee12d

commit aa307bd027d4cd3af9d9c25f3e97c64735fee12d
Author: Will Schmidt <will_schmidt@vnet.ibm.com>
Date:   Thu Feb 27 11:01:20 2020 -0600

    PowerPC Add has_arch_pwr* checks
    
    testsuite/
    
    2020-02-25 Will Schmidt  <will_schmidt@vnet.ibm.com>
    
          * lib/target_supports.exp (check_effective_target_has_arch_pwr5): New.
          (check_effective_target_has_arch_pwr6): New.
          (check_effective_target_has_arch_pwr7): New.
          (check_effective_target_has_arch_pwr8): New.
          (check_effective_target_has_arch_pwr9): New.
          * gcc.target/powerpc/pr92132-fp-1.c: Add target check.

Diff:
---
 gcc/testsuite/ChangeLog                         | 10 +++++
 gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c |  2 +-
 gcc/testsuite/lib/target-supports.exp           | 52 +++++++++++++++++++++++++
 3 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c7f1abd2467..b2a82be4658 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2020-02-27  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+	* lib/target_supports.exp (check_effective_target_has_arch_pwr5): New.
+	(check_effective_target_has_arch_pwr6): New.
+	(check_effective_target_has_arch_pwr7): New.
+	(check_effective_target_has_arch_pwr8): New.
+	(check_effective_target_has_arch_pwr9): New.
+	* gcc.target/powerpc/pr92132-fp-1.c: Add target check.
+
+
 2020-02-27  Bill Schmidt  <wschmidt@linux.ibm.com>
 
 	* gcc.target/powerpc/ppc64-abi-1.c: Compile with -mno-pcrel.
diff --git a/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c b/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c
index 1023e8cd9d8..c5cbb62ee73 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr92132-fp-1.c
@@ -294,4 +294,4 @@ main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 14 "vect" } } */
+/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 14 "vect" { target has_arch_pwr8 } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 9592c539c11..ca3895c2269 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5549,6 +5549,58 @@ proc check_effective_target_powerpc_p9modulo_ok { } {
     }
 }
 
+# return 1 if our compiler returns the ARCH_PWR defines with the options
+# as provided by the test.
+proc check_effective_target_has_arch_pwr5 { } {
+	return [check_no_compiler_messages arch_pwr5 assembly {
+		#ifndef _ARCH_PWR5
+		#error does not have power5 support.
+		#else
+		/* "has power5 support" */
+		#endif
+	}]
+}
+
+proc check_effective_target_has_arch_pwr6 { } {
+	return [check_no_compiler_messages arch_pwr6 assembly {
+		#ifndef _ARCH_PWR6
+		#error does not have power6 support.
+		#else
+		/* "has power6 support" */
+		#endif
+	}]
+}
+
+proc check_effective_target_has_arch_pwr7 { } {
+	return [check_no_compiler_messages arch_pwr7 assembly {
+		#ifndef _ARCH_PWR7
+		#error does not have power7 support.
+		#else
+		/* "has power7 support" */
+		#endif
+	}]
+}
+
+proc check_effective_target_has_arch_pwr8 { } {
+	return [check_no_compiler_messages arch_pwr8 assembly {
+		#ifndef _ARCH_PWR8
+		#error does not have power8 support.
+		#else
+		/* "has power8 support" */
+		#endif
+	}]
+}
+
+proc check_effective_target_has_arch_pwr9 { } {
+	return [check_no_compiler_messages arch_pwr9 assembly {
+		#ifndef _ARCH_PWR9
+		#error does not have power9 support.
+		#else
+		/* "has power9 support" */
+		#endif
+	}]
+}
+
 # Return 1 if this is a PowerPC target supporting -mfuture.
 # Limit this to 64-bit linux systems for now until other
 # targets support FUTURE.


More information about the Gcc-cvs mailing list