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: 75235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1336643vqo; Mon, 27 Mar 2023 00:47:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bzl6yJvz34lbbjKWbK1FMZcgGvOCZlxqm2PzfDvvKFflDQikMgt5aptxRsEyB7HrmTH8z5 X-Received: by 2002:a17:907:d483:b0:932:ac6c:7ef9 with SMTP id vj3-20020a170907d48300b00932ac6c7ef9mr11841622ejc.22.1679903267319; Mon, 27 Mar 2023 00:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679903267; cv=none; d=google.com; s=arc-20160816; b=0yQ8IKbAecOFTH7apf43Wl0FByMZ+yqty8dUcZVFDAcEXOHImC6uVMx4IJW03lp398 F1E8r2ScdQDWTvETMU1B0tHkDBBD5smhl5VsQYpabbAijSR7XCUSZIJwXrH6jGe227PM klN8/MmunfQQHMB82Ov6HoIAxcr6Hb5y9OygEhgjMuXW1cT2o+NCKz0MY4G5YwGEKvIH cQbdI0xsQi6aLT9wPhcBF59J5cMAp7MjgI2M4yIQH+3p4D3P0KhpSIM6ots3mTZvFjZM KMcqP6uOtsQweenx39UDA1UA2kodHTyxm7Fmrrc2vWs1okz2tMOO/BDTTcJ71LRB9NOt xYMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=F2qJaePyCwwFgFAJPbNhMR4yzsvlfEVoxNNkKsOAjrw=; b=FzLiJi555OtQzVYJUPhstGhp/o86Gva/3JhnJrOS3SiGZTFGlsfa+AsQNlLrK+V682 Ij5N19BUzgQPnL/f8ATETqSUv/pBH9TFlNo7gSaxd7uC4+QCr0Be46oP/B4n09sj4cZH z0bVXM+d5nsTh0kXZQ7X5NATIBZ0yX7tGiI+i3LEcCWxPp2gIi0U3bXIGIuwoQ/xvmqD 76+rzBSW/MivgaCvtAJjMFhghqxd2xmnKsgsTeXvm4W2nNrA6ITYIuZaI+jcsvj1w9vk MDgwpNLqA4c/xM2CD5R3+GBKSRvzG7hYv1lS2hxA0MO6T17vOTM30jPAEF0yWThizNaz J21w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=pXvDPijT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id qw29-20020a1709066a1d00b00939bca46571si20523904ejc.207.2023.03.27.00.47.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 00:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=pXvDPijT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E9384385085C for ; Mon, 27 Mar 2023 07:47:29 +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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761506248407353444?= X-GMAIL-MSGID: =?utf-8?q?1761506248407353444?= 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 */