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: 102300 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp816044vqr; Thu, 1 Jun 2023 22:56:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CKQAjNl9J2d7x55rnpxlmRw63CngoflPZXdrD0EQuFqXcvAOW4Vo3aEiZqVw/sy+WSt8v X-Received: by 2002:a17:907:7f92:b0:974:326b:f9d4 with SMTP id qk18-20020a1709077f9200b00974326bf9d4mr6904810ejc.32.1685685414812; Thu, 01 Jun 2023 22:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685685414; cv=none; d=google.com; s=arc-20160816; b=njAfJkr3wa3YntRy8ekr0cBQHcwKKNbOL0YD73Zvq2LlzeJfRksuWn39vPSBJ7IogL AzYKCBO8jPHO+zjXkhpuF8ycqhjkn33UFix/bHXXAuP+hppJYDo43TUEISEOkpAAN173 JX02ov+ZHuIs4JOvy7VNaMIq1PL2B8hGGKqR/6KyLWCADfRar0ysy9zmBWgtdH2ZNtWn 0gMW7HDazlDdKB4Iz8uSLbfcrrMt5PcW5Hy4D+CBxW+CyjT+TtwP0FQhn6OSBAwCHEtr KMtOSBYFdC1Ugg9WhorYml5Vq18iy6HEYig+IAyGKT3TE6IJ4QQnjqhtCrIDCPMeyO8Z aplg== 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:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=215/TJmicW8/uck4t4KRcsSyTsCy4mAjFoZbw9mElR4=; b=t4JtPkKSo7bDG53LrOyYguOaXp/1bJAl4J4/Xk82CpYy6uqUaA1x72SWyMOZzIjn52 65FeXProZNY/J1aEGQI6B2fJCo08/ijwsmxLw5qk1q2+IhAPu78eOYdxnT2B8l0HgG/Y HlA8e5VVyk12l4LSe6v8xHqOJGzEURm/PwLe7JpU0Y7yct7wCMzsvXMsXQFVPqNe0GZj CI3k3hxWWohqe+wLND22m+e/h+TrMv9Lib4ZYzvidrtZQfxM5RlsO5DQ8mU9HuaI05s8 gav++Y22d23hWYjEAJDCQbqdopJz3L7iSPJB7k+JfwAdCZWtB4zMajys1zjR/1JhClIs 0KEQ== 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 jz12-20020a170906bb0c00b009598cbea95fsi349003ejb.383.2023.06.01.22.56.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 22:56:54 -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 81EA23857016 for ; Fri, 2 Jun 2023 05:56:48 +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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767569269189530705?= X-GMAIL-MSGID: =?utf-8?q?1767569269189530705?= 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