public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] PowerPC: PowerPC tests: Add prefixed/pcrel tests.
@ 2020-08-22 22:17 Giuliano Belinassi
  0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-22 22:17 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4e74f42aafe6a5475d84e5c64c4d2ad4e03af913

commit 4e74f42aafe6a5475d84e5c64c4d2ad4e03af913
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Jun 9 14:48:24 2020 -0400

    PowerPC: PowerPC tests: Add prefixed/pcrel tests.
    
    testsuite/
    2020-06-09  Michael Meissner  <meissner@linux.ibm.com>
    
            * lib/target-supports.exp (check_effective_target_powerpc_pcrel):
            New.
            (check_effective_target_powerpc_prefixed_addr): New.

Diff:
---
 gcc/testsuite/lib/target-supports.exp | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index b335108358d..a595042b36e 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2163,6 +2163,25 @@ proc check_p9vector_hw_available { } {
     }]
 }
 
+# Return 1 if the PowerPC target generates PC-relative instructions
+# automatically for targets that support PC-relative instructions.
+proc check_effective_target_powerpc_pcrel { } {
+    return [check_no_messages_and_pattern powerpc_pcrel \
+	{\mpla\M} assembly {
+	    static unsigned short s;
+	    unsigned short *p_foo (void) { return &s; }
+	} {-O2 -mcpu=future}]
+}
+
+# Return 1 if the PowerPC target generates prefixed instructions automatically
+# for targets that support prefixed instructions.
+proc check_effective_target_powerpc_prefixed_addr { } {
+    return [check_no_messages_and_pattern powerpc_prefixed_addr \
+	{\mplwz\M} assembly {
+	    unsigned int foo (unsigned int *p) { return p[0x12345]; }
+	} {-O2 -mcpu=future}]
+}
+
 # Return 1 if the target supports executing power9 modulo instructions, 0
 # otherwise.  Cache the result.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-22 22:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 22:17 [gcc/devel/autopar_devel] PowerPC: PowerPC tests: Add prefixed/pcrel tests Giuliano Belinassi

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