public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] s390: testsuite: Fix zero_bits_compound-1.c
@ 2024-04-30  8:32 Stefan Schulze Frielinghaus
  2024-05-01  4:32 ` Andreas Krebbel
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Schulze Frielinghaus @ 2024-04-30  8:32 UTC (permalink / raw)
  To: krebbel, gcc-patches; +Cc: Stefan Schulze Frielinghaus

Starting with r12-2731-g96146e61cd7aee we do not generate code like

_5 = (unsigned int) c_2(D);
i_6 = _5 << 8;
_7 = _5 << 20;
i_8 = i_6 | _7;

anymore but instead

_5 = (unsigned int) c_2(D);
_3 = _5 * 1048832;

which leads finally to slightly different assembly code where we
previously ended up for z10 or newer with

lr      %r1,%r2
sll     %r1,8
rosbg   %r1,%r2,32,43,20
llgfr   %r2,%r1
br      %r14

and now

lr      %r1,%r2
sll     %r1,12
ar      %r2,%r1
risbg   %r2,%r2,35,128+55,8
br      %r14

The zero-extend materializes via risbg for which the pattern contains an
"and" which is why the test fails.  Thus, instead of scanning for RTL
expressions rather scan for assembler instructions for s390.
---
 Ok for mainline?

 gcc/testsuite/gcc.dg/zero_bits_compound-1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/zero_bits_compound-1.c b/gcc/testsuite/gcc.dg/zero_bits_compound-1.c
index e71594911b2..f1e267e0fb0 100644
--- a/gcc/testsuite/gcc.dg/zero_bits_compound-1.c
+++ b/gcc/testsuite/gcc.dg/zero_bits_compound-1.c
@@ -39,4 +39,5 @@ unsigned long bar (unsigned char c)
 }
 
 /* Check that no pattern containing an AND expression was used.  */
-/* { dg-final { scan-assembler-not "\\(and:" } } */
+/* { dg-final { scan-assembler-not "\\(and:" { target { ! { s390*-*-* } } } } } */
+/* { dg-final { scan-assembler-not "\\tng?rk?\\t" { target { s390*-*-* } } } } */
-- 
2.44.0


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

* Re: [PATCH] s390: testsuite: Fix zero_bits_compound-1.c
  2024-04-30  8:32 [PATCH] s390: testsuite: Fix zero_bits_compound-1.c Stefan Schulze Frielinghaus
@ 2024-05-01  4:32 ` Andreas Krebbel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Krebbel @ 2024-05-01  4:32 UTC (permalink / raw)
  To: Stefan Schulze Frielinghaus, gcc-patches

On 4/30/24 10:32, Stefan Schulze Frielinghaus wrote:
> Starting with r12-2731-g96146e61cd7aee we do not generate code like
> 
> _5 = (unsigned int) c_2(D);
> i_6 = _5 << 8;
> _7 = _5 << 20;
> i_8 = i_6 | _7;
> 
> anymore but instead
> 
> _5 = (unsigned int) c_2(D);
> _3 = _5 * 1048832;
> 
> which leads finally to slightly different assembly code where we
> previously ended up for z10 or newer with
> 
> lr      %r1,%r2
> sll     %r1,8
> rosbg   %r1,%r2,32,43,20
> llgfr   %r2,%r1
> br      %r14
> 
> and now
> 
> lr      %r1,%r2
> sll     %r1,12
> ar      %r2,%r1
> risbg   %r2,%r2,35,128+55,8
> br      %r14
> 
> The zero-extend materializes via risbg for which the pattern contains an
> "and" which is why the test fails.  Thus, instead of scanning for RTL
> expressions rather scan for assembler instructions for s390.
> ---
>  Ok for mainline?

Ok. Thanks!

Andreas

> 
>  gcc/testsuite/gcc.dg/zero_bits_compound-1.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/zero_bits_compound-1.c b/gcc/testsuite/gcc.dg/zero_bits_compound-1.c
> index e71594911b2..f1e267e0fb0 100644
> --- a/gcc/testsuite/gcc.dg/zero_bits_compound-1.c
> +++ b/gcc/testsuite/gcc.dg/zero_bits_compound-1.c
> @@ -39,4 +39,5 @@ unsigned long bar (unsigned char c)
>  }
>  
>  /* Check that no pattern containing an AND expression was used.  */
> -/* { dg-final { scan-assembler-not "\\(and:" } } */
> +/* { dg-final { scan-assembler-not "\\(and:" { target { ! { s390*-*-* } } } } } */
> +/* { dg-final { scan-assembler-not "\\tng?rk?\\t" { target { s390*-*-* } } } } */


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

end of thread, other threads:[~2024-05-01  4:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30  8:32 [PATCH] s390: testsuite: Fix zero_bits_compound-1.c Stefan Schulze Frielinghaus
2024-05-01  4:32 ` Andreas Krebbel

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