From patchwork Mon May 22 12:09:56 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: 97349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1398757vqo; Mon, 22 May 2023 05:10:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ55m6+MkPhhh2tx6VkjTbELOaHlknSAHBxcHzEyCqX0as6brV4bq+TtWegJxlhS96kbqfn6 X-Received: by 2002:a17:906:9743:b0:96f:32ae:a7e1 with SMTP id o3-20020a170906974300b0096f32aea7e1mr11582479ejy.63.1684757448494; Mon, 22 May 2023 05:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684757448; cv=none; d=google.com; s=arc-20160816; b=znAUeby58hOMi/JMd5KaE7tTQvg3+TSDplPSpa0R7GlszDvl8Esc+c6nEb52GGGIiW MGILv0pmH7SGrGzOSur4lptUDb17tm4ACGSXD9NiQI1ScFihtn4bWtruliNbVL6AGyN5 /TNJuUt2QFhOkLy4/8vpENQ8RrwvpvOWit2h4tSUVqYXM+k08tnfGtUya7Hgpn/euGUx HyfKX8J7fnwXMsD7YcUkzcpLHv04WKWCP25iGW6BIII/czuENskKqRDy6HYUBquSUTmV 2Yi1kZKqMUMQ7vQxAjmwOdxR9hWRCN2E9dN4ud/soRQ40eASe9oUUvD1Rkyqd846hf58 WofQ== 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=NBqrF9LZ1hFw02OSliEz7lb9RQBsBmBJvbs1cpcKuJU=; b=EAJd1y63xa2jJyi4fdP6HNkYBPGysf7PI0fUExjOd8hT8X5g1EN2w6rgIoOAfiBssq 3kayXXWZEE8qC2bEmg18xu8u0OBdruO0JkVIGXF+OXodpUpFDE0CiTIS8EaY+rQaIxlb Nu6CR5lsVC/wsZ0jqlwEaI6w7/KvBjBpvL1kViiA/Lb7J/nK7DGF/qS4wxn0TxEpQMhw z8qAwMWuWJQEvkm2CEXO1o9P/OKp4u+Qh5Zl4G0jleRw6h5W9lEZkCFQKtnv3rVyTxC2 IHcWiDFaO4aKkHSF0axEVjWyxd/qsRXb5EymaE7WdHW4k6ntDDyeh8CACCXQw9jmuu7u c+0Q== 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 sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gz22-20020a170907a05600b0094effdc5e80si3451300ejc.339.2023.05.22.05.10.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:10:48 -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 CEF983857712 for ; Mon, 22 May 2023 12:10:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by sourceware.org (Postfix) with ESMTPS id EA13A3858D35 for ; Mon, 22 May 2023 12:10:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA13A3858D35 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: bizesmtp76t1684757398tmhguor9 Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 22 May 2023 20:09:57 +0800 (CST) X-QQ-SSF: 01400000000000F0R000000A0000000 X-QQ-FEAT: 90EFqYDyPxDDXq5Up7F1IY+8PtLG6iqbAfUD7131QSNMbncLLZLf+j06gP39i jatiwV67AO4yHI0ipapXi6ICjUKRkOFQMhflkxcQ/W5IcxyuuOuNxtsK8W0ueQNOWpeq8/x iCvThk9mSkKYhW7QpfY597VnKaOC5RA+0VnKDjRJuolGBvmJQAy+bkAYzsRC6xoA84DQ6AA YpusWV3oS9iQky/eDGIV3qyFJ7ZCAtIePtXbTF/YWSiEXXroky0oCGoKr1DLAfrJa3zFmK+ agH/SZ0niM2PiX9mmKXwVyQmo/0lIggFzJNhY1Tvrj3ekt6t82WbH7JUhAas6V1027RZgDJ xfN1y7du/nWSxdX56bi6RMl1MAdWCPq2i8+2VHALSnEWyDr5sWBoZT+PvTQlsMieKb747Vc GQn8s8Gt+Vk= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 9099796961179852662 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, palmer@dabbelt.com, palmer@rivosinc.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [PATCH] RISC-V: Add "m_" prefix for private member Date: Mon, 22 May 2023 20:09:56 +0800 Message-Id: <20230522120956.2833527-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=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_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.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?1766596226324317211?= X-GMAIL-MSGID: =?utf-8?q?1766596226324317211?= From: Juzhe-Zhong Since the current framework is hard to maintain and hard to be used in the future possible auto-vectorization patterns. We will need to keep adding more helpers and arguments during the auto-vectorization supporting. We should refactor the framework now for the future use since the we don't support too much auto-vectorization patterns for now. Start with this simple patch, this patch is adding "m_" prefix for private the members. gcc/ChangeLog: * config/riscv/riscv-v.cc: Add "m_" prefix. --- gcc/config/riscv/riscv-v.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc index d65e7300303..e0b19bc1754 100644 --- a/gcc/config/riscv/riscv-v.cc +++ b/gcc/config/riscv/riscv-v.cc @@ -66,7 +66,7 @@ const_vlmax_p (machine_mode mode) template class insn_expander { public: - insn_expander () : m_opno (0), has_dest(false) {} + insn_expander () : m_opno (0), m_has_dest_p(false) {} void add_output_operand (rtx x, machine_mode mode) { create_output_operand (&m_ops[m_opno++], x, mode); @@ -99,41 +99,41 @@ public: void set_dest_and_mask (rtx mask, rtx dest, machine_mode mask_mode) { - dest_mode = GET_MODE (dest); - has_dest = true; + m_dest_mode = GET_MODE (dest); + m_has_dest_p = true; - add_output_operand (dest, dest_mode); + add_output_operand (dest, m_dest_mode); if (mask) add_input_operand (mask, GET_MODE (mask)); else add_all_one_mask_operand (mask_mode); - add_vundef_operand (dest_mode); + add_vundef_operand (m_dest_mode); } void set_len_and_policy (rtx len, bool force_vlmax = false) { bool vlmax_p = force_vlmax || !len; - gcc_assert (has_dest); + gcc_assert (m_has_dest_p); - if (vlmax_p && const_vlmax_p (dest_mode)) + if (vlmax_p && const_vlmax_p (m_dest_mode)) { /* Optimize VLS-VLMAX code gen, we can use vsetivli instead of the vsetvli to obtain the value of vlmax. */ - poly_uint64 nunits = GET_MODE_NUNITS (dest_mode); + poly_uint64 nunits = GET_MODE_NUNITS (m_dest_mode); len = gen_int_mode (nunits, Pmode); vlmax_p = false; /* It has became NONVLMAX now. */ } else if (!len) { len = gen_reg_rtx (Pmode); - emit_vlmax_vsetvl (dest_mode, len); + emit_vlmax_vsetvl (m_dest_mode, len); } add_input_operand (len, Pmode); - if (GET_MODE_CLASS (dest_mode) != MODE_VECTOR_BOOL) + if (GET_MODE_CLASS (m_dest_mode) != MODE_VECTOR_BOOL) add_policy_operand (get_prefer_tail_policy (), get_prefer_mask_policy ()); add_avl_type_operand (vlmax_p ? avl_type::VLMAX : avl_type::NONVLMAX); @@ -152,8 +152,8 @@ public: private: int m_opno; - bool has_dest; - machine_mode dest_mode; + bool m_has_dest_p; + machine_mode m_dest_mode; expand_operand m_ops[MAX_OPERANDS]; };