From patchwork Fri Dec 29 11:00:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 1881057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=aySCaKDT; dkim-atps=neutral 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 4T1jCj2ZGyz1ySy for ; Fri, 29 Dec 2023 22:03:13 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F0AE3858CD1 for ; Fri, 29 Dec 2023 11:03:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F0AE3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703847791; bh=8/HKOX8NSMANVNeZRIZS7nBWDh1yVkfAmQt1jt1JORE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aySCaKDTd1g5UTUs+auQW/OxQwHJAqzwfClrjdUscKPe6nd8GMhdCHOG9eKEhWtj7 ZzutsHrvDKzg02xsVMqoO3RWEvxD3urs3KBxc0csM2QFs71/Pyf8C259iqC3HNL4K8 TbkGErcOnDeaCpG9ZllA2/Vyjyu93ruexSYm/6j4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by sourceware.org (Postfix) with ESMTPS id 016B13858C53; Fri, 29 Dec 2023 11:01:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 016B13858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 016B13858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703847695; cv=none; b=N0XtM1FRgLplMwl5QNes9+ClCIDmkj8t3lV9IkDxB9r+4rXUevjidnXsx80ESvjtYiFch8yNuk2ZMqepQ46rqWp+nBd5mq8nR5mCDlOYmHT9vBLfHlp9ugUe2kmJ3v3HxP8rok5C8jAk8wuRMyGswGq0sWl2Cg796L5UAhcv34s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703847695; c=relaxed/simple; bh=g/mnQonAgm3opuxX110x7xo/kRglWVzSWyvKiLb4S8E=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=LvA9k8YTbJ5CVVvOjiJI0oLioe+EGiOsCdCFrSiNKo3JRVJVF4X6+8JxDwO/64lonKDKJiDQn1NxVFqaUipJ2kBk/wFQaYw/qJUeSsZ9ZWPvfnNOaLpfIZgYQdpBIAd/cWQSnkqn3jEStKlw3HCTz+2Jxlzi4gY5IqUN2jsN/s8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-28c9d424cceso1051594a91.0; Fri, 29 Dec 2023 03:01:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703847691; x=1704452491; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8/HKOX8NSMANVNeZRIZS7nBWDh1yVkfAmQt1jt1JORE=; b=NfuKGQb39fSahRaRuHgUAw7Bq9R4b+bewZlM3tCKOt3r0OzKiIekPdrVguatHHMexz KPdGPPKhyO1MGC7muOkYwCFjce+IIdaA2ONWtMVPbECyyUh15LI83QO1ra7Kj6w+xTCK voCGPAzyq9SlX1fAktpOO95V1u7+UeWBr3cN8GMBIJvTKhppboNV3kfkfw78lWz3le2x Mq7sgbXXxlzRMJtnRpFKYTVtu+7Hz8u2CdROH/tjxuhSksnI+UeMmq0bfNaxcXt313jx zy6vI3To/VO+dzRfMXaoTsgQm5kt1a7zQsIGXi6SbcP/78tZ7bMT8DxT2TZvWRClP09P tbwA== X-Gm-Message-State: AOJu0Yw8semknb+89LboPU6HhCwes7DDowt1CpUtEzGiQwsQEnYVNddl K2vWPFCo7yAghS5wT3MvqXf4JYuODzrP3Y9R X-Google-Smtp-Source: AGHT+IEVbofq2LkgYGMZN21wFeS77eURQ7HIBv8l5CpAlBj7yJUlIgeh7OoW9rkBunWNXMMP7aQEcg== X-Received: by 2002:a17:90b:ed7:b0:28b:eeec:5e8d with SMTP id gz23-20020a17090b0ed700b0028beeec5e8dmr13180233pjb.44.1703847691216; Fri, 29 Dec 2023 03:01:31 -0800 (PST) Received: from localhost.localdomain ([149.248.38.156]) by smtp.gmail.com with ESMTPSA id qa14-20020a17090b4fce00b0028ad536ea86sm16347418pjb.48.2023.12.29.03.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 03:01:29 -0800 (PST) From: YunQiang Su To: gcc-patches@gcc.gnu.org Cc: YunQiang Su Subject: [PATCH 2/2] MIPS: define_attr perf_ratio in mips.md Date: Fri, 29 Dec 2023 19:00:04 +0800 Message-Id: <20231229110004.2724974-2-syq@gcc.gnu.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231229110004.2724974-1-syq@gcc.gnu.org> References: <20231229110004.2724974-1-syq@gcc.gnu.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, MEDICAL_SUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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 The accurate cost of an pattern can get with insn_count * perf_ratio The default value is set to 0 instead of 1, since that we will need to distinguish the default value and it is really set for an pattern. Since it is not set for most patterns yet, to use it, we will need to be sure that it's value is greater than 0. This attr will be used in `mips_insn_cost`. gcc * config/mips/mips.md (perf_ratio): New attribute. --- gcc/config/mips/mips.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 6bc56b0d3da..5abaa7a3a20 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -312,6 +312,10 @@ (define_attr "sync_insn2" "nop,and,xor,not" ;; "11" specifies MEMMODEL_ACQUIRE. (define_attr "sync_memmodel" "" (const_int 10)) +;; Performance ratio. Add this attr to the slow INSNs. +;; Used by mips_insn_cost. +(define_attr "perf_ratio" "" (const_int 0)) + ;; Accumulator operand for madd patterns. (define_attr "accum_in" "none,0,1,2,3,4,5" (const_string "none"))