diff mbox series

[pushed] aarch64: Use using directives to inherit constructors

Message ID mpt8rla7rwz.fsf@arm.com
State New
Headers show
Series [pushed] aarch64: Use using directives to inherit constructors | expand

Commit Message

Richard Sandiford Oct. 20, 2022, 9:42 a.m. UTC
Now that the codebase is C++11, we can use using directives
to inherit constructors from base classes.

Tested on aarch64-linux-gnu & pushed.

Richard


gcc/
	* config/aarch64/aarch64-sve-builtins-functions.h (quiet)
	(rtx_code_function, rtx_code_function_rotated, unspec_based_function)
	(unspec_based_function_rotated, unspec_based_function_exact_insn)
	(unspec_based_fused_function, unspec_based_fused_lane_function):
	Replace constructors with using directives.
	* config/aarch64/aarch64-sve-builtins-base.cc (svcnt_bhwd_pat_impl)
	(svcreate_impl, svdotprod_lane_impl, svget_impl, svld1_extend_impl)
	(svld1_gather_extend_impl, svld234_impl, svldff1_gather_extend)
	(svset_impl, svst1_scatter_truncate_impl, svst1_truncate_impl)
	(svst234_impl, svundef_impl): Likewise.
	* config/aarch64/aarch64-sve-builtins-sve2.cc
	(svldnt1_gather_extend_impl, svmovl_lb_impl): Likewise.
	(svstnt1_scatter_truncate_impl): Likewise.
---
 .../aarch64/aarch64-sve-builtins-base.cc      | 43 +++++---------
 .../aarch64/aarch64-sve-builtins-functions.h  | 56 +++----------------
 .../aarch64/aarch64-sve-builtins-sve2.cc      | 12 +---
 3 files changed, 24 insertions(+), 87 deletions(-)
diff mbox series

Patch

diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc b/gcc/config/aarch64/aarch64-sve-builtins-base.cc
index d52454bcf27..141f44d4d94 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-base.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins-base.cc
@@ -536,8 +536,7 @@  public:
 class svcnt_bhwd_pat_impl : public svcnt_bhwd_impl
 {
 public:
-  constexpr svcnt_bhwd_pat_impl (machine_mode ref_mode)
-    : svcnt_bhwd_impl (ref_mode) {}
+  using svcnt_bhwd_impl::svcnt_bhwd_impl;
 
   gimple *
   fold (gimple_folder &f) const override
@@ -588,8 +587,7 @@  public:
 class svcreate_impl : public quiet<multi_vector_function>
 {
 public:
-  constexpr svcreate_impl (unsigned int vectors_per_tuple)
-    : quiet<multi_vector_function> (vectors_per_tuple) {}
+  using quiet<multi_vector_function>::quiet;
 
   gimple *
   fold (gimple_folder &f) const override
@@ -722,12 +720,7 @@  public:
 class svdotprod_lane_impl : public unspec_based_function_base
 {
 public:
-  constexpr svdotprod_lane_impl (int unspec_for_sint,
-				 int unspec_for_uint,
-				 int unspec_for_float)
-    : unspec_based_function_base (unspec_for_sint,
-				  unspec_for_uint,
-				  unspec_for_float) {}
+  using unspec_based_function_base::unspec_based_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -1003,8 +996,7 @@  public:
 class svget_impl : public quiet<multi_vector_function>
 {
 public:
-  constexpr svget_impl (unsigned int vectors_per_tuple)
-    : quiet<multi_vector_function> (vectors_per_tuple) {}
+  using quiet<multi_vector_function>::quiet;
 
   gimple *
   fold (gimple_folder &f) const override
@@ -1118,8 +1110,7 @@  public:
 class svld1_extend_impl : public extending_load
 {
 public:
-  constexpr svld1_extend_impl (type_suffix_index memory_type)
-    : extending_load (memory_type) {}
+  using extending_load::extending_load;
 
   rtx
   expand (function_expander &e) const override
@@ -1158,8 +1149,7 @@  public:
 class svld1_gather_extend_impl : public extending_load
 {
 public:
-  constexpr svld1_gather_extend_impl (type_suffix_index memory_type)
-    : extending_load (memory_type) {}
+  using extending_load::extending_load;
 
   rtx
   expand (function_expander &e) const override
@@ -1289,8 +1279,7 @@  public:
 class svld234_impl : public full_width_access
 {
 public:
-  constexpr svld234_impl (unsigned int vectors_per_tuple)
-    : full_width_access (vectors_per_tuple) {}
+  using full_width_access::full_width_access;
 
   unsigned int
   call_properties (const function_instance &) const override
@@ -1372,8 +1361,7 @@  public:
 class svldff1_gather_extend : public extending_load
 {
 public:
-  constexpr svldff1_gather_extend (type_suffix_index memory_type)
-    : extending_load (memory_type) {}
+  using extending_load::extending_load;
 
   rtx
   expand (function_expander &e) const override
@@ -2070,8 +2058,7 @@  public:
 class svset_impl : public quiet<multi_vector_function>
 {
 public:
-  constexpr svset_impl (unsigned int vectors_per_tuple)
-    : quiet<multi_vector_function> (vectors_per_tuple) {}
+  using quiet<multi_vector_function>::quiet;
 
   gimple *
   fold (gimple_folder &f) const override
@@ -2199,8 +2186,7 @@  public:
 class svst1_scatter_truncate_impl : public truncating_store
 {
 public:
-  constexpr svst1_scatter_truncate_impl (scalar_int_mode to_mode)
-    : truncating_store (to_mode) {}
+  using truncating_store::truncating_store;
 
   rtx
   expand (function_expander &e) const override
@@ -2219,8 +2205,7 @@  public:
 class svst1_truncate_impl : public truncating_store
 {
 public:
-  constexpr svst1_truncate_impl (scalar_int_mode to_mode)
-    : truncating_store (to_mode) {}
+  using truncating_store::truncating_store;
 
   rtx
   expand (function_expander &e) const override
@@ -2235,8 +2220,7 @@  public:
 class svst234_impl : public full_width_access
 {
 public:
-  constexpr svst234_impl (unsigned int vectors_per_tuple)
-    : full_width_access (vectors_per_tuple) {}
+  using full_width_access::full_width_access;
 
   unsigned int
   call_properties (const function_instance &) const override
@@ -2351,8 +2335,7 @@  public:
 class svundef_impl : public quiet<multi_vector_function>
 {
 public:
-  constexpr svundef_impl (unsigned int vectors_per_tuple)
-    : quiet<multi_vector_function> (vectors_per_tuple) {}
+  using quiet<multi_vector_function>::quiet;
 
   rtx
   expand (function_expander &e) const override
diff --git a/gcc/config/aarch64/aarch64-sve-builtins-functions.h b/gcc/config/aarch64/aarch64-sve-builtins-functions.h
index 120b7266943..ec943c53a35 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-functions.h
+++ b/gcc/config/aarch64/aarch64-sve-builtins-functions.h
@@ -30,18 +30,7 @@  template<typename T>
 class quiet : public T
 {
 public:
-  constexpr quiet () : T () {}
-
-  /* Unfortunately we can't use parameter packs yet.  */
-  template<typename T1>
-  constexpr quiet (const T1 &t1) : T (t1) {}
-
-  template<typename T1, typename T2>
-  constexpr quiet (const T1 &t1, const T2 &t2) : T (t1, t2) {}
-
-  template<typename T1, typename T2, typename T3>
-  constexpr quiet (const T1 &t1, const T2 &t2, const T3 &t3)
-    : T (t1, t2, t3) {}
+  using T::T;
 
   unsigned int
   call_properties (const function_instance &) const override
@@ -200,9 +189,7 @@  public:
 class rtx_code_function : public rtx_code_function_base
 {
 public:
-  constexpr rtx_code_function (rtx_code code_for_sint, rtx_code code_for_uint,
-			       int unspec_for_fp = -1)
-    : rtx_code_function_base (code_for_sint, code_for_uint, unspec_for_fp) {}
+  using rtx_code_function_base::rtx_code_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -219,10 +206,7 @@  public:
 class rtx_code_function_rotated : public rtx_code_function_base
 {
 public:
-  constexpr rtx_code_function_rotated (rtx_code code_for_sint,
-				       rtx_code code_for_uint,
-				       int unspec_for_fp = -1)
-    : rtx_code_function_base (code_for_sint, code_for_uint, unspec_for_fp) {}
+  using rtx_code_function_base::rtx_code_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -272,11 +256,7 @@  public:
 class unspec_based_function : public unspec_based_function_base
 {
 public:
-  constexpr unspec_based_function (int unspec_for_sint, int unspec_for_uint,
-				   int unspec_for_fp)
-    : unspec_based_function_base (unspec_for_sint, unspec_for_uint,
-				  unspec_for_fp)
-  {}
+  using unspec_based_function_base::unspec_based_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -293,12 +273,7 @@  public:
 class unspec_based_function_rotated : public unspec_based_function_base
 {
 public:
-  constexpr unspec_based_function_rotated (int unspec_for_sint,
-					   int unspec_for_uint,
-					   int unspec_for_fp)
-    : unspec_based_function_base (unspec_for_sint, unspec_for_uint,
-				  unspec_for_fp)
-  {}
+  using unspec_based_function_base::unspec_based_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -321,12 +296,7 @@  template<insn_code (*CODE) (int, machine_mode)>
 class unspec_based_function_exact_insn : public unspec_based_function_base
 {
 public:
-  constexpr unspec_based_function_exact_insn (int unspec_for_sint,
-					      int unspec_for_uint,
-					      int unspec_for_fp)
-    : unspec_based_function_base (unspec_for_sint, unspec_for_uint,
-				  unspec_for_fp)
-  {}
+  using unspec_based_function_base::unspec_based_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -378,12 +348,7 @@  template<insn_code (*INT_CODE) (int, machine_mode)>
 class unspec_based_fused_function : public unspec_based_function_base
 {
 public:
-  constexpr unspec_based_fused_function (int unspec_for_sint,
-					 int unspec_for_uint,
-					 int unspec_for_fp)
-    : unspec_based_function_base (unspec_for_sint, unspec_for_uint,
-				  unspec_for_fp)
-  {}
+  using unspec_based_function_base::unspec_based_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -413,12 +378,7 @@  template<insn_code (*INT_CODE) (int, machine_mode)>
 class unspec_based_fused_lane_function : public unspec_based_function_base
 {
 public:
-  constexpr unspec_based_fused_lane_function (int unspec_for_sint,
-					      int unspec_for_uint,
-					      int unspec_for_fp)
-    : unspec_based_function_base (unspec_for_sint, unspec_for_uint,
-				  unspec_for_fp)
-  {}
+  using unspec_based_function_base::unspec_based_function_base;
 
   rtx
   expand (function_expander &e) const override
diff --git a/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc b/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc
index 9eb0bdda12e..ca8f20db57e 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc
@@ -138,8 +138,7 @@  public:
 class svldnt1_gather_extend_impl : public extending_load
 {
 public:
-  constexpr svldnt1_gather_extend_impl (type_suffix_index memory_type)
-    : extending_load (memory_type) {}
+  using extending_load::extending_load;
 
   rtx
   expand (function_expander &e) const override
@@ -178,11 +177,7 @@  public:
 class svmovl_lb_impl : public unspec_based_function_base
 {
 public:
-  constexpr svmovl_lb_impl (int unspec_for_sint, int unspec_for_uint,
-			    int unspec_for_fp)
-    : unspec_based_function_base (unspec_for_sint, unspec_for_uint,
-				  unspec_for_fp)
-  {}
+  using unspec_based_function_base::unspec_based_function_base;
 
   rtx
   expand (function_expander &e) const override
@@ -393,8 +388,7 @@  public:
 class svstnt1_scatter_truncate_impl : public truncating_store
 {
 public:
-  constexpr svstnt1_scatter_truncate_impl (scalar_int_mode to_mode)
-    : truncating_store (to_mode) {}
+  using truncating_store::truncating_store;
 
   rtx
   expand (function_expander &e) const override