https://gcc.gnu.org/g:4a9721ca521d7a5626f1788afaf04a2b45960ea3

commit r15-5092-g4a9721ca521d7a5626f1788afaf04a2b45960ea3
Author: Richard Sandiford <richard.sandif...@arm.com>
Date:   Mon Nov 11 12:32:17 2024 +0000

    aarch64: Factor out part of the SVE ext_def class
    
    This patch factors out some of ext_def into a base class,
    so that it can be reused for the SVE2.1 svextq intrinsic.
    
    gcc/
            * config/aarch64/aarch64-sve-builtins-shapes.cc (ext_base): New base
            class, extracted from...
            (ext_def): ...here.

Diff:
---
 gcc/config/aarch64/aarch64-sve-builtins-shapes.cc | 32 +++++++++++++----------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc 
b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc
index cf321540b60e..62277afaeff4 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc
@@ -735,6 +735,23 @@ struct binary_za_slice_opt_single_base : public 
overloaded_base<1>
   }
 };
 
+/* Base class for ext.  */
+struct ext_base : public overloaded_base<0>
+{
+  void
+  build (function_builder &b, const function_group_info &group) const override
+  {
+    b.add_overloaded_functions (group, MODE_none);
+    build_all (b, "v0,v0,v0,su64", group, MODE_none);
+  }
+
+  tree
+  resolve (function_resolver &r) const override
+  {
+    return r.resolve_uniform (2, 1);
+  }
+};
+
 /* Base class for inc_dec and inc_dec_pat.  */
 struct inc_dec_base : public overloaded_base<0>
 {
@@ -2413,21 +2430,8 @@ SHAPE (dupq)
 
    where the final argument is an integer constant expression that when
    multiplied by the number of bytes in t0 is in the range [0, 255].  */
-struct ext_def : public overloaded_base<0>
+struct ext_def : public ext_base
 {
-  void
-  build (function_builder &b, const function_group_info &group) const override
-  {
-    b.add_overloaded_functions (group, MODE_none);
-    build_all (b, "v0,v0,v0,su64", group, MODE_none);
-  }
-
-  tree
-  resolve (function_resolver &r) const override
-  {
-    return r.resolve_uniform (2, 1);
-  }
-
   bool
   check (function_checker &c) const override
   {

Reply via email to