https://gcc.gnu.org/g:9e7eb3631d07a51155211383ba389e924f6ec0e1

commit 9e7eb3631d07a51155211383ba389e924f6ec0e1
Author: Michael Meissner <meiss...@linux.ibm.com>
Date:   Wed Nov 13 02:34:20 2024 -0500

    Add p-future target-supports.exp
    
    2024-11-13  Michael Meissner  <meiss...@linux.ibm.com>
    
    gcc/testsuite/
    
            * lib/target-supports.exp 
(check_effective_target_powerpc_future_ok):
            New target.
            (check_effective_target_powerpc_dense_math_ok): Likewise.

Diff:
---
 gcc/testsuite/lib/target-supports.exp | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index fd58682cae3b..e2504886d86b 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -7402,6 +7402,41 @@ proc check_effective_target_power10_ok { } {
     }
 }
 
+# Return 1 if this is a PowerPC target supporting -mcpu=future which enables
+# some potential new instructions.
+proc check_effective_target_powerpc_future_ok { } {
+       return [check_no_compiler_messages powerpc_future_ok object {
+           #ifndef _ARCH_PWR_FUTURE
+           #error "-mcpu=future is not supported"
+           #else
+           int dummy;
+           #endif
+       } "-mcpu=future"]
+}
+
+# Return 1 if this is a PowerPC target supporting -mcpu=future which enables
+# the dense math operations.
+proc check_effective_target_powerpc_dense_math_ok { } {
+    if { ([istarget powerpc*-*-*]) } {
+       return [check_no_compiler_messages powerpc_dense_math_ok object {
+           __vector_quad vq;
+           int main (void) {
+               #ifndef __DENSE_MATH__
+               #error "target does not have dense math support."
+               #else
+               /* Make sure we have dense math support.  */
+                 __vector_quad dmr;
+                 __asm__ ("dmsetaccz %A0" : "=wD" (dmr));
+                 vq = dmr;
+               #endif
+               return 0;
+           }
+       } "-mcpu=future"]
+    } else {
+       return 0;
+    }
+}
+
 # Return 1 if this is a PowerPC target supporting -mfloat128 via either
 # software emulation on power7/power8 systems or hardware support on power9.

Reply via email to