From patchwork Wed Nov 6 18:20:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 2007653 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XkD6W2H6fz1xyS for ; Thu, 7 Nov 2024 05:21:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 33D583858C98 for ; Wed, 6 Nov 2024 18:21:05 +0000 (GMT) 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 239453858D21; Wed, 6 Nov 2024 18:20:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 239453858D21 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 239453858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730917213; cv=none; b=lOY71mCgCWrN17F99CRweYgz/NmdqdFQVSsOsBc70YMKL3BmbI+rTI9plsbuMyaFbR0RUxNT8MdDcBDKXD9Wmn9TWjT6YzUudiue/ql7Wg9ab8WiEanf+/tJQ8uwh96k7+GhNrITNnSHRdQqxkVMgFtwzQdLmfaoZtn8iv7aN5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730917213; c=relaxed/simple; bh=ZRF0j0wYp/mc936tY6W2WTdMj3c0YsE6naOCBrfgjpY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xcMPrKoBcccDwf0nP1TZ2KoP/5k29RRcTdRZy7QclthhUjnUzXIjLJTdbEvlOyjgL9JfMgJ2JAd5Nk+QbW2dgQO+vT9xMJV+jgylkrUWUqghsVv3bJLxpjAeLuFKE7NkSa213UX5lSsL+LaAvK0Jww1ggL+RdKAf2MTDN6qo7T4= ARC-Authentication-Results: i=1; server2.sourceware.org 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 A298A497; Wed, 6 Nov 2024 10:20:37 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 742DF3F66E; Wed, 6 Nov 2024 10:20:06 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org,richard.earnshaw@arm.com, ktkachov@gcc.gnu.org, richard.sandiford@arm.com Cc: richard.earnshaw@arm.com, ktkachov@gcc.gnu.org Subject: [PATCH 08/15] aarch64: Factor out part of the SVE ext_def class In-Reply-To: (Richard Sandiford's message of "Wed, 06 Nov 2024 18:16:05 +0000") References: Date: Wed, 06 Nov 2024 18:20:03 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org 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. --- .../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 cf321540b60..62277afaeff 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 {