From patchwork Sun Aug 6 12:50:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiajie Chen X-Patchwork-Id: 131589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp911656vqr; Sun, 6 Aug 2023 05:56:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzlvbqs++1k1Vaavo5fiiQ2xS+jSStFpO5XYkL4RWOZqAF/v29/5oxswjnJ2WZjdAEGCUt X-Received: by 2002:a17:906:9bec:b0:99c:3bb:fd96 with SMTP id de44-20020a1709069bec00b0099c03bbfd96mr6682777ejc.52.1691326574072; Sun, 06 Aug 2023 05:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691326574; cv=none; d=google.com; s=arc-20160816; b=llWgxoDIukEu50k+IciCWCELwc5DQHKdtEAKlOKG01/inIyeWbCVJgpZYF8grBmXKm qJ+m82pV15qT9V7X+TWq0e9adbq1Ti/VVz1amQ/1koZuWq62ZzK6JWR6whc7RENt0mme 0vK+8W15vUdpptCyuE5Wue4Rhk62LpkbSwNhLa0l4e73bRiXxgluOwojkmzTT30bJ90i t0p8XXSkzVYkRUXnD3uyFPEh14XWJnb+e+GZMfz5Q+OTcBmvHtQmKLYpEdZK19w1/IEH rOvoZC0CwasNr30OhuGBkC/Lm9ZQC5y2PJVyYXvT1kf4HQ8iy1qSmNYfyt5wlo2AWY11 6HGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=FCqmV8IFmS3dquTUlbOBVtzCiXwbqFcXMRaq9t1Tv9A=; fh=cE5jVtj7gUY33yQFQBuNLHSg4tYpKtHOPxV+JSFpEWE=; b=HesNtFMyXNXKg1fKW6kIFQWfZAs3IslzUrH9C/GDCWe/qCptY207hUCpxbjOmkAv9x 9tYEEUr91qhTNIknf+fkbd/fiWS3uNBCh8Y/Hh84dZWHeyNMPyAo+E7AbFTOE02qrtZc SYMKo8IuJCTfcVlOAH5W3Jae2xkZfKWDNqrgTrUuFrsj7UIOkcWnJAHL/X7FXTFjINmb NvTMWONcwl9622NyArHOd3VbvcUvTAGAvv6oec7q5B2aqr22+5pAOVLrxj8VjzSeFs+7 SFWvDrZd/DSFc7PuvVpwxEfgaBPD2TJQEfPZ2Ld57qV0jTsY3AwDU6lAznte7U+zP28d HU2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KJ0I7EGt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t7-20020a170906178700b0099cb798de6esi2344723eje.135.2023.08.06.05.56.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 05:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KJ0I7EGt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 439663858039 for ; Sun, 6 Aug 2023 12:53:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 439663858039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691326429; bh=FCqmV8IFmS3dquTUlbOBVtzCiXwbqFcXMRaq9t1Tv9A=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=KJ0I7EGt5goHvPDUypfJ/Ud63x2Esehykk+/yfp6SQBYAGoqcnXhZSPAuE2GsXoa8 apV/majSUeQouIEM3zamC6HSmo+AROzdDihWJzMEq6e5us+HcRIqGlkO0KMDAAZBO8 VxXl5reGtkYE22WWCY2sm0xRkQjuEmRqGAMjDwJo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from hognose1.porkbun.com (hognose1.porkbun.com [35.82.102.206]) by sourceware.org (Postfix) with ESMTPS id 2DA4F385802F for ; Sun, 6 Aug 2023 12:51:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2DA4F385802F Received: from cslab-alder.. (unknown [166.111.226.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: c@jia.je) by hognose1.porkbun.com (Postfix) with ESMTPSA id 9B74141AD0; Sun, 6 Aug 2023 12:51:14 +0000 (UTC) To: gcc-patches@gcc.gnu.org Cc: Jiajie Chen Subject: [PATCH 6/9] LoongArch: Fix 64-bit immediate move for loongarch32 target Date: Sun, 6 Aug 2023 20:50:03 +0800 Message-ID: <20230806125010.283900-6-c@jia.je> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806125010.283900-1-c@jia.je> References: <20230806125010.283900-1-c@jia.je> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: , X-Patchwork-Original-From: Jiajie Chen via Gcc-patches From: Jiajie Chen Reply-To: Jiajie Chen Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773484453571222811 X-GMAIL-MSGID: 1773484453571222811 loongarch_move_integer does not support splitting 64-bit integer into two 32-bit ones. Thus, define_split is removed from movdi_32bit and TARGET_64BIT is added to the split condition of movdi_64bit to avoid using it for loongarch32. gcc/ChangeLog: * config/loongarch/loongarch.md (movdi_32bit): Remove not working split, use existing loongarch_split_move instead. (movdi_64bit) Add TARGET_64BIT to split condition. --- gcc/config/loongarch/loongarch.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md index 9eb6bb75c35..c611a8a822a 100644 --- a/gcc/config/loongarch/loongarch.md +++ b/gcc/config/loongarch/loongarch.md @@ -1777,22 +1777,13 @@ DONE; }) -(define_insn_and_split "*movdi_32bit" +(define_insn "*movdi_32bit" [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,w,*f,*f,*r,*m") (match_operand:DI 1 "move_operand" "r,i,w,r,*J*r,*m,*f,*f"))] "!TARGET_64BIT && (register_operand (operands[0], DImode) || reg_or_0_operand (operands[1], DImode))" { return loongarch_output_move (operands[0], operands[1]); } - "CONST_INT_P (operands[1]) && REG_P (operands[0]) && GP_REG_P (REGNO - (operands[0]))" - [(const_int 0)] - " -{ - loongarch_move_integer (operands[0], operands[0], INTVAL (operands[1])); - DONE; -} - " [(set_attr "move_type" "move,const,load,store,mgtf,fpload,mftg,fpstore") (set_attr "mode" "DI")]) @@ -1804,7 +1795,7 @@ || reg_or_0_operand (operands[1], DImode))" { return loongarch_output_move (operands[0], operands[1]); } "CONST_INT_P (operands[1]) && REG_P (operands[0]) && GP_REG_P (REGNO - (operands[0]))" + (operands[0])) && TARGET_64BIT" [(const_int 0)] " {