From patchwork Wed Aug 23 02:11:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 136622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp190494vqm; Tue, 22 Aug 2023 19:11:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvp83cqxioISV9oOvRNAVb97QhiSKNkp9m9i2Hpd/uorGmaXb8xLhPdt5UzZeCe/XFcbKF X-Received: by 2002:a17:906:301a:b0:9a1:c448:3c35 with SMTP id 26-20020a170906301a00b009a1c4483c35mr1889472ejz.68.1692756713161; Tue, 22 Aug 2023 19:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692756713; cv=none; d=google.com; s=arc-20160816; b=uAIRvRc8yNrtOe0XXLR7OiPTa1aACJjzLrWKOy11jR3ItVAY2XA+1IvZW/GVdpTLzD gbcQhOqdp4e8HkIJLMhMF3xbSgsqsG0Pk4hNYehA2XR9C4tbf2sX9XOV6Yzebuioz0/2 wDxgEMXxzT4RR6t7Fge6sWBOEjcrMbna9+e8LcmvKYL1R5oZAPwl6Pebeza7JydseKbM MmBmV+JCO5tp5xZstBc8z3I1cZj8kfJ9dx9hq1NT3HskLA+svSgD3E7YdfFb764SCJ2a JZCE74Eu7roqXpJOHfURVFjFfdSRop/s6YW08s06zQnzQAFGNyGJ8ySLbk73qDIQLWkR K6Og== 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:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=gpfcnEnSw/FovWmT87R/Ryik2IvezFsX1lklWXEeY6o=; fh=NF4ZuEwBSZUzhDQca3vBRUazRF6p5arhTIdSttTSvE8=; b=F/fZ8QXEb3heiLmU8L4OydLNibOqLlVJd687lSvilmrgI/5J2RwxdfW+s08nygkt45 ABV42dPQ9IN3MBw2HKx6O2KuwqNjUhOWFSkv0KGMUBDMe2NV8lzJ53dibYqZDnievwIC au87FkfH4vHweKcAy+WJy8yczePDq27HsQivaudSyjLo4H2pOs7jEXz/gT6fAJbcNFCL Pfec6hRk3mAjuSf7jmfOSvKC09JPFnMhXAthiNj4qLCh+YmtbhfQZOzeFvG+uGaXA2jG KFfz+y7SDFkWaJTPFlmNgmwd/Vv/uU/4pgNOe9+2fg0cMYQX3l9PaZa9QDLlOSrHUul9 H1cw== ARC-Authentication-Results: i=1; mx.google.com; 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ha19-20020a170906a89300b00993320628absi8115115ejb.675.2023.08.22.19.11.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 19:11:53 -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; 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 F344F38555B9 for ; Wed, 23 Aug 2023 02:11:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by sourceware.org (Postfix) with ESMTPS id 112443857C41 for ; Wed, 23 Aug 2023 02:11:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 112443857C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp67t1692756668tael6xe7 Received: from rios-cad122.hadoop.rioslab.org ( [58.60.1.8]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Aug 2023 10:11:07 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: kvCB1LdZJRpafr+xMLczeLomTCigerlONfJ219or5SiSSiHVgeWzNNIr4KfU5 a/k88dl5GpKukC5vjQErccBVfmEJHIChcM6EAT3RpsXusDr3MVNskg3LvLeiNPr0fmDhSAq iDDRx3CmAf8QbkSFcf6FIngXKw5+YGlB54anA+sYz+qdIzYqYjFhK4P1j7RTbKU7o0ujvq1 12K/YiXSQOSawIabkVq5X85JPJ7gmta3J7eG6ixEE6ZsAcOVg6u2EW7nKxemJD0Hrnwd6fj ZA86FMh0WBZfIkBK+zCHU3u1j41wE5/+bQCoQ8t6pGJSXGkwJMaUPhMAsBRR/JRBWWAyloH rdPPMB42x0sCJiSznCJ+Sq8Tpsg7N/EwINg2vXA6v7iHXS+wW7As0ETfXtx1XzRg75gP8I1 X-QQ-GoodBg: 2 X-BIZMAIL-ID: 2416675505570437128 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, Juzhe-Zhong Subject: [PATCH] RISC-V: Add attribute to vtype change only vsetvl Date: Wed, 23 Aug 2023 10:11:06 +0800 Message-Id: <20230823021106.3498134-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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: INBOX X-GMAIL-THRID: 1774984063477529024 X-GMAIL-MSGID: 1774984063477529024 This patch is prepare patch for VSETVL PASS. Commited. gcc/ChangeLog: * config/riscv/vector.md: Add attribute. --- gcc/config/riscv/vector.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/config/riscv/vector.md b/gcc/config/riscv/vector.md index e772e79057d..6ceae25dbed 100644 --- a/gcc/config/riscv/vector.md +++ b/gcc/config/riscv/vector.md @@ -1363,7 +1363,11 @@ "TARGET_VECTOR" "vsetvli\tzero,zero,e%0,%m1,t%p2,m%p3" [(set_attr "type" "vsetvl") - (set_attr "mode" "SI")]) + (set_attr "mode" "SI") + (set (attr "sew") (symbol_ref "INTVAL (operands[0])")) + (set (attr "vlmul") (symbol_ref "INTVAL (operands[1])")) + (set (attr "ta") (symbol_ref "INTVAL (operands[2])")) + (set (attr "ma") (symbol_ref "INTVAL (operands[3])"))]) ;; vsetvl zero,rs1,vtype instruction. ;; The reason we need this pattern since we should avoid setting X0 register