From patchwork Mon Mar 27 07:46:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 66922 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C11A3858C5F for ; Mon, 27 Mar 2023 07:47:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 6AC303858404 for ; Mon, 27 Mar 2023 07:47:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AC303858404 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-lf1-x12d.google.com with SMTP id y20so10128230lfj.2 for ; Mon, 27 Mar 2023 00:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1679903223; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=F2qJaePyCwwFgFAJPbNhMR4yzsvlfEVoxNNkKsOAjrw=; b=pXvDPijTp5YJVC7yM4QzXE88DEd9GyKb6m7/qteNLp6WzYIeG7KOisgrSAosAip5B1 y6OTtyMJEEErRzjT4NjZT92uMLh9fqihJt4H9wusZWS8fDeR2JvEcMH2+bWfbcWe8gRN X87LLGJiaZejLkyOkK/bvChae1WP4+y9IIQTxeB2UP7XN/aZTqpjXdY2B9RHsaVPFWF3 7SGMGkr703u/9brFdW+X0PHPgEtcj5B9ZgXMjCf3PZ2bgX9/FEkQgEB0p1asE3xAFB12 64XnkEfArjvy9GgZrV845p0N+lx4isThyeSpxXQXi92DBj76Z1lvGxz/Qjs4MQgLZL4a u/ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679903223; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=F2qJaePyCwwFgFAJPbNhMR4yzsvlfEVoxNNkKsOAjrw=; b=Y/rhK+RX5gTaRWMm2JJTkecm092iY5am5tWSgIjCevqRbHNWztmTSHAvYM2XcBdC5c c/x1iZdVH5tT6QnSUSjnte/wnfMYUyeujyy4s6BDmMEw2Vn/a6FxFDGQ7FG9mUtnz+yn MOFVZPalZRlti+5UZciJBjMfE3DuK3RixZ4Dxh6MNwqbOxOj0bkPyXFUHdoQasW6pgNN aAdIufMF6GDzfnEE2W8YbgxXlW2RDc+pqKa/48RXmFlfe2joVORuCJ+BrER/tgu1j0Du gl7oUniLqIBz2oKYV5h0hzSXPjMrISmTF8V44z9nz/TohcHMBACTTSkDL60tZ6UX9+q9 jfqg== X-Gm-Message-State: AAQBX9fXdPqEObG0rH/zK4v6rndURyTtUFedhsLtkhgZb52wfFcOZB8e CP5Z57xWgmPKAj/22jUJyoKm5AUDBmLHNyUR4bfx6zpN X-Google-Smtp-Source: AKy350YRgx6j8cybeuVsoAzU18qvAZVmmAo3NAH/+H1bhVvrNXfsmkDZIj9LGrVIcuRkicr7WrZH3A== X-Received: by 2002:ac2:5291:0:b0:4cb:2aa:9e58 with SMTP id q17-20020ac25291000000b004cb02aa9e58mr2921342lfm.13.1679903223522; Mon, 27 Mar 2023 00:47:03 -0700 (PDT) Received: from ubuntu-focal.. ([2a01:4f9:3a:1e26::2]) by smtp.gmail.com with ESMTPSA id f21-20020ac25335000000b004d86808fd33sm4617979lfh.15.2023.03.27.00.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 00:47:03 -0700 (PDT) From: Philipp Tomsich To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Tamar Christina , Philipp Tomsich , Manolis Tsamis Subject: [PATCH] aarch64: update ampere1 vectorization cost Date: Mon, 27 Mar 2023 09:46:54 +0200 Message-Id: <20230327074654.1126912-1-philipp.tomsich@vrull.eu> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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. OK for backports? 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 */