From patchwork Wed Oct 30 18:48:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 2004349 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 4Xdx4y6nLfz1xws for ; Thu, 31 Oct 2024 05:49:54 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2ECAA3857BB9 for ; Wed, 30 Oct 2024 18:49:53 +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 5008D385841E for ; Wed, 30 Oct 2024 18:49:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5008D385841E 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 5008D385841E 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=1730314167; cv=none; b=d7vf9PItCQ685VgXYfZNCQ8KMICnAG9Qlld/Q/ijzjQJkFY0PFEGSnMXKtITSBV+twfMmZe0vDTIjK9gwP5AC8uilFix/jXTy0MA9vojkIzMRfg+lEgTP/jIXHSZTtvix8bOTia9foga544AV7hj6P+Ni9d7EIA4HuXDzEV2ldY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730314167; c=relaxed/simple; bh=2LCR8/9S/W/oE4zyKXZCHHxkKEJKIbQyyPQAbymWAKg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=PgqD5qBvaB9cfyEGmYd8+DWGEepOpiXgsl/DrQIG22oSVNhm8ymZFNa8ZU+ULidHg8oMhbkJ7JekDKyweovFdww59lVC/i+vbkOFpwkIZKgnqRmwS+ZpDwF0ki3CCx7pzHtaAFgjUPRW8PTsnWE9E3/BamZU2CnjJawsacUn0lE= 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 A856C11FB; Wed, 30 Oct 2024 11:49:50 -0700 (PDT) Received: from e121540-lin.manchester.arm.com (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 407423F528; Wed, 30 Oct 2024 11:49:20 -0700 (PDT) From: Richard Sandiford To: richard.earnshaw@arm.com, ktkachov@nvidia.com, gcc-patches@gcc.gnu.org Cc: Richard Sandiford Subject: [PATCH 1/3] aarch64: Move ENTRY_VHSDF to aarch64-simd-pragma-builtins.def Date: Wed, 30 Oct 2024 18:48:28 +0000 Message-Id: <20241030184830.3634301-2-richard.sandiford@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241030184830.3634301-1-richard.sandiford@arm.com> References: <20241030184830.3634301-1-richard.sandiford@arm.com> 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 It's more convenient for later patches if we only define ENTRY_VHSDF once, in the .def file. Then the only macro that needs to be defined before including the file is ENTRY itself. The patch also moves the architecture requirements out of the individual ENTRY invocations into a block-level definition of REQUIRED_EXTENSIONS. This reduces cut-&-paste a little and makes things more consistent with aarch64-sve-builtins*.def. gcc/ * config/aarch64/aarch64-builtins.cc (ENTRY): Remove the features argument and get the features from REQUIRED_EXTENSIONS instead. (ENTRY_VHSDF): Move definition to... * config/aarch64/aarch64-simd-pragma-builtins.def: ...here. Move the architecture requirements to REQUIRED_EXTENSIONS. --- gcc/config/aarch64/aarch64-builtins.cc | 22 +++---------------- .../aarch64/aarch64-simd-pragma-builtins.def | 14 ++++++++++-- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index 86d96e47f01..480ac223d86 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -780,17 +780,9 @@ typedef struct AARCH64_SIMD_BUILTIN_##T##_##N##A, #undef ENTRY -#define ENTRY(N, S, M, U, F) \ +#define ENTRY(N, S, M, U) \ AARCH64_##N, -#undef ENTRY_VHSDF -#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC, EXTENSIONS) \ - AARCH64_##NAME##_f16, \ - AARCH64_##NAME##q_f16, \ - AARCH64_##NAME##_f32, \ - AARCH64_##NAME##q_f32, \ - AARCH64_##NAME##q_f64, - enum aarch64_builtins { AARCH64_BUILTIN_MIN, @@ -1602,16 +1594,8 @@ enum class aarch64_builtin_signatures }; #undef ENTRY -#define ENTRY(N, S, M, U, F) \ - {#N, aarch64_builtin_signatures::S, E_##M##mode, U, F}, - -#undef ENTRY_VHSDF -#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC, EXTENSIONS) \ - ENTRY (NAME##_f16, SIGNATURE, V4HF, UNSPEC, EXTENSIONS) \ - ENTRY (NAME##q_f16, SIGNATURE, V8HF, UNSPEC, EXTENSIONS) \ - ENTRY (NAME##_f32, SIGNATURE, V2SF, UNSPEC, EXTENSIONS) \ - ENTRY (NAME##q_f32, SIGNATURE, V4SF, UNSPEC, EXTENSIONS) \ - ENTRY (NAME##q_f64, SIGNATURE, V2DF, UNSPEC, EXTENSIONS) +#define ENTRY(N, S, M, U) \ + {#N, aarch64_builtin_signatures::S, E_##M##mode, U, REQUIRED_EXTENSIONS}, /* Initialize pragma builtins. */ diff --git a/gcc/config/aarch64/aarch64-simd-pragma-builtins.def b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def index f432185be46..9d530fc45d4 100644 --- a/gcc/config/aarch64/aarch64-simd-pragma-builtins.def +++ b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def @@ -18,6 +18,16 @@ along with GCC; see the file COPYING3. If not see . */ +#undef ENTRY_VHSDF +#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC) \ + ENTRY (NAME##_f16, SIGNATURE, V4HF, UNSPEC) \ + ENTRY (NAME##q_f16, SIGNATURE, V8HF, UNSPEC) \ + ENTRY (NAME##_f32, SIGNATURE, V2SF, UNSPEC) \ + ENTRY (NAME##q_f32, SIGNATURE, V4SF, UNSPEC) \ + ENTRY (NAME##q_f64, SIGNATURE, V2DF, UNSPEC) + // faminmax -ENTRY_VHSDF (vamax, binary, UNSPEC_FAMAX, AARCH64_FL_FAMINMAX) -ENTRY_VHSDF (vamin, binary, UNSPEC_FAMIN, AARCH64_FL_FAMINMAX) +#define REQUIRED_EXTENSIONS AARCH64_FL_FAMINMAX +ENTRY_VHSDF (vamax, binary, UNSPEC_FAMAX) +ENTRY_VHSDF (vamin, binary, UNSPEC_FAMIN) +#undef REQUIRED_EXTENSIONS