public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add ppc_ieee128_ok target-supports proc
@ 2020-02-10 21:40 will schmidt
  2020-02-11  3:41 ` Segher Boessenkool
  0 siblings, 1 reply; 4+ messages in thread
From: will schmidt @ 2020-02-10 21:40 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool, David Edelsohn

Hi,
    
This adds a target_supports entry to check that the
_ieee128 keyword is understood by the target.
Also adds that require-effective-target check to the
existing pr92796 testcase.
    
Sniff tested on Linux (power6,power9) and AIX.
    
OK for master?

Thanks
-Will
    
[testsuite]
	* lib/target-supports.exp (check_effective_target_ppc_ieee128_ok): New.
	* gcc.target/powerpc/pr92796.c: Add
	require-effective-target ppc64_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..0154457 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2248,10 +2248,32 @@ 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 Darwin, AIX.
+	if { [istarget powerpc-*-eabi]
+	     || [istarget powerpc*-*-eabispe]
+	     || [istarget *-*-darwin*]
+	     || [istarget *-*-aix*] } {
+	    expr 0
+	} else {
+	    set options "-mvsx"
+	    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 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add ppc_ieee128_ok target-supports proc
  2020-02-10 21:40 [PATCH] Add ppc_ieee128_ok target-supports proc will schmidt
@ 2020-02-11  3:41 ` Segher Boessenkool
  2020-02-11 18:11   ` will schmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Segher Boessenkool @ 2020-02-11  3:41 UTC (permalink / raw)
  To: will schmidt; +Cc: gcc-patches, David Edelsohn

Hi!

On Mon, Feb 10, 2020 at 03:39:49PM -0600, will schmidt wrote:
> This adds a target_supports entry to check that the
> _ieee128 keyword is understood by the target.

(Two underscores, "__ieee128".)

> Also adds that require-effective-target check to the
> existing pr92796 testcase.

> +# See if the __ieee128 keyword is understood.
> +proc check_effective_target_ppc_ieee128_ok { } {
> +    return [check_cached_effective_target ppc_ieee128_ok {
> +	# disable on Darwin, AIX.
> +	if { [istarget powerpc-*-eabi]
> +	     || [istarget powerpc*-*-eabispe]
> +	     || [istarget *-*-darwin*]
> +	     || [istarget *-*-aix*] } {
> +	    expr 0

Do we need to exclude those two explicitly?  Why?  And why eabi?  And
you don't need eabispe either.

> +	} else {
> +	    set options "-mvsx"
> +	    check_runtime_nocache ppc_ieee128_ok {
> +		int main()
> +		{
> +		  __ieee128 a;
> +		  return 0;
> +		}
> +	    } $options
> +	}

Why do you use -mvsx while we actually need a superset of that?


Segher

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add ppc_ieee128_ok target-supports proc
  2020-02-11  3:41 ` Segher Boessenkool
@ 2020-02-11 18:11   ` will schmidt
  2020-02-11 18:28     ` Segher Boessenkool
  0 siblings, 1 reply; 4+ messages in thread
From: will schmidt @ 2020-02-11 18:11 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches, David Edelsohn

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 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add ppc_ieee128_ok target-supports proc
  2020-02-11 18:11   ` will schmidt
@ 2020-02-11 18:28     ` Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2020-02-11 18:28 UTC (permalink / raw)
  To: will schmidt; +Cc: gcc-patches, David Edelsohn

Hi!

On Tue, Feb 11, 2020 at 12:10:50PM -0600, will schmidt wrote:
> +# 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
> +	}
> +    }]
> +}

It would be better if you didn't need to special-case AIX here, if the
actual test would figure out it cannot do __ieee128 on AIX.

But, okay for trunk.  Thanks!


Segher

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-11 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 21:40 [PATCH] Add ppc_ieee128_ok target-supports proc will schmidt
2020-02-11  3:41 ` Segher Boessenkool
2020-02-11 18:11   ` will schmidt
2020-02-11 18:28     ` Segher Boessenkool

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).