public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Segher Boessenkool <segher@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7006] rs6000/testsuite: Return 0 for powerpc_altivec_ok on other targets
Date: Wed,  2 Feb 2022 20:22:16 +0000 (GMT)	[thread overview]
Message-ID: <20220202202216.DEC3D385783A@sourceware.org> (raw)

https://gcc.gnu.org/g:14d642df2b3f0d981fd7c0d3f832b26942c49b85

commit r12-7006-g14d642df2b3f0d981fd7c0d3f832b26942c49b85
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Wed Feb 2 20:15:46 2022 +0000

    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.

Diff:
---
 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 cffcdb5f049..4463cc8d7ed 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


                 reply	other threads:[~2022-02-02 20:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220202202216.DEC3D385783A@sourceware.org \
    --to=segher@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).