public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9450] s390: Fix tests rosbg_si_srl and rxsbg_si_srl
@ 2024-03-13 10:06 Stefan Schulze Frielinghaus
  0 siblings, 0 replies; only message in thread
From: Stefan Schulze Frielinghaus @ 2024-03-13 10:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a63fb786f8564880c91a30b99fda6d8a44adf81d

commit r14-9450-ga63fb786f8564880c91a30b99fda6d8a44adf81d
Author: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Date:   Wed Mar 13 11:05:08 2024 +0100

    s390: Fix tests rosbg_si_srl and rxsbg_si_srl
    
    Starting with r14-2047-gd0e891406b16dc two SI mode tests are optimized
    into DI mode.  Thus, the scan-assembler directives fail.  For example
    RTL expression
    
    (ior:SI (subreg:SI (lshiftrt:DI (reg:DI 69)
                (const_int 2 [0x2])) 4)
        (subreg:SI (reg:DI 68) 4))
    
    is optimized into
    
    (ior:DI (lshiftrt:DI (reg:DI 69)
            (const_int 2 [0x2]))
        (reg:DI 68))
    
    Fixed by moving operands into memory in order to enforce SI mode
    computation.
    
    Furthermore, in r9-6056-g290dfd9bc7bea2 the starting bit position of the
    scan-assembler directive for rosbg was incorrectly set to 32 which
    actually should be 32+SHIFT_AMOUNT, i.e., in this particular case 34.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/s390/md/rXsbg_mode_sXl.c: Fix tests rosbg_si_srl
            and rxsbg_si_srl.

Diff:
---
 gcc/testsuite/gcc.target/s390/md/rXsbg_mode_sXl.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/gcc.target/s390/md/rXsbg_mode_sXl.c b/gcc/testsuite/gcc.target/s390/md/rXsbg_mode_sXl.c
index ede813818ff..cf454d2783c 100644
--- a/gcc/testsuite/gcc.target/s390/md/rXsbg_mode_sXl.c
+++ b/gcc/testsuite/gcc.target/s390/md/rXsbg_mode_sXl.c
@@ -22,6 +22,8 @@
     { dg-skip-if "" { *-*-* } { "*" } { "-march=*" } }
 */
 
+unsigned int a, b;
+
 __attribute__ ((noinline)) unsigned int
 si_sll (unsigned int x)
 {
@@ -42,11 +44,11 @@ rosbg_si_sll (unsigned int a, unsigned int b)
 /* { dg-final { scan-assembler-times "rosbg\t%r.,%r.,32,62,1" 1 } } */
 
 __attribute__ ((noinline)) unsigned int
-rosbg_si_srl (unsigned int a, unsigned int b)
+rosbg_si_srl (void)
 {
   return a | (b >> 2);
 }
-/* { dg-final { scan-assembler-times "rosbg\t%r.,%r.,32,63,62" 1 } } */
+/* { dg-final { scan-assembler-times "rosbg\t%r.,%r.,34,63,62" 1 } } */
 
 __attribute__ ((noinline)) unsigned int
 rxsbg_si_sll (unsigned int a, unsigned int b)
@@ -56,11 +58,11 @@ rxsbg_si_sll (unsigned int a, unsigned int b)
 /* { dg-final { scan-assembler-times "rxsbg\t%r.,%r.,32,62,1" 1 } } */
 
 __attribute__ ((noinline)) unsigned int
-rxsbg_si_srl (unsigned int a, unsigned int b)
+rxsbg_si_srl (void)
 {
   return a ^ (b >> 2);
 }
-/* { dg-final { scan-assembler-times "rxsbg\t%r.,%r.,32,63,62" 1 } } */
+/* { dg-final { scan-assembler-times "rxsbg\t%r.,%r.,34,63,62" 1 } } */
 
 __attribute__ ((noinline)) unsigned long long
 di_sll (unsigned long long x)
@@ -108,21 +110,21 @@ main (void)
   /* SIMode */
   {
     unsigned int r;
-    unsigned int a = 0x12488421u;
-    unsigned int b = 0x88881111u;
+    a = 0x12488421u;
+    b = 0x88881111u;
     unsigned int csll = si_sll (b);
     unsigned int csrl = si_srl (b);
 
     r = rosbg_si_sll (a, b);
     if (r != (a | csll))
       __builtin_abort ();
-    r = rosbg_si_srl (a, b);
+    r = rosbg_si_srl ();
     if (r != (a | csrl))
       __builtin_abort ();
     r = rxsbg_si_sll (a, b);
     if (r != (a ^ csll))
       __builtin_abort ();
-    r = rxsbg_si_srl (a, b);
+    r = rxsbg_si_srl ();
     if (r != (a ^ csrl))
       __builtin_abort ();
   }

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

only message in thread, other threads:[~2024-03-13 10:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13 10:06 [gcc r14-9450] s390: Fix tests rosbg_si_srl and rxsbg_si_srl Stefan Schulze Frielinghaus

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