diff mbox series

rs6000: Update bswap64-4 test to reflect actual results

Message ID 177c70ffd4bdda68304956c5e04efae50e9a03da.camel@vnet.ibm.com
State New
Headers show
Series rs6000: Update bswap64-4 test to reflect actual results | expand

Commit Message

Li, Pan2 via Gcc-patches March 24, 2020, 6:26 p.m. UTC
rs6000: Update bswap64-4 test to reflect actual results

Hi,
  Update existing testcase powerpc/bswap64-4.c to
reflect that we generate ldbrx and stdbrx instructions
for newer cpu targets.  This is in contrast to the 
pair of lwbrx and stwbrx instructions that are
generated with older cpu targets.

OK for mainline? 
Thanks,
-Will

    
2020-03-24  Will Schmidt  <will_schmidt@vnet.ibm.com>
    
testsuite/
	* gcc.target/powerpc/bswap64-4.c: Update scan-assembler
	expected results.

Comments

Segher Boessenkool March 26, 2020, 10:03 p.m. UTC | #1
Hi!

On Tue, Mar 24, 2020 at 01:26:25PM -0500, will schmidt wrote:
>   Update existing testcase powerpc/bswap64-4.c to
> reflect that we generate ldbrx and stdbrx instructions
> for newer cpu targets.  This is in contrast to the 
> pair of lwbrx and stwbrx instructions that are
> generated with older cpu targets.

So, this has always been broken for p7 and later?  Or what changed?

Okay for trunk.  Thanks!


Segher


> testsuite/
> 	* gcc.target/powerpc/bswap64-4.c: Update scan-assembler
> 	expected results.
Li, Pan2 via Gcc-patches March 27, 2020, 2:28 p.m. UTC | #2
On Thu, 2020-03-26 at 17:03 -0500, Segher Boessenkool wrote:
> Hi!
> 
> On Tue, Mar 24, 2020 at 01:26:25PM -0500, will schmidt wrote:
> >   Update existing testcase powerpc/bswap64-4.c to
> > reflect that we generate ldbrx and stdbrx instructions
> > for newer cpu targets.  This is in contrast to the 
> > pair of lwbrx and stwbrx instructions that are
> > generated with older cpu targets.
> 
> So, this has always been broken for p7 and later?  Or what changed?

I believe this test has always been broken.  It gets called out as
UNSUPPORTED in most of our environments, (requires -m32) so we
typically don't see it.   I noticed it during a test result review of
one of the other patches.

P8BE before:
FAIL: gcc.target/powerpc/bswap64-4.c scan-assembler-times lwbrx 2
P8BE with patch:
PASS: gcc.target/powerpc/bswap64-4.c scan-assembler-times ldbrx 1

P8LE  (and basically everywhere other environment I have handy)
UNSUPPORTED: gcc.target/powerpc/bswap64-4.c

> 
> Okay for trunk.  Thanks!

thanks    
-Will

> 
> 
> Segher
> 
> 
> > testsuite/
> > 	* gcc.target/powerpc/bswap64-4.c: Update scan-assembler
> > 	expected results.
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/bswap64-4.c b/gcc/testsuite/gcc.target/powerpc/bswap64-4.c
index 1f5ac0e..a3c0553 100644
--- a/gcc/testsuite/gcc.target/powerpc/bswap64-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/bswap64-4.c
@@ -1,10 +1,12 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
 /* { dg-options "-O2 -mpowerpc64" } */
 /* { dg-require-effective-target ilp32 } */
-/* { dg-final { scan-assembler-times "lwbrx" 2 } } */
-/* { dg-final { scan-assembler-times "stwbrx" 2 } } */
+/* { dg-final { scan-assembler-times "lwbrx" 2 { target { ! has_arch_pwr7 } } } } */
+/* { dg-final { scan-assembler-times "stwbrx" 2 { target { ! has_arch_pwr7 } } } } */
+/* { dg-final { scan-assembler-times "ldbrx" 1 { target has_arch_pwr7 } } } */
+/* { dg-final { scan-assembler-times "stdbrx" 1 { target has_arch_pwr7 } } } */
 
 long long swap_load (long long *a) { return __builtin_bswap64 (*a); }
 long long swap_reg (long long a) { return __builtin_bswap64 (a); }
 void swap_store (long long *a, long long b) { *a = __builtin_bswap64 (b); }