From patchwork Thu Aug 15 16:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1972851 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=8.43.85.97; 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 [8.43.85.97]) (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 4Wl9fK1p5Jz1yYl for ; Fri, 16 Aug 2024 02:33:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 49EA63858282 for ; Thu, 15 Aug 2024 16:33:11 +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 3AEA83858D29 for ; Thu, 15 Aug 2024 16:32:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AEA83858D29 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 3AEA83858D29 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=1723739571; cv=none; b=Zh9NE1fkZvuXYOQFwAK5Em90NTtxbsxyJ8Z3veDUrqePea+lHlP8JZq49k6b1F47TXwIW8Sn+Dyyf/bg1L+BvyJZhw+jEwj7QJTgFK46ULlmXIp1roUKGW3UAGrLokdqTjyAVuSyk6qbP1ngcGNBhC1n+6UuowB7TcE3hWhGn/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723739571; c=relaxed/simple; bh=Fcz5YgQVrlrczprvor97p/do43hd+1C/Bgf8ZdVrYZc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=GwPMmhY8e4BZgC4BstEwT5/qGg1eqgz+6QgUX31I3UI/ZxfbNM0Z8zkq6JCpp7d8tW+mJ7c+P/Mt3e3Serv5uj3ML/Qc+DK+UUQ5uLeTRT5Qg7H0SneUpSYnjbD9F6Y8NDcs4dQAXzZnTZO/E8UCLInHDilsJthXaVt6zv83k3U= 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 EE27F14BF; Thu, 15 Aug 2024 09:33:14 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 255FD3F6A8; Thu, 15 Aug 2024 09:32:47 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org,richard.earnshaw@arm.com, ktkachov@nvidia.com, richard.sandiford@arm.com Cc: richard.earnshaw@arm.com, ktkachov@nvidia.com Subject: [GCC 14] aarch64: Add another use of force_subreg [PR115464] Date: Thu, 15 Aug 2024 17:32:46 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-18.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.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 I'd like to backport r15-1244 to GCC 14 and then apply the patch below. === This patch includes the testcase from r15-1399 plus a miminal fix for it, without the other proactive uses of force_subreg. We can backport other force_subreg calls later if they're shown to be needed. Boostrapped & regression-tested on aarch64-linux-gnu. I'll leave a bit of time for comments and then push on Monday if no-one has any objections before then. Richard gcc/ PR target/115464 * config/aarch64/aarch64-sve-builtins-base.cc (svset_neonq_impl::expand): Use force_subreg instead of lowpart_subreg. gcc/testsuite/ PR target/115464 * gcc.target/aarch64/sve/acle/general/pr115464_2.c: New test. --- gcc/config/aarch64/aarch64-sve-builtins-base.cc | 4 +++- .../gcc.target/aarch64/sve/acle/general/pr115464_2.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr115464_2.c diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc b/gcc/config/aarch64/aarch64-sve-builtins-base.cc index c9182594bc1..241a249503f 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-base.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-base.cc @@ -1185,7 +1185,9 @@ public: if (BYTES_BIG_ENDIAN) return e.use_exact_insn (code_for_aarch64_sve_set_neonq (mode)); insn_code icode = code_for_vcond_mask (mode, mode); - e.args[1] = lowpart_subreg (mode, e.args[1], GET_MODE (e.args[1])); + e.args[1] = force_subreg (mode, e.args[1], GET_MODE (e.args[1]), + subreg_lowpart_offset (mode, + GET_MODE (e.args[1]))); e.add_output_operand (icode); e.add_input_operand (icode, e.args[1]); e.add_input_operand (icode, e.args[0]); diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr115464_2.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr115464_2.c new file mode 100644 index 00000000000..f561c34f732 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr115464_2.c @@ -0,0 +1,11 @@ +/* { dg-options "-O2" } */ + +#include +#include +#include + +svuint16_t +convolve4_4_x (uint16x8x2_t permute_tbl, svuint16_t a) +{ + return svset_neonq_u16 (a, permute_tbl.val[1]); +}