https://gcc.gnu.org/g:7793947247f37abc36dd53a7d63e46499ca6b054

commit r16-4478-g7793947247f37abc36dd53a7d63e46499ca6b054
Author: Tamar Christina <[email protected]>
Date:   Sat Oct 18 08:20:47 2025 +0100

    arm: convert widen_[us]sum into convert optab [PR122069]
    
    This patch is a mechanical rewrite of the widen_[us]sum optabs from a 
direct to
    a conversion optab.  The result of which requires the output mode to be 
added to
    the existing patterns.
    
    No change in functionality is expected.
    
    gcc/ChangeLog:
    
            PR middle-end/122069
            * config/arm/iterators.md (v_double_width): New, matching
            V_double_width.
            * config/arm/neon.md (widen_ssum<mode>3): Renamed ...
            (widen_ssum<v_double_width><mode>3, widen_ssum<V_widen_l><mode>3): 
...
            into these.
            (widen_usum<mode>3): Renamed ...
            (widen_usum<v_double_width><mode>3, widen_usum<V_widen_l><mode>3): 
...
            into these.

Diff:
---
 gcc/config/arm/iterators.md | 5 +++++
 gcc/config/arm/neon.md      | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md
index eb519e7b5f8c..dfbe0270c8d7 100644
--- a/gcc/config/arm/iterators.md
+++ b/gcc/config/arm/iterators.md
@@ -1788,6 +1788,11 @@
                   (V4HI "V2SI") (V8HI "V4SI")
                   (V2SI "DI")   (V4SI "V2DI")])
 
+;; Modes with double-width elements.
+(define_mode_attr v_double_width [(V8QI "v4hi") (V16QI "v8hi")
+                                 (V4HI "v2si") (V8HI "v4si")
+                                 (V2SI "di")   (V4SI "v2di")])
+
 ;; Double-sized modes with the same element size.
 ;; Used for neon_vdup_lane, where the second operand is double-sized
 ;; even when the first one is quad.
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index c887e7fcdff3..4ca152730888 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -981,7 +981,7 @@
 
 ;; Widening operations
 
-(define_expand "widen_ssum<mode>3"
+(define_expand "widen_ssum<v_double_width><mode>3"
   [(set (match_operand:<V_double_width> 0 "s_register_operand")
        (plus:<V_double_width>
         (sign_extend:<V_double_width>
@@ -1040,7 +1040,7 @@
 }
   [(set_attr "type" "neon_add_widen")])
 
-(define_insn "widen_ssum<mode>3"
+(define_insn "widen_ssum<V_widen_l><mode>3"
   [(set (match_operand:<V_widen> 0 "s_register_operand" "=w")
        (plus:<V_widen>
         (sign_extend:<V_widen>
@@ -1051,7 +1051,7 @@
   [(set_attr "type" "neon_add_widen")]
 )
 
-(define_expand "widen_usum<mode>3"
+(define_expand "widen_usum<v_double_width><mode>3"
   [(set (match_operand:<V_double_width> 0 "s_register_operand")
        (plus:<V_double_width>
         (zero_extend:<V_double_width>
@@ -1110,7 +1110,7 @@
 }
   [(set_attr "type" "neon_add_widen")])
 
-(define_insn "widen_usum<mode>3"
+(define_insn "widen_usum<V_widen_l><mode>3"
   [(set (match_operand:<V_widen> 0 "s_register_operand" "=w")
        (plus:<V_widen> (zero_extend:<V_widen>
                          (match_operand:VW 1 "s_register_operand" "%w"))

Reply via email to