From 14d642df2b3f0d981fd7c0d3f832b26942c49b85 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Wed, 2 Feb 2022 20:15:46 +0000 Subject: [PATCH] rs6000/testsuite: Return 0 for powerpc_altivec_ok on other targets 2022-02-02 Segher Boessenkool gcc/testsuite/ * lib/target-supports.exp (check_effective_target_powerpc_altivec_ok): Return 0 if the target is not Power. Restructure and add some comments. --- gcc/testsuite/lib/target-supports.exp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index cffcdb5..4463cc8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6181,21 +6181,21 @@ proc check_effective_target_powerpc_sqrt { } { # Return 1 if this is a PowerPC target supporting -maltivec. proc check_effective_target_powerpc_altivec_ok { } { - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget rs6000-*-*] } { - # AltiVec is not supported on AIX before 5.3. - if { [istarget powerpc*-*-aix4*] - || [istarget powerpc*-*-aix5.1*] - || [istarget powerpc*-*-aix5.2*] } { - return 0 - } - return [check_no_compiler_messages powerpc_altivec_ok object { - int dummy; - } "-maltivec"] - } else { - return 0 - } + # Not PowerPC, then not ok + if { !([istarget powerpc*-*-*] || [istarget rs6000-*-*]) } { return 0 } + + # Paired Single, then not ok + if { [istarget powerpc-*-linux*paired*] } { return 0 } + + # AltiVec is not supported on AIX before 5.3. + if { [istarget powerpc*-*-aix4*] + || [istarget powerpc*-*-aix5.1*] + || [istarget powerpc*-*-aix5.2*] } { return 0 } + + # Return true iff compiling with -maltivec does not error. + return [check_no_compiler_messages powerpc_altivec_ok object { + int dummy; + } "-maltivec"] } # Return 1 if this is a PowerPC target supporting -mpower8-vector -- 2.7.4