From patchwork Thu Sep 21 03:44:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lehua Ding X-Patchwork-Id: 142714 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4587421vqi; Wed, 20 Sep 2023 20:45:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkkymiWXQOfTospRe4Vq3EBfNByxR8V61PnX+A2Oq4YTBMLp6gqq6VfxuKpx3AZG6NcEsf X-Received: by 2002:a17:907:2712:b0:9a1:edfd:73bb with SMTP id w18-20020a170907271200b009a1edfd73bbmr3681187ejk.47.1695267920585; Wed, 20 Sep 2023 20:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695267920; cv=none; d=google.com; s=arc-20160816; b=pcR1LKcUnjZzlS93rd0v7Jykmq1FXWLhPqptIPTME1Ek9XLzDYM1eQUUo89WeiEMrR DzRKHynt1SvyemgSKddHzvh9xX5Rcpi+TXISeRHuHXszquB3OhkOTebCJ2hejywuwQH+ m3l7VHN9+JCHn3G8L43uNdoGshzHyclLfvfmaVlJepgLh8VieBBw7ti0SL89EY8lIJsr yFO1ii+xg7gzuwqQUxlQitZbfJVEGDqnUpNa0Hs2mT8ouljUCLVNhS6uUZ3bYn26FfHC GXlPCeIvjWBt6fE52Bp+yWSQGRJZ5grSeNgSbfkUQbI009+KeMQcBFSqnBEceJU3vdgp qYLg== ARC-Message-Signature: i=1; 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:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=X+h1kRf5qfhLEtBbPAh7PTT0ZQPa9zkHzZFkoVE1g8c=; fh=x/Q0OlwHuvCZ3FpkiZPiUSvevOYVxUAi4aNnf76mUPQ=; b=vVakJFjyayCoOIQrPr1om4+5Gn6Ct4mtF/vcs5B+FLGQXmJj48a/8tJoJ3Hl9bHe7x Nvd/96cB+MPdDED8AulKUyZLUZxxYvwl1BDRfH+UoPMBGKP/JmabXlOMcoDpUllBFzfz fvItdvYS3evgF3kE4+H2zCYQ3kCG42TraE+yeoXdmIt1l1gllP/gw5l/bDqCk9abWxiY 1SZp0c6AJGXhQcUFLmS7vQ6nY3lIW7D4J3Yj/edI6INVcHGU12DxOAcPI0pDeX7u9evz Hzl9nFDBYp65sG+du4dYa8pkKomdbY6BHnjxQcHJzavpTZdbStXkV/o/wddboeBRGaxz PmMg== 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 qu15-20020a170907110f00b009adc768b7e5si543628ejb.939.2023.09.20.20.45.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 20:45:20 -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 665DB3858C52 for ; Thu, 21 Sep 2023 03:45:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) by sourceware.org (Postfix) with ESMTPS id 02ADF3858C54 for ; Thu, 21 Sep 2023 03:44:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02ADF3858C54 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: bizesmtp75t1695267884tejosdxi Received: from rios-cad121.hadoop.rioslab.org ( [58.60.1.9]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 21 Sep 2023 11:44:43 +0800 (CST) X-QQ-SSF: 01400000000000C0F000000A0000000 X-QQ-FEAT: qcKkmz/zJhyh75guBeIMvjSXULQIRs6MCZP82YLdBqd68kP8DnFpxVi8NdzzH gEjZh2OemKQkGxjsdpGN+SQ7ArHf+orxRuZEQCg/Qv3YyFQ898xXiys0PYgKoeaWNo+9K8P wNbXij9HMjJPjMyRyxZ8JhQw0JEpJ6H3vCbBSRP4hwPoK1sGVnnhHd9EuTZLhXVIBUOzth4 Cvk4LuJqwYtE9JDrPiCDaF346JYRYzeQeNtOj7sNrJ1GQzS60UObqqniqITODf+CGg3PgKh t2arNTk/QGzsIU8WDziCTTlDYhgveQkCjJIfvF8qVM2jBVdgqmrjPo/ktLoDEORa+xI3oCp Sfr4hzyrsWrZWMldIoT/wAxZf9RHgsJG3051NaRRd8937jfEISIxW3eklj8qA== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 8868684029689508870 From: Lehua Ding To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@gmail.com, rdapp.gcc@gmail.com, palmer@rivosinc.com, jeffreyalaw@gmail.com, lehua.ding@rivai.ai Subject: [PATCH] RISC-V: Rename predicate vector_gs_scale_operand_16/32 to more generic names Date: Thu, 21 Sep 2023 11:44:43 +0800 Message-Id: <20230921034443.3671012-1-lehua.ding@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz6a-0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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.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: 1777617255117923313 X-GMAIL-MSGID: 1777617255117923313 This little rename vector_gs_scale_operand_16/32 to more generic names const_1_or_2/4_operand. So it's a little better understood when offered for use elsewhere. gcc/ChangeLog: * config/riscv/predicates.md (const_1_or_2_operand): Rename. (const_1_or_4_operand): Ditto. (vector_gs_scale_operand_16): Ditto. (vector_gs_scale_operand_32): Ditto. * config/riscv/vector-iterators.md: Adjust. --- gcc/config/riscv/predicates.md | 16 ++++++++-------- gcc/config/riscv/vector-iterators.md | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) -- 2.36.3 diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md index 4bc7ff2c9d8..a4f03242f2c 100644 --- a/gcc/config/riscv/predicates.md +++ b/gcc/config/riscv/predicates.md @@ -70,6 +70,14 @@ (and (match_code "const_int,const_wide_int,const_vector") (match_test "op == CONST1_RTX (GET_MODE (op))"))) +(define_predicate "const_1_or_2_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 1 || INTVAL (op) == 2"))) + +(define_predicate "const_1_or_4_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 1 || INTVAL (op) == 4"))) + (define_predicate "reg_or_0_operand" (ior (match_operand 0 "const_0_operand") (match_operand 0 "register_operand"))) @@ -463,14 +471,6 @@ (ior (match_operand 0 "register_operand") (match_code "const_vector"))) -(define_predicate "vector_gs_scale_operand_16" - (and (match_code "const_int") - (match_test "INTVAL (op) == 1 || INTVAL (op) == 2"))) - -(define_predicate "vector_gs_scale_operand_32" - (and (match_code "const_int") - (match_test "INTVAL (op) == 1 || INTVAL (op) == 4"))) - (define_predicate "vector_gs_scale_operand_64" (and (match_code "const_int") (match_test "INTVAL (op) == 1 || (INTVAL (op) == 8 && Pmode == DImode)"))) diff --git a/gcc/config/riscv/vector-iterators.md b/gcc/config/riscv/vector-iterators.md index 053d84c0c7d..a32d7e8d4e9 100644 --- a/gcc/config/riscv/vector-iterators.md +++ b/gcc/config/riscv/vector-iterators.md @@ -2723,18 +2723,18 @@ (RVVMF4QI "const_1_operand") (RVVMF8QI "const_1_operand") (RVVM8HI "const_1_operand") (RVVM4HI "vector_gs_scale_operand_16_rv32") - (RVVM2HI "vector_gs_scale_operand_16") (RVVM1HI "vector_gs_scale_operand_16") - (RVVMF2HI "vector_gs_scale_operand_16") (RVVMF4HI "vector_gs_scale_operand_16") + (RVVM2HI "const_1_or_2_operand") (RVVM1HI "const_1_or_2_operand") + (RVVMF2HI "const_1_or_2_operand") (RVVMF4HI "const_1_or_2_operand") (RVVM8HF "const_1_operand") (RVVM4HF "vector_gs_scale_operand_16_rv32") - (RVVM2HF "vector_gs_scale_operand_16") (RVVM1HF "vector_gs_scale_operand_16") - (RVVMF2HF "vector_gs_scale_operand_16") (RVVMF4HF "vector_gs_scale_operand_16") + (RVVM2HF "const_1_or_2_operand") (RVVM1HF "const_1_or_2_operand") + (RVVMF2HF "const_1_or_2_operand") (RVVMF4HF "const_1_or_2_operand") - (RVVM8SI "vector_gs_scale_operand_32_rv32") (RVVM4SI "vector_gs_scale_operand_32") (RVVM2SI "vector_gs_scale_operand_32") - (RVVM1SI "vector_gs_scale_operand_32") (RVVMF2SI "vector_gs_scale_operand_32") + (RVVM8SI "vector_gs_scale_operand_32_rv32") (RVVM4SI "const_1_or_4_operand") (RVVM2SI "const_1_or_4_operand") + (RVVM1SI "const_1_or_4_operand") (RVVMF2SI "const_1_or_4_operand") - (RVVM8SF "vector_gs_scale_operand_32_rv32") (RVVM4SF "vector_gs_scale_operand_32") (RVVM2SF "vector_gs_scale_operand_32") - (RVVM1SF "vector_gs_scale_operand_32") (RVVMF2SF "vector_gs_scale_operand_32") + (RVVM8SF "vector_gs_scale_operand_32_rv32") (RVVM4SF "const_1_or_4_operand") (RVVM2SF "const_1_or_4_operand") + (RVVM1SF "const_1_or_4_operand") (RVVMF2SF "const_1_or_4_operand") (RVVM8DI "vector_gs_scale_operand_64") (RVVM4DI "vector_gs_scale_operand_64") (RVVM2DI "vector_gs_scale_operand_64") (RVVM1DI "vector_gs_scale_operand_64")