From patchwork Wed Nov 6 18:17:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 2007652 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 4XkD6N3ffwz1xyS for ; Thu, 7 Nov 2024 05:21:00 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F54E385840C for ; Wed, 6 Nov 2024 18:20:58 +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 CE76F3858C60; Wed, 6 Nov 2024 18:17:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE76F3858C60 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 CE76F3858C60 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=1730917081; cv=none; b=qz1A6DpTX2zvtaxLdjX9uePM7r4jH+VUikaZg1XyEp9WwYytRjmIib5KWTZDPT6P7I+P4desCj7n8W4c45ZoK5YKuT7JpWIOthxZssrYBogA6pM5/ojJijWKXYG52KuClkWPWohlH8YJaE+nqGu432vhIFhfrHkJf0Fi7JjjunI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730917081; c=relaxed/simple; bh=SfzXkXLQR1IP1mnpYtcmBir7unBxIGa/dEasxEJVVgY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=dwraBZ05kKkIq/63Jw68zOQKyKzs9fuYhEJm/F7lpx8tXHY6yzkQvbAAFutuRgxiEQWZHfNFK3I9eZ1XFaO4ukXh3VVrUE7gGuNOUmLPzwbpqPNL/MY2qHdWOkCNrzvE76TvFUGE9qlmKY6gK6KTwMQ9pDID/uRFLjC199rOjc8= 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 66DB6497; Wed, 6 Nov 2024 10:18:25 -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 E17133F66E; Wed, 6 Nov 2024 10:17:54 -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 03/15] aarch64: Tweak definition of all_data & co In-Reply-To: (Richard Sandiford's message of "Wed, 06 Nov 2024 18:16:05 +0000") References: Date: Wed, 06 Nov 2024 18:17:53 +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 Past extensions to SVE have required new subsets of all_data; the SVE2.1 patches will add another. This patch tries to make this more scalable by defining the multi-size *_data macros to be unions of single-size *_data macros. gcc/ * config/aarch64/aarch64-sve-builtins.cc (TYPES_all_data): Redefine in terms of single-size *_data definitions. (TYPES_bhs_data, TYPES_hs_data, TYPES_sd_data): Likewise. (TYPES_b_data, TYPES_h_data, TYPES_s_data): New macros. --- gcc/config/aarch64/aarch64-sve-builtins.cc | 51 +++++++++++++--------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc index 44b7f6edae5..c0b5115fdeb 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins.cc @@ -231,12 +231,11 @@ CONSTEXPR const group_suffix_info group_suffixes[] = { #define TYPES_all_arith(S, D) \ TYPES_all_float (S, D), TYPES_all_integer (S, D) -/* _bf16 - _f16 _f32 _f64 - _s8 _s16 _s32 _s64 - _u8 _u16 _u32 _u64. */ #define TYPES_all_data(S, D) \ - S (bf16), TYPES_all_arith (S, D) + TYPES_b_data (S, D), \ + TYPES_h_data (S, D), \ + TYPES_s_data (S, D), \ + TYPES_d_data (S, D) /* _b only. */ #define TYPES_b(S, D) \ @@ -255,6 +254,11 @@ CONSTEXPR const group_suffix_info group_suffixes[] = { #define TYPES_b_integer(S, D) \ S (s8), TYPES_b_unsigned (S, D) +/* _s8 + _u8. */ +#define TYPES_b_data(S, D) \ + TYPES_b_integer (S, D) + /* _s8 _s16 _u8 _u16. */ #define TYPES_bh_integer(S, D) \ @@ -277,12 +281,10 @@ CONSTEXPR const group_suffix_info group_suffixes[] = { #define TYPES_bhs_integer(S, D) \ TYPES_bhs_signed (S, D), TYPES_bhs_unsigned (S, D) -/* _bf16 - _f16 _f32 - _s8 _s16 _s32 - _u8 _u16 _u32. */ #define TYPES_bhs_data(S, D) \ - S (bf16), S (f16), S (f32), TYPES_bhs_integer (S, D) + TYPES_b_data (S, D), \ + TYPES_h_data (S, D), \ + TYPES_s_data (S, D) /* _s16_s8 _s32_s16 _s64_s32 _u16_u8 _u32_u16 _u64_u32. */ @@ -295,6 +297,13 @@ CONSTEXPR const group_suffix_info group_suffixes[] = { #define TYPES_h_integer(S, D) \ S (s16), S (u16) +/* _bf16 + _f16 + _s16 + _u16. */ +#define TYPES_h_data(S, D) \ + S (bf16), S (f16), TYPES_h_integer (S, D) + /* _s16 _s32. */ #define TYPES_hs_signed(S, D) \ S (s16), S (s32) @@ -308,12 +317,9 @@ CONSTEXPR const group_suffix_info group_suffixes[] = { #define TYPES_hs_float(S, D) \ S (f16), S (f32) -/* _bf16 - _f16 _f32 - _s16 _s32 - _u16 _u32. */ #define TYPES_hs_data(S, D) \ - S (bf16), S (f16), S (f32), TYPES_hs_integer (S, D) + TYPES_h_data (S, D), \ + TYPES_s_data (S, D) /* _u16 _u64. */ #define TYPES_hd_unsigned(S, D) \ @@ -352,10 +358,17 @@ CONSTEXPR const group_suffix_info group_suffixes[] = { #define TYPES_s_unsigned(S, D) \ S (u32) -/* _s32 _u32. */ +/* _s32 + _u32. */ #define TYPES_s_integer(S, D) \ TYPES_s_signed (S, D), TYPES_s_unsigned (S, D) +/* _f32 + _s32 + _u32. */ +#define TYPES_s_data(S, D) \ + TYPES_s_float (S, D), TYPES_s_integer (S, D) + /* _s32 _s64. */ #define TYPES_sd_signed(S, D) \ S (s32), S (s64) @@ -369,11 +382,9 @@ CONSTEXPR const group_suffix_info group_suffixes[] = { #define TYPES_sd_integer(S, D) \ TYPES_sd_signed (S, D), TYPES_sd_unsigned (S, D) -/* _f32 _f64 - _s32 _s64 - _u32 _u64. */ #define TYPES_sd_data(S, D) \ - S (f32), S (f64), TYPES_sd_integer (S, D) + TYPES_s_data (S, D), \ + TYPES_d_data (S, D) /* _f16 _f32 _f64 _s32 _s64