From patchwork Thu Oct 20 09:42:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 6112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp8013wrr; Thu, 20 Oct 2022 02:58:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4xGNMz0MF1Y42IBR4Lglh7bsvMyUfPqxWzJ4ui+7XHQnhpJo8MuTKThfukAzFeAX5GzPuF X-Received: by 2002:a17:906:ef8b:b0:791:9980:b7b9 with SMTP id ze11-20020a170906ef8b00b007919980b7b9mr10241588ejb.636.1666259936998; Thu, 20 Oct 2022 02:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666259936; cv=none; d=google.com; s=arc-20160816; b=AtJTNKeca7GPqQqrUAkPGCYxjyDyFqlAIYAOfcTCmmxJEnNZ9Wxw7s7UOWviWc+DXK YOL4v8Fwk8Lkuc8fEMGY2dglUhKJh2F1C4bLBROGLgbUupqDdVuP98CWSta2JItzDBPp yFyHbQ4QwlagqTxInA5XOaVgKHuKvaFfwZJq0ep2UQYQDxbP6rktSRsHEC5vzeK7LZM7 E6IJ0FBLUr6O7Y6UfAQVte/t1vN3b+cHojIZ8a9XzGhi2QLzAwAe+5auG9MoUwBdYx0K Q/PmeKgvSexAtCPTsmiuoMSVABDFPp6Pp6q9yT7fkbmgkK1m4pTPE+j5vrpibwRYwL+n 15Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:mail-followup-to:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=erUUC+RLqsnRRzti1cZoOvVzds6OWTcmIygUBpWHZmQ=; b=widk08KywX3P7OVlAUjv3HyUTPrxLOO9+jgipOx2qvahNiuCFMn30H00P7tJS9WZ6u SdqisZ+xrVgK4NhbKJ8NtWqWwlj57ObHEcdjJlCqOMq0rmZ/I4MthXPvkICrfEATQMqt 9tToTXOfgnTKzYGbqqhpSshLNv5TaZJ0Ozb+A4/cIRV2kXJUoVDXTDYuugo84AxWEMdt OO1t0A1N35jCzAcdIrnqyNsxmSfb4l11t4SFtDfNdCRgSgWRWL1hHsmT8KAsORou49u4 EOtTwiXz+ZScQP9sfPr9hPpFjWwk72kgwwyeEtB0+DMtKigCcqzPcq74gDYdXzthUUTR VcOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=a3+ejEUa; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id i10-20020a1709064fca00b0078db1258ae9si19519980ejw.555.2022.10.20.02.58.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 02:58:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=a3+ejEUa; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2200038CCC8F for ; Thu, 20 Oct 2022 09:45:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2200038CCC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666259103; bh=erUUC+RLqsnRRzti1cZoOvVzds6OWTcmIygUBpWHZmQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=a3+ejEUa3okLbnQADGbARoJVU83LBfLBB4YCwE/Gbkcymt9sL29mBx7cgyXcDNACb KgSVFfhI2NMWeIn4RQeoifgyGqlumuaPbrOZT1AonM/XfETdIkmKvagwj3efjg/mk+ YEBR3vM3FiaUP6qLYns9XmIujLfeBvAN7J/Yzemc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id EDA32383FBB3 for ; Thu, 20 Oct 2022 09:42:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EDA32383FBB3 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D46E2ED1 for ; Thu, 20 Oct 2022 02:42:12 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 444EF3F792 for ; Thu, 20 Oct 2022 02:42:06 -0700 (PDT) To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [pushed] aarch64: Use using directives to inherit constructors Date: Thu, 20 Oct 2022 10:42:04 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-43.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Sandiford via Gcc-patches From: Richard Sandiford Reply-To: Richard Sandiford Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747200179698307307?= X-GMAIL-MSGID: =?utf-8?q?1747200179698307307?= 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 --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 { public: - constexpr svcreate_impl (unsigned int vectors_per_tuple) - : quiet (vectors_per_tuple) {} + using quiet::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 { public: - constexpr svget_impl (unsigned int vectors_per_tuple) - : quiet (vectors_per_tuple) {} + using quiet::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 { public: - constexpr svset_impl (unsigned int vectors_per_tuple) - : quiet (vectors_per_tuple) {} + using quiet::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 { public: - constexpr svundef_impl (unsigned int vectors_per_tuple) - : quiet (vectors_per_tuple) {} + using quiet::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 class quiet : public T { public: - constexpr quiet () : T () {} - - /* Unfortunately we can't use parameter packs yet. */ - template - constexpr quiet (const T1 &t1) : T (t1) {} - - template - constexpr quiet (const T1 &t1, const T2 &t2) : T (t1, t2) {} - - template - 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 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 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 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