public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] s390: split int128 load
@ 2023-11-15 13:15 Juergen Christ
  2023-11-23 14:35 ` Andreas Krebbel
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Christ @ 2023-11-15 13:15 UTC (permalink / raw)
  To: krebbel, gcc-patches

Issue two loads when using GPRs instead of one load-multiple.

Bootstrapped and tested on s390.  OK for mainline?

gcc/ChangeLog:

	* config/s390/s390.md: Split TImode loads.

gcc/testsuite/ChangeLog:

	* gcc.target/s390/int128load.c: New test.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
---
 gcc/config/s390/s390.md                    |  4 ----
 gcc/testsuite/gcc.target/s390/int128load.c | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/s390/int128load.c

diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 3f29ba214427..5bff69aeb350 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -1687,8 +1687,6 @@
   [(set (match_operand:TI 0 "nonimmediate_operand" "")
         (match_operand:TI 1 "general_operand" ""))]
   "TARGET_ZARCH && reload_completed
-   && !s_operand (operands[0], TImode)
-   && !s_operand (operands[1], TImode)
    && s390_split_ok_p (operands[0], operands[1], TImode, 0)"
   [(set (match_dup 2) (match_dup 4))
    (set (match_dup 3) (match_dup 5))]
@@ -1703,8 +1701,6 @@
   [(set (match_operand:TI 0 "nonimmediate_operand" "")
         (match_operand:TI 1 "general_operand" ""))]
   "TARGET_ZARCH && reload_completed
-   && !s_operand (operands[0], TImode)
-   && !s_operand (operands[1], TImode)
    && s390_split_ok_p (operands[0], operands[1], TImode, 1)"
   [(set (match_dup 2) (match_dup 4))
    (set (match_dup 3) (match_dup 5))]
diff --git a/gcc/testsuite/gcc.target/s390/int128load.c b/gcc/testsuite/gcc.target/s390/int128load.c
new file mode 100644
index 000000000000..35d5380704b6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/int128load.c
@@ -0,0 +1,14 @@
+/* Check that int128 loads and stores are split.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=zEC12" } */
+
+__int128 global;
+
+void f(__int128 x)
+{
+  global = x;
+}
+
+/* { dg-final { scan-assembler-times "lg\t" 2 } } */
+/* { dg-final { scan-assembler-times "stg\t" 2 } } */
-- 
2.39.3


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

* Re: [PATCH] s390: split int128 load
  2023-11-15 13:15 [PATCH] s390: split int128 load Juergen Christ
@ 2023-11-23 14:35 ` Andreas Krebbel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Krebbel @ 2023-11-23 14:35 UTC (permalink / raw)
  To: Juergen Christ, gcc-patches

On 11/15/23 14:15, Juergen Christ wrote:
> Issue two loads when using GPRs instead of one load-multiple.
> 
> Bootstrapped and tested on s390.  OK for mainline?
> 
> gcc/ChangeLog:
> 
> 	* config/s390/s390.md: Split TImode loads.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.target/s390/int128load.c: New test.
> 
> Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>

Since the testcase is using __int128 it needs to be gated like this to prevent it from being tested
with -m31:

/* { dg-do compile { target int128 } } */

Committed to mainline with that change. Thanks!

Andreas


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

end of thread, other threads:[~2023-11-23 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 13:15 [PATCH] s390: split int128 load Juergen Christ
2023-11-23 14:35 ` 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).