Patch V10 #9 is patch V7 #5 that was redone.  This patch adds new effective
target options for PowerPC.  I have changed this patch to look at the code
generated by the compiler to see if prefixed adddressing or PC-relative
addressing is used for -mcpu=future.  This patch needs patch V10 #8 installed
to enable the prefixed addressing and PC-relative tests.

In patch V10 #9, I did not modify the existing test
(check_effective_target_powerpc_future_ok).  As we discussed, this test should
really test whether a non-prefixed instruction is generated to allow for
targets that might support -mcpu=future but not enable prefixed addressing.
However, at present the only instructions being submitted are prefixed
instructions.  So this will have to wait until we get further down the road
with 'future' instructions.

I have bootstrapped a little endian power8 compiler and ran make check with no
regressions.  In addition with this patch installed, the new tests now run as
expected with these changes.  Can I check this in (this needs patch V10 #8 to
be installed to enable the tests).

2019-12-11  Michael Meissner  <meiss...@linux.ibm.com>

        * lib/target-supports.exp (check_effective_target_powerpc_pcrel):
        New target for PowerPC -mcpu=future support.
        (check_effective_target_powerpc_prefixed_addr): New target for
        PowerPC -mcpu=future support.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp       (revision 279141)
+++ gcc/testsuite/lib/target-supports.exp       (working copy)
@@ -2161,6 +2161,23 @@ proc check_p9modulo_hw_available { } {
     }]
 }
 
+# Return 1 if the target generates PC-relative instructions automatically
+proc check_effective_target_powerpc_pcrel { } {
+    return [check_no_messages_and_pattern powerpc_pcrel \
+       {\mpld\M.*[@]pcrel} assembly {
+           static long s;
+           long *p = &s;
+           long foo (void) { return s; }
+       } {-O2 -mcpu=future}]
+}
+
+# Return 1 if the target generates prefixed instructions automatically
+proc check_effective_target_powerpc_prefixed_addr { } {
+    return [check_no_messages_and_pattern powerpc_prefixed_addr \
+       {\mpld\M} assembly {
+           long foo (long *p) { return p[0x12345]; }
+       } {-O2 -mcpu=future}]
+}
 
 # 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

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to