From patchwork Wed Aug 28 15:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1977958 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 4Wv7zd0MHGz1yXd for ; Thu, 29 Aug 2024 01:45:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFE4C386077D for ; Wed, 28 Aug 2024 15:45:46 +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 B9ECF3860768 for ; Wed, 28 Aug 2024 15:45:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B9ECF3860768 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 B9ECF3860768 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=1724859928; cv=none; b=ua+K5ihHSdet296DOxI39cLutj+Zy2Y0gK+1XWnCZNpZJqsc1rV6JUN00yqYh0ZiRkejIeKgimGnnGzxk9m+UF6L33AMDKuoFMvugMSO6Dv1kJ7OsfrsrDQm2AbrDFhMEIvGK/Gwg0mj/YgWCoHbsgY9qWrkx/IpU5fu8f8byRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724859928; c=relaxed/simple; bh=dkzphpjjCs3r5KyCVsFdxqiIPItweZIA/KyaT87Oe0o=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=BVwfL6gRc37qBsy6Rhko5/c6/dpW3PcQ/pNfx1CKwFhTCraFeLDKKJr4RYmAGMFSENwA0J/lMzj9IQqp82ucASBTzejdrd+fVG0HmwT6A4UVX2tI1Hm4RSWMG7zY/bSE6/qx70QlWICETAvOXL5JQgAAX+knkfKl0YwU5qqdFTU= 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 A9773DA7; Wed, 28 Aug 2024 08:45:52 -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 72F523F73B; Wed, 28 Aug 2024 08:45:25 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org,Jennifer Schmitz , Kyrylo Tkachov , Tamar Christina , richard.sandiford@arm.com Cc: Jennifer Schmitz , Kyrylo Tkachov , Tamar Christina Subject: [PATCH] aarch64: Assume zero gather/scatter set-up cost for -mtune=generic Date: Wed, 28 Aug 2024 16:45:23 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-18.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, 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 generic_vector_cost is not currently used by any SVE target by default; it has to be specifically selected by -mtune=generic. Its SVE costing has historically been somewhat idealised, since it predated any actual SVE cores. This seems like a useful tradition to continue, at least for testing purposes. The ideal case is that gathers and scatters do not induce a specific one-off overhead. This patch therefore sets the gather/scatter init costs to zero. This patch is necessary to switch -mtune=generic over to the "new" vector costs. Tested on aarch64-linux-gnu. Pushed as previously agreed with Tamar and Kyrill. Richard gcc/ * config/aarch64/tuning_models/generic.h (generic_sve_vector_cost): Set gather_load_x32_init_cost and gather_load_x64_init_cost to 0. --- gcc/config/aarch64/tuning_models/generic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/aarch64/tuning_models/generic.h b/gcc/config/aarch64/tuning_models/generic.h index 101969bdbb9..ee2f3ff4266 100644 --- a/gcc/config/aarch64/tuning_models/generic.h +++ b/gcc/config/aarch64/tuning_models/generic.h @@ -105,8 +105,8 @@ static const sve_vec_cost generic_sve_vector_cost = 2, /* fadda_f64_cost */ 4, /* gather_load_x32_cost */ 2, /* gather_load_x64_cost */ - 12, /* gather_load_x32_init_cost */ - 4, /* gather_load_x64_init_cost */ + 0, /* gather_load_x32_init_cost */ + 0, /* gather_load_x64_init_cost */ 1 /* scatter_store_elt_cost */ };