public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Add target supports for "future" system
@ 2019-05-30  3:55 Bill Schmidt
  2019-05-30 19:32 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Schmidt @ 2019-05-30  3:55 UTC (permalink / raw)
  To: GCC Patches; +Cc: Segher Boessenkool

Hi,

This patch from Mike Meissner adds procs to target-supports.exp to support -mcpu=future.

Tested in conjunction with the next patch (test cases) with no problems.
Is this okay for trunk?

Thanks,
Bill


2019-05-29  Michael Meissner  <meissner@linux.ibm.com>

	* lib/target-supports.exp (check_powerpc_future_hw_available):
	New.
	(check_effective_target_powerpc_future_ok): New.


diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 3bd6e815715..982ec8ccc09 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2140,6 +2140,25 @@ proc check_p9modulo_hw_available { } {
     }]
 }
 
+
+# Return 1 if the target supports executing FUTURE instructions, 0 otherwise.
+# Cache the result.  It is assumed that if a simulator does not support the
+# FUTURE instructions, that it will generate an error and this test will fail.
+
+proc check_powerpc_future_hw_available { } {
+    return [check_cached_effective_target powerpc_future_hw_available {
+	check_runtime_nocache powerpc_future_hw_available {
+	    int main()
+	    {
+		/* Set e first and use +r to check if pli actually works.  */
+		long e = -1;
+		asm ("pli %0,%1" : "+r" (e) : "n" (0x12345));
+		return (e == 0x12345);
+	    }
+	} "-mfuture"
+    }]
+}
+
 # Return 1 if the target supports executing __float128 on PowerPC via software
 # emulation, 0 otherwise.  Cache the result.
 
@@ -5123,6 +5142,24 @@ proc check_effective_target_powerpc_p9modulo_ok { } {
     }
 }
 
+# Return 1 if this is a PowerPC target supporting -mfuture.
+# Limit this to 64-bit linux systems for now until other
+# targets support FUTURE.
+
+proc check_effective_target_powerpc_future_ok { } {
+    if { ([istarget powerpc64*-*-linux*]) } {
+	return [check_no_compiler_messages powerpc_future_ok object {
+	    int main (void) {
+		long e;
+		asm ("pli %0,%1" : "=r" (e) : "n" (0x12345));
+		return e;
+	    }
+	} "-mfuture"]
+    } else {
+	return 0
+    }
+}
+
 # Return 1 if this is a PowerPC target supporting -mfloat128 via either
 # software emulation on power7/power8 systems or hardware support on power9.
 

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

* Re: [PATCH] rs6000: Add target supports for "future" system
  2019-05-30  3:55 [PATCH] rs6000: Add target supports for "future" system Bill Schmidt
@ 2019-05-30 19:32 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2019-05-30 19:32 UTC (permalink / raw)
  To: Bill Schmidt; +Cc: GCC Patches

On Wed, May 29, 2019 at 10:52:38PM -0500, Bill Schmidt wrote:
> 	* lib/target-supports.exp (check_powerpc_future_hw_available):
> 	New.

That fits on one line just fine?

> +# Return 1 if this is a PowerPC target supporting -mfuture.
> +# Limit this to 64-bit linux systems for now until other
> +# targets support FUTURE.
> +
> +proc check_effective_target_powerpc_future_ok { } {
> +    if { ([istarget powerpc64*-*-linux*]) } {

It should be limited to powerpc64le-*-linux, or at least to ELFv2, right?

Not that that should matter at all: you pass -mfuture, and the compiler
will not allow that on unsupported configurations anyway (right? :-) )

But, okay for trunk.  Thanks!


Segher

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

end of thread, other threads:[~2019-05-30 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-30  3:55 [PATCH] rs6000: Add target supports for "future" system Bill Schmidt
2019-05-30 19:32 ` 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).