From patchwork Fri Jun 2 05:56:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Die Li X-Patchwork-Id: 70494 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D17E3856DDA for ; Fri, 2 Jun 2023 05:56:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from zg8tmtu5ljg5lje1ms4xmtka.icoremail.net (zg8tmtu5ljg5lje1ms4xmtka.icoremail.net [159.89.151.119]) by sourceware.org (Postfix) with ESMTP id C86E13858D1E for ; Fri, 2 Jun 2023 05:56:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C86E13858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=eswincomputing.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eswincomputing.com Received: from host040-ubuntu-1804.lxd (unknown [10.12.130.38]) by app2 (Coremail) with SMTP id EggMCgAXXpSDhHlkH58gAA--.59592S4; Fri, 02 Jun 2023 13:56:19 +0800 (CST) From: Die Li To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, jeffreyalaw@gmail.com, Die Li Subject: [PATCH] RISC-V: Remove unnecessary md pattern for TARGET_XTHEADCONDMOV Date: Fri, 2 Jun 2023 05:56:17 +0000 Message-Id: <20230602055617.63608-1-lidie@eswincomputing.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: EggMCgAXXpSDhHlkH58gAA--.59592S4 X-Coremail-Antispam: 1UD129KBjvJXoW7ur15uFWkZF1kuw17WF4Uurg_yoW8CFy8pr ZxC3sxCrW5ZF9Yk3Z2k3y7G3yUCrnxWr4UAwn5Zr9Fy345Zr9xJ3y0krySvFWUZFyYvr12 9FsF9ryUXw4jkaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUk214x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK6svPMxAI w28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr 4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxG rwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8Jw CI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2 z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfUoOJ5UUUUU X-CM-SenderInfo: 5olgxv46hv4xpqfrz1xxwl0woofrz/ X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, MEDICAL_SUBJECT, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" There are 2 small changes in this patch, but they do not affect the result. 1. Remove unnecessary md pattern for TARGET_XTHEADCONDMOV in thead.md. The operands[4] in "if_then_else" are always comparison operations, so the generated rtl does not match the pattern that is expected to be deleted. 2. Change operands[4] from const0_rtx to operands[1] to maintain rtl consistency. Although when output assembly, only operands[4] CODE will affect the output result. Signed-off-by: Die Li gcc/ChangeLog: * config/riscv/thead.md (*th_cond_gpr_mov): Delete. --- gcc/config/riscv/thead.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/gcc/config/riscv/thead.md b/gcc/config/riscv/thead.md index 0623607d3dc..ea377872bde 100644 --- a/gcc/config/riscv/thead.md +++ b/gcc/config/riscv/thead.md @@ -120,25 +120,12 @@ /* Invert the condition and take else-block. */ rtx_code code = GET_CODE (operands[4]); code = (code == EQ) ? NE : EQ; - operands[4] = gen_rtx_fmt_ee (code, VOIDmode, const0_rtx, const0_rtx); + operands[4] = gen_rtx_fmt_ee (code, VOIDmode, operands[1], const0_rtx); return "th.mv%C4z\t%0,%z3,%1"; } [(set_attr "type" "condmove") (set_attr "mode" "")]) -(define_insn "*th_cond_gpr_mov" - [(set (match_operand:GPR 0 "register_operand" "=r,r") - (if_then_else:GPR - (match_operand:GPR2 1 "register_operand" "r,r") - (match_operand:GPR 2 "reg_or_0_operand" "rJ,0") - (match_operand:GPR 3 "reg_or_0_operand" "0,rJ")))] - "TARGET_XTHEADCONDMOV" - "@ - th.mvnez\t%0,%z2,%1 - th.mveqz\t%0,%z3,%1" - [(set_attr "type" "condmove") - (set_attr "mode" "")]) - ;; XTheadFmv ;; In RV32, we lack fmv.x.d and fmv.d.x, but XTheadFmv has instructions