From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id 7EC4D3858C2D for ; Mon, 27 Mar 2023 08:49:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7EC4D3858C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-ed1-x536.google.com with SMTP id w9so32788164edc.3 for ; Mon, 27 Mar 2023 01:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1679906994; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=967RqisCMgfLiGeRprHOk05T+oXd+rXDsNbS7tbUgSw=; b=qCczY9oLxkIZx/sIkmCsjfAK9695sVigZ8bu+lwT7gp9Kqfp5+wB6EBTiLBgy83T2k 4/azDWQz9aTdddTN6F1SK0J+4sM2pC9Z3gYHeNBr2iNHjN6IJZ+SyUxvkrSRJrnHoaZJ xRO6by1GMORC2c1qa+b6LQ6S3VfBN9xLlMF2eIPVw3VOnhS9QWDIGKXH7o53CHdGfrfa SdktP4asZAFgOajRAOUtNWXQW8Flbbc+VrmHqrPyNxRWEuwDBXLCbRxgKaVbs8zCLTpR Q+D/zcymc+jnLRI41U4QwapXaxwkvUxdw5EoQK8x5AM+5CJScAwsaZqPYldl8zkYTJ67 HKVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679906994; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=967RqisCMgfLiGeRprHOk05T+oXd+rXDsNbS7tbUgSw=; b=KeDSqio7cbWf9nKNn+PpBWAVjBZCiAqutbIUzUBw4uwGM4z5x3kJVrxeP8qJa8dgLl Vv3GxM82lX1KPZFEC7adRbQmZgZePEO9xVzIwE2pgWgeUUthSF/A2QlUxQxTFDMdoZKj LkK+STmguKU7oXVpWPZGZX37MUGtXo0VtmKopxwl5UeLt73NpLK96EgNMdnUVih9fETZ Ae5JrDKH8p7W6oJqNwA6TvUypG/L3Zi+JtfIh17ax2j7QrBbJ8C206LGQUByJQvhfly3 IcDZCEV8TWJqCc0hdnm2adLKThgYRB9BeGjG/Pux9hBxnSdjVFOacPMNaDr/IpUUkBzd uwqQ== X-Gm-Message-State: AAQBX9cL5wiz/o+EL1zfWxwYlknNAL9Qm+GKIcjPn8knDnOUa6+7/LFL aXP3wLG2gE33maPtZOG0LKAw4s5zxDYUf40KGUzjow== X-Google-Smtp-Source: AKy350a777g8RJiDlaAY69O4GEIuIHFvnZ9cP1yshgpGSND+ZuGOhNcRDjZ9OWDTCQlv8OfyBfyFu3fhcKXO/t1I1VA= X-Received: by 2002:a17:907:c48d:b0:8b0:e909:9136 with SMTP id tp13-20020a170907c48d00b008b0e9099136mr5479404ejc.1.1679906994101; Mon, 27 Mar 2023 01:49:54 -0700 (PDT) MIME-Version: 1.0 References: <20230327074654.1126912-1-philipp.tomsich@vrull.eu> In-Reply-To: From: Philipp Tomsich Date: Mon, 27 Mar 2023 16:49:43 +0800 Message-ID: Subject: Re: [PATCH] aarch64: update ampere1 vectorization cost To: Kyrylo Tkachov Cc: "gcc-patches@gcc.gnu.org" , Richard Sandiford , Tamar Christina , Manolis Tsamis Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 27 Mar 2023 at 16:45, Kyrylo Tkachov wrote: > > Hi Philipp, > > > -----Original Message----- > > From: Gcc-patches > bounces+kyrylo.tkachov=arm.com@gcc.gnu.org> On Behalf Of Philipp > > Tomsich > > Sent: Monday, March 27, 2023 8:47 AM > > To: gcc-patches@gcc.gnu.org > > Cc: Richard Sandiford ; Tamar Christina > > ; Philipp Tomsich ; > > Manolis Tsamis > > Subject: [PATCH] aarch64: update ampere1 vectorization cost > > > > The original submission of AmpereOne (-mcpu=ampere1) costs occurred > > prior to exhaustive testing of vectorizable workloads against > > hardware. > > > > Adjust the vector costs to achieve the best results and more closely > > match the underlying hardware. > > > > gcc/ChangeLog: > > > > * config/aarch64/aarch64.cc: Update vector costs for ampere1. > > > > Co-Authored-By: Manolis Tsamis > > > > Signed-off-by: Philipp Tomsich > > --- > > We would like to get this into GCC 13 to avoid having to backport at > > the start of the next cycle. > > > > Given this affects only the ampere1 costs that sounds fine to me and fairly low risk, you are being trusted that these costs are actually desirable and properly validated on the hardware involved. > > > OK for backports? > > This is ok for trunk (GCC 13). Do you also want to backport this to other branches? Ampere1 (with the older vector costs) are in GCC12 and GCC11. I would like to backport to those as well. Thanks, Philipp. > Thanks, > Kyrill > > > > > gcc/config/aarch64/aarch64.cc | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > > index b27f4354031..661fff65cea 100644 > > --- a/gcc/config/aarch64/aarch64.cc > > +++ b/gcc/config/aarch64/aarch64.cc > > @@ -1132,7 +1132,7 @@ static const struct cpu_vector_cost > > thunderx3t110_vector_cost = > > > > static const advsimd_vec_cost ampere1_advsimd_vector_cost = > > { > > - 3, /* int_stmt_cost */ > > + 1, /* int_stmt_cost */ > > 3, /* fp_stmt_cost */ > > 0, /* ld2_st2_permute_cost */ > > 0, /* ld3_st3_permute_cost */ > > @@ -1148,17 +1148,17 @@ static const advsimd_vec_cost > > ampere1_advsimd_vector_cost = > > 8, /* store_elt_extra_cost */ > > 6, /* vec_to_scalar_cost */ > > 7, /* scalar_to_vec_cost */ > > - 5, /* align_load_cost */ > > - 5, /* unalign_load_cost */ > > - 2, /* unalign_store_cost */ > > - 2 /* store_cost */ > > + 4, /* align_load_cost */ > > + 4, /* unalign_load_cost */ > > + 1, /* unalign_store_cost */ > > + 1 /* store_cost */ > > }; > > > > /* Ampere-1 costs for vector insn classes. */ > > static const struct cpu_vector_cost ampere1_vector_cost = > > { > > 1, /* scalar_int_stmt_cost */ > > - 1, /* scalar_fp_stmt_cost */ > > + 3, /* scalar_fp_stmt_cost */ > > 4, /* scalar_load_cost */ > > 1, /* scalar_store_cost */ > > 1, /* cond_taken_branch_cost */ > > -- > > 2.34.1 >