public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] [PR40457] [arm] expand SI-aligned movdi into pair of movsi
@ 2022-12-03  7:33 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-12-03  7:33 UTC (permalink / raw)
  To: gcc-cvs

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

commit ff44d83e0f3577412a333b2c4a82cf1806bdf3f9
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Fri Dec 2 03:28:06 2022 -0300

    [PR40457] [arm] expand SI-aligned movdi into pair of movsi
    
    When expanding a misaligned DImode move, emit aligned SImode moves if
    the parts are sufficiently aligned.  This enables neighboring stores
    to be peephole-combined into stm, as expected by the PR40457 testcase,
    even after SLP vectorizes the originally aligned SImode stores into a
    misaligned DImode store.
    
    
    for  gcc/ChangeLog
    
            PR target/40457
            * config/arm/arm.md (movmisaligndi): Prefer aligned SImode
            moves.

Diff:
---
 gcc/config/arm/arm.md | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 69bf343fb0e..a9eb0299aa7 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -12783,8 +12783,16 @@
   rtx hi_op0 = gen_highpart_mode (SImode, DImode, operands[0]);
   rtx hi_op1 = gen_highpart_mode (SImode, DImode, operands[1]);
 
-  emit_insn (gen_movmisalignsi (lo_op0, lo_op1));
-  emit_insn (gen_movmisalignsi (hi_op0, hi_op1));
+  if (aligned_operand (lo_op0, SImode) && aligned_operand (lo_op1, SImode))
+    {
+      emit_move_insn (lo_op0, lo_op1);
+      emit_move_insn (hi_op0, hi_op1);
+    }
+  else
+    {
+      emit_insn (gen_movmisalignsi (lo_op0, lo_op1));
+      emit_insn (gen_movmisalignsi (hi_op0, hi_op1));
+    }
   DONE;
 })

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

* [gcc(refs/users/aoliva/heads/testme)] [PR40457] [arm] expand SI-aligned movdi into pair of movsi
@ 2022-12-01  7:40 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-12-01  7:40 UTC (permalink / raw)
  To: gcc-cvs

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

commit cec475ae63c3659241dbd5c474990b5103148f86
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Dec 1 04:38:48 2022 -0300

    [PR40457] [arm] expand SI-aligned movdi into pair of movsi
    
    When expanding a misaligned DImode move, emit aligned SImode moves if
    the parts are sufficiently aligned.  This enables neighboring stores
    to be peephole-combined into stm, as expected by the PR40457 testcase,
    even after SLP vectorizes the originally aligned SImode stores into a
    misaligned DImode store.
    
    
    for  gcc/ChangeLog
    
            PR target/40457
            * config/arm/arm.md (movmisaligndi): Prefer aligned SImode
            moves.
    
    
    Change-Id: Ib91440e12e6ff424e3e7359874bf38c2779887a0
    TN: VB12-014

Diff:
---
 gcc/config/arm/arm.md | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 69bf343fb0e..a9eb0299aa7 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -12783,8 +12783,16 @@
   rtx hi_op0 = gen_highpart_mode (SImode, DImode, operands[0]);
   rtx hi_op1 = gen_highpart_mode (SImode, DImode, operands[1]);
 
-  emit_insn (gen_movmisalignsi (lo_op0, lo_op1));
-  emit_insn (gen_movmisalignsi (hi_op0, hi_op1));
+  if (aligned_operand (lo_op0, SImode) && aligned_operand (lo_op1, SImode))
+    {
+      emit_move_insn (lo_op0, lo_op1);
+      emit_move_insn (hi_op0, hi_op1);
+    }
+  else
+    {
+      emit_insn (gen_movmisalignsi (lo_op0, lo_op1));
+      emit_insn (gen_movmisalignsi (hi_op0, hi_op1));
+    }
   DONE;
 })

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

end of thread, other threads:[~2022-12-03  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-03  7:33 [gcc(refs/users/aoliva/heads/testme)] [PR40457] [arm] expand SI-aligned movdi into pair of movsi Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2022-12-01  7:40 Alexandre Oliva

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