From patchwork Thu Jan 4 01:58:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 184890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5370462dyb; Wed, 3 Jan 2024 18:00:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDTFonpzU4Ztbq1XzSx8onGvV/YAhYeF0YW4lDYDe0UA7pJLAFkyl6CwOCMlOkh1OFHyW4 X-Received: by 2002:a05:622a:c8:b0:428:4cd0:9a5a with SMTP id p8-20020a05622a00c800b004284cd09a5amr427752qtw.65.1704333614496; Wed, 03 Jan 2024 18:00:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704333614; cv=pass; d=google.com; s=arc-20160816; b=yfcrINg/1UYZAhJnNQ059mmk+h1ITM50LkGQ9JPytAPLgtYHLtd/nhacIjq+zLDe5Y RboeyzniHEpjE7CoqWdijcmeBtG7hC58StjcrUDVZg3EF8yR16TykcKId3Fm2is/ADZX T/VoMtf9f7OsHvH+qCMfG4aCprqFbqGjYd6wla2JJyh5CQTSa1GT9Jif+5KWEoKges6a M8jqoHqAGphC1PAnoekuq30j3C8dcEPNuXS+DkIW2nCg2Wxv/+dX4N96huYBM7vDHFZH ghREvXH4IkxJnVP7buaoM5E2zx+2jmRLyIuwDXjDuU6SMt5eAT4/vApwDz/pqgRcqJ0r 6HGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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:arc-filter :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ux0Tht2Rwc6aBZzNF248p4hWYoedjDOgEzldIJbmpGw=; fh=Yb7vMu1xmO3w7lzcUJ3g87/936eZQp4GM8b6tTP+qWg=; b=H2wiALMUT7QJhDrhS1nG9+EYl1S0KBfvh+lq1TZ7vBpOR2otTXs4JJmPOyyoJbHB9E SdpsvdTgQW/g2iWyAW5hs93tLkSK5/vT2JXr/j2JRpfuK6yEE3OW3a97ZeQfZSqIV18c OdhilgawqhycF6YdMB1lp+6bhFxahOXJHbVk9dMRVh9u+PQMWSoM2C5SEozZaYzXGc7n Dmzlr+nlbaO9StTj58zl8riTiCXVa+J92UUO3do4H+38T5Mb2cMRfN7b/eDzvsdtI0RC OiQcvVEDhrPoTpJ30FuLMZTapTWd1yFh/4TMG4Q5zOZUnCfWG3VcS7MELXl+T61Dod0o 3qBA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eDMeP2qY; arc=pass (i=1); 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r12-20020a05622a034c00b004283bd59b7fsi1802971qtw.18.2024.01.03.18.00.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 18:00:14 -0800 (PST) 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=@gcc.gnu.org header.s=default header.b=eDMeP2qY; arc=pass (i=1); 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F82B385801D for ; Thu, 4 Jan 2024 02:00:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F82B385801D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704333614; bh=ux0Tht2Rwc6aBZzNF248p4hWYoedjDOgEzldIJbmpGw=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=eDMeP2qYKdl8kCqDDCzf2AOu/J9beafCuxDRYr6RLGblskJiYMFReBQebbx6LjWcO vVjTBwzd/nS7HFjsJWs+BmW70PosCCWZSjEq+VDIAAcrANPjSvk/mF8ukZSC4rFxfT iIKyRsF19bqR8FQKU83k/+TD5PVgfSWmMxEMenBM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by sourceware.org (Postfix) with ESMTPS id D24143858D33; Thu, 4 Jan 2024 01:58:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D24143858D33 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 D24143858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704333517; cv=none; b=QpL6GL6bCSvARaE4TWD91CXxN4QZ3F/MInVZbTV3oPUgQVG1MiDcIv5KXQ5K3HfIilR3X5LDHlzjV0Q0NgpXL4tEu8luKXLGWU7YrYVfT/7L12fEj5RtHRMxNSmMp1jAeWLHs1q05yadBRxTHx844k+mpaLloZ7ujTZbyB9CSl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704333517; c=relaxed/simple; bh=O6GS0iq+P+Lf2oiHKHD1QG9iUcbhj/sdnXFYOEoN2ow=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=r6li/XLLyruVNApJzLHdv1jU37dEn8W8hMzejiQMnRl3wqeWTNaszBdOJkL/0CwCJmZiJPDER0I+wjYdVcrkWgerC4ROUKpNBZxMPR4WU7sLfweRm3NVvarUVqqmxHtkU48p99V2ygS9i0/DqGpCY07UMt17e0Q8nGYPwTil69w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d427518d52so221805ad.0; Wed, 03 Jan 2024 17:58:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704333513; x=1704938313; 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=ux0Tht2Rwc6aBZzNF248p4hWYoedjDOgEzldIJbmpGw=; b=aboMD+hrMo0g8ej9/imqCtsM7ucCO5WtmitPZ/knSpztjzH6Jfm9bo6kdlRDhuMaiN eBOlXH9YP7NBdAT0IFY1Vt3plrZmB54ZtNcGN4/5G+7auPsbKsnGA/96JYladVALxV+4 4Hdocqq9Ps9HAa/xsGNtKiRUycKl7Pg5ZV3ukLuXTIOjBJd5JJll0TG+lOop1XrsuV9D nCbfVXeuoayMTi47QjkoQwhO263ascsS+4r2OymGbKEF+keSaQZ3v3/HfUhXtF0ZSkfS Av4oAZMj7fC0DIRS5ulLtbUHoDz560gPh6odYQFXU8U5RK2NlI2F9HxnvCWN8a3mv+GL L/jA== X-Gm-Message-State: AOJu0YzWKE7cg6Dyy8X0oivQ5oHOqvakl15iNJZucgR50N8BY6vR7Rrh dLYQxWhfaGFIHULGpfxbGLz0UjitjJ3PjA== X-Received: by 2002:a17:903:1110:b0:1d3:f95a:a678 with SMTP id n16-20020a170903111000b001d3f95aa678mr2531039plh.46.1704333513209; Wed, 03 Jan 2024 17:58:33 -0800 (PST) Received: from localhost.localdomain ([149.248.38.156]) by smtp.gmail.com with ESMTPSA id e6-20020a170902744600b001d4b0ae7052sm7028122plt.135.2024.01.03.17.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 17:58:32 -0800 (PST) From: YunQiang Su To: gcc-patches@gcc.gnu.org Cc: YunQiang Su Subject: [committed] MIPS: define_attr perf_ratio in mips.md Date: Thu, 4 Jan 2024 09:58:16 +0800 Message-Id: <20240104015819.353901-1-syq@gcc.gnu.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-8.1 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787123324225895599 X-GMAIL-MSGID: 1787123324225895599 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 6d47241ea3a..e1762ce105b 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"))