diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2022-02-02 20:15:46 +0000 |
---|---|---|
committer | Segher Boessenkool <segher@kernel.crashing.org> | 2022-02-02 20:21:30 +0000 |
commit | 14d642df2b3f0d981fd7c0d3f832b26942c49b85 (patch) | |
tree | 8656c96cd2a8eef87efdcd8e2473bd3293be664e | |
parent | 2905e1af94519b7ba3c43a57af8a7d5e10815950 (diff) | |
download | gcc-14d642df2b3f0d981fd7c0d3f832b26942c49b85.zip gcc-14d642df2b3f0d981fd7c0d3f832b26942c49b85.tar.gz gcc-14d642df2b3f0d981fd7c0d3f832b26942c49b85.tar.bz2 |
rs6000/testsuite: Return 0 for powerpc_altivec_ok on other targets
2022-02-02 Segher Boessenkool <segher@kernel.crashing.org>
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.
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 30 |
1 files 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 |