From patchwork Tue Oct 17 14:06:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 154300 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4159443vqb; Tue, 17 Oct 2023 07:07:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiPlSCZ8VbOCNlza/zZXHOO4wwIbAzHSt0XmUN8ILDAjUJruzbI5u7z4atV8kEhrxSgfn2 X-Received: by 2002:a05:6808:215:b0:3ab:870d:2d49 with SMTP id l21-20020a056808021500b003ab870d2d49mr2561541oie.8.1697551667547; Tue, 17 Oct 2023 07:07:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697551667; cv=pass; d=google.com; s=arc-20160816; b=t8tcf+eew4MhPSHgel2KjnGuzsLqzpGdyBEFRZ34XHipQ59NwXJV4Nww1+muCMqmPm aBaJt4p+DDVisNJc7J2dSxPV21AW8UuOnWZouq1/rGYVwcaHgzZiETNWRtgv2ruWo9cH 0iQSgVEqd83/9JsuAJFATU8NRV+0BPifxFusw3aJ6l70zWumo3ts/Au7mt1EQ4lCeyMq awkCgn9WIPjyWcIV6lzixPkHfclb0GiYc2EaeNUZnF2WnSmhDN46y8USttZqRINgwZ5P E46dMlezz/KcS1MhcZSN115wU9ZDF81MS2fnODkzFoQApXvZlllX/1Z7jjcX2qdkPZex zvKw== ARC-Message-Signature: i=2; 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=LSC7NX6hhX2si8sJ1zT37r+0iG9yIf5BIsgbfjs8m+0=; fh=oUCfM/eMlWtMCtZZKY1bglzxCo7b3kw9D5LTFFWuz38=; b=kmq0NZADSkL5DK/mJ6NoLBtch78SxNaa+iF/ysAwWNIJYK8xGW19p+qKPEYAdQtNtw BLVlZFHFX90ONrGSIGDR3pif9Jc/glCpbs32IQ0qI6+9irOOWjM2MzH4GGi/TQ0CYOHq +/XZtWet1PgdFcByUPd/OlpHje2hBQts3YvgbJHvJIAWn627xXI+bGnvgr3B+6nde4qM Cl5rcd4e8MSTbnTbELs+AtkOJq1n2d3/341bO8XX0bylpwY9e1R5SZCMMCYyYA0XefDi RZX7wS8rLy46DxbMeIuKx0DeGbcHqg97j/V/ybAtfDzc6wMqHww+b3SmrN/SOC23xbHL 63Ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b="Bi/Lto5H"; arc=pass (i=1); 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y3-20020ad457c3000000b00647423dd0d0si1008522qvx.67.2023.10.17.07.07.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:07:47 -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=@xry111.site header.s=default header.b="Bi/Lto5H"; arc=pass (i=1); 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 439D43858298 for ; Tue, 17 Oct 2023 14:07:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id BFDCE3858C01 for ; Tue, 17 Oct 2023 14:07:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BFDCE3858C01 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BFDCE3858C01 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:683e::1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697551644; cv=none; b=l/DW4JRbv37Zl3BX0VrMCTxUnoD7Xlvkm5De8U4bion/Wg77OEO7zSzwhPfs5Oaogp2UQ5bnQIZOBN6Z9B2qb4f9aO9oP711IEeJ91CC9wl8JrhswFc0tMnpmaYf+RxrvlL8DBo0JX4eK+qEtWxbr/C8oYjhigLoees3EKXcPLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697551644; c=relaxed/simple; bh=IdkfagYlcryjWuPpkCbEtXiqsd5WNmzR5MHA9Y+YVoY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Nhq30s/GFDKGfPJ6jfHiU0hInNnFe68ArLPNModD1H2h8TL24TVyNEn9eCXPoZ4nZxOb48xQ6IdKOqfLXpXPZuqQqA8207EQ5IYX1pcFNQEeRM/waShNLieBT6Lc024m/u+6mcrgNvoY0vDMTLKOsbJ67N/H/1ujVGNibSs4DS8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1697551638; bh=IdkfagYlcryjWuPpkCbEtXiqsd5WNmzR5MHA9Y+YVoY=; h=From:To:Cc:Subject:Date:From; b=Bi/Lto5Hha4cmbsluc5Sy+1UFj5oBzsawGFrPoJnnYhx/2N/21v/OjhZLCXmXy8oi 27dIehaQzWMq2JU+Ce39XfmVkZzw/2La3wFZkGB68u8XXnSbFpWDHSXj/jwMX6A/8g RtGi4FRsqMC0L43RxvZcuzm1s7ndCS9DmKjYsE5M= Received: from stargazer.. (unknown [113.140.11.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 09B3D66B3A; Tue, 17 Oct 2023 10:07:16 -0400 (EDT) From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: chenglulu , i@xen0n.name, xuchenghua@loongson.cn, Xi Ruoyao Subject: [PATCH] LoongArch: Use fcmp.caf.s instead of movgr2cf for zeroing a fcc Date: Tue, 17 Oct 2023 22:06:47 +0800 Message-ID: <20231017140706.21281-1-xry111@xry111.site> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, LIKELY_SPAM_FROM, 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: 1780011937046074422 X-GMAIL-MSGID: 1780011937046074422 During the review of a LLVM change [1], on LA464 we found that zeroing a fcc with fcmp.caf.s is much faster than a movgr2cf from $r0. [1]: https://github.com/llvm/llvm-project/pull/69300 gcc/ChangeLog: * config/loongarch/loongarch.md (movfcc): Use fcmp.caf.s for zeroing a fcc. --- Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk? gcc/config/loongarch/loongarch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md index 68897799505..743e75907a6 100644 --- a/gcc/config/loongarch/loongarch.md +++ b/gcc/config/loongarch/loongarch.md @@ -2151,7 +2151,7 @@ (define_insn "movfcc" [(set (match_operand:FCC 0 "register_operand" "=z") (const_int 0))] "" - "movgr2cf\t%0,$r0") + "fcmp.caf.s\t%0,$f0,$f0") ;; Conditional move instructions.