public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: will schmidt <will_schmidt@vnet.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org, David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] Add ppc_ieee128_ok target-supports proc
Date: Tue, 11 Feb 2020 18:11:00 -0000	[thread overview]
Message-ID: <4c09df60d57b6d85040bb6f29e3ffc4309336264.camel@vnet.ibm.com> (raw)
In-Reply-To: <20200211034133.GS22482@gate.crashing.org>

Hi,

Thanks for the feedback.  Updated below.

[v2]
- removed some explicit disables that were not necessary.
- updated options qualifier for the proc.

[V1]
  Add a target_supports entry to check that the __ieee128 keyword
is understood by the target.
Also add a dg-requires check to the existing pr92796 testcase.

Sniff tested on Linux (power6,power9) and AIX.

OK for master?
    
    [testsuite]
    	* lib/target-supports.exp (check_effective_target_ppc_ieee128_ok): New.
    	* gcc.target/powerpc/pr92796.c: Add a require-effective-target
    	statement for ppc_ieee128_ok.

diff --git a/gcc/testsuite/gcc.target/powerpc/pr92796.c b/gcc/testsuite/gcc.target/powerpc/pr92796.c
index aa15b2d..da4b6a4 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr92796.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr92796.c
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fstack-protector-strong -mcpu=power8" } */
+/* { dg-require-effective-target ppc_ieee128_ok } */
 
 typedef union
 {
   __ieee128 a;
   int b;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index d3b2798..fb177c5 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2248,10 +2248,29 @@ proc check_ppc_float128_hw_available { } {
 	    } $options
 	}
     }]
 }
 
+# See if the __ieee128 keyword is understood.
+proc check_effective_target_ppc_ieee128_ok { } {
+    return [check_cached_effective_target ppc_ieee128_ok {
+	# disable on AIX.
+	if { [istarget *-*-aix*] } {
+	    expr 0
+	} else {
+	    set options "-mfloat128"
+	    check_runtime_nocache ppc_ieee128_ok {
+		int main()
+		{
+		  __ieee128 a;
+		  return 0;
+		}
+	    } $options
+	}
+    }]
+}
+
 # Return 1 if the target supports executing VSX instructions, 0
 # otherwise.  Cache the result.
 
 proc check_vsx_hw_available { } {
     return [check_cached_effective_target vsx_hw_available {

  reply	other threads:[~2020-02-11 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 21:40 will schmidt
2020-02-11  3:41 ` Segher Boessenkool
2020-02-11 18:11   ` will schmidt [this message]
2020-02-11 18:28     ` Segher Boessenkool

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=4c09df60d57b6d85040bb6f29e3ffc4309336264.camel@vnet.ibm.com \
    --to=will_schmidt@vnet.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.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).