Message ID | alpine.DEB.2.20.2207261916490.10833@tpp.orcam.me.uk |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp2430658pxt; Tue, 26 Jul 2022 11:38:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1teZu/9rs2THVh2psxBF90hMT7unnTQRTLXs7SLrIQYRzH1vReoJ8aOG98n8MnqYcbyeZPw X-Received: by 2002:a05:6402:348e:b0:43c:37a:26d with SMTP id v14-20020a056402348e00b0043c037a026dmr11039595edc.279.1658860717156; Tue, 26 Jul 2022 11:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658860717; cv=none; d=google.com; s=arc-20160816; b=tK7I3INJ6fTIlpr4V21Mhf3ro/Cb1FdNZpkknsFpklvSRWGedJy+4MBPnUlSo2WpHO zLjqHvtBrzsSTzzAxtYDBhz8gMLAV7ojvzVpvri1D5XBhmIE+qZlHJ5yy3zWBdVg4eaO B0bvarMI0cywzIKfJGT19VCKPNX1/c79HNgr38floTTPOdyO3RKjvEbhFMXxxkmmrWRv A8XUw8ROaBtPH2vWKjYfdwXT279nZepx0bca+4Nq2Csd0/gCwDmPx2qYXK71zq+7EbkZ rWMDacSBSLhArfPm52KB8pZov2+LNBBMBgPb2hO9kMlJJ8PngafSkqtTZuS4losVav7x pRsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:subject:to:from:date:dkim-signature:dmarc-filter :delivered-to; bh=JmXsuD1YIa4ZBPjHa1sjxkSvvHvSdwFb0+syuSnCruQ=; b=cJF1ltPh7Xm7POlIE9sbgpdgoqkcZwOBXRkBBHdhlYCGgQGPJvJVG16lMYZRx98XLr Fe/h6tuRcb9hkf63dqGkOKyCRn+PwgOxwyBaFdiqrV4xXLfI0yvGSKGMY35JFJy4GKLM AHQntEMB18gPxhv2+D+4NlcTNZVLKVWpvajHUF5720eyprGaWXaP7tF5XgPZdHaaNoNk 7osVIlTQCVIJs9y/atBwi/Wz9PnDxLYWthMeD9o3y20w8gzT65XmdsIVXPfFbeomHUrd RtVqoczUWme4gQvC+vQwN3WzpusyqiCDQDti5DErlEV3/+gHBuTu7HBGv596OywaEpxY S6qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embecosm.com header.s=google header.b=Oc8nyQg8; 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 ga36-20020a1709070c2400b0072ee50dd4e6si3128018ejc.470.2022.07.26.11.38.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 11:38:37 -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; dkim=fail header.i=@embecosm.com header.s=google header.b=Oc8nyQg8; 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 874BC3857BBA for <ouuuleilei@gmail.com>; Tue, 26 Jul 2022 18:38:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by sourceware.org (Postfix) with ESMTPS id 68B7B3858D32 for <gcc-patches@gcc.gnu.org>; Tue, 26 Jul 2022 18:38:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 68B7B3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-lf1-x12a.google.com with SMTP id b16so11396689lfb.7 for <gcc-patches@gcc.gnu.org>; Tue, 26 Jul 2022 11:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=JmXsuD1YIa4ZBPjHa1sjxkSvvHvSdwFb0+syuSnCruQ=; b=Oc8nyQg8WF93ojd/TsX976XzxrIqurWsy0LUaQewN5OdEWeuOhBLVRkF2tGBF07zdW pVmCKAm2hGUNnVS96WIjrfId5luJ6fxXLuSKdPDCFIv68C6XfzoJ65hdKz5k7wrFH1cu vbe7DvBe7lv9G5YglaNlnPFyra1DdgZ28udXpPwj/0oyrCUGU3bl09zTZENMubEIn9OV 0jj9Hzk1fHNjpY6XrnHwDKWeIAAy+bugQGJIVFSMQk4cRAiIQLpBhAJJGQ+pM0GXtvV7 LOCwSqQP42VZPGdoIo7ArqElPKXGwUCI9KyO8mD+ruJzLglk34dVdS0R7YNm/3x+X/ir Qz+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=JmXsuD1YIa4ZBPjHa1sjxkSvvHvSdwFb0+syuSnCruQ=; b=33Rs8I8YJwFKTBSL6Rdd5IXCEOoQBcFxTVHq1GgSONwfMDHxjA9m3n0se34tf7oX4i Ajw/s2/SaRZrm6zxPEo61OTLSZuyDESQ/j3ffFkM91z3G3y5irBZ5rEVft/oS9nM6xHp 3oML8gNv3og+n6To8TQ3TNtJzuAy6KvSJ6ReDYbzTDmQ7lhJ+MOSaRNFgRa/P94fSqf9 3Q0GN2WN2HsNMSq8gbLCH+7D4OwTsrOX791ovzgd1Yo8tPIEqAxA3qMyF89iAVIEHiup HuFV5zwOGZNBox5jcMUbtzF2h7vSk2kuJztZTWmr7/M6JAIoltbLiaFLA0kvhGCRYLLX QtuQ== X-Gm-Message-State: AJIora/gxWTOcqRcpNwc3lzifLKQv4gkhDO4PFcECRiAGMfUtMeeUoma YGfBa8dTaFhsAOJ2whaEB318UZBPmFXDOoF2 X-Received: by 2002:a05:6512:39c4:b0:48a:74b0:d350 with SMTP id k4-20020a05651239c400b0048a74b0d350mr6525640lfu.426.1658860686897; Tue, 26 Jul 2022 11:38:06 -0700 (PDT) Received: from [192.168.219.3] ([78.8.192.131]) by smtp.gmail.com with ESMTPSA id g18-20020ac24d92000000b0048a7c1bed52sm2339150lfe.87.2022.07.26.11.38.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2022 11:38:06 -0700 (PDT) Date: Tue, 26 Jul 2022 19:38:01 +0100 (BST) From: "Maciej W. Rozycki" <macro@embecosm.com> To: gcc-patches@gcc.gnu.org Subject: [PATCH] RISC-V: Standardize formatting of SFB ALU conditional move Message-ID: <alpine.DEB.2.20.2207261916490.10833@tpp.orcam.me.uk> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Cc: Kito Cheng <kito.cheng@gmail.com>, Andrew Waterman <andrew@sifive.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1739441535365852927?= X-GMAIL-MSGID: =?utf-8?q?1739441535365852927?= |
Series |
RISC-V: Standardize formatting of SFB ALU conditional move
|
|
Commit Message
Maciej W. Rozycki
July 26, 2022, 6:38 p.m. UTC
Standardize the formatting of SFB ALU conditional move operations from: beq a2,zero,1f; mv a0,zero; 1: # movcc to: beq a2,zero,1f # movcc mv a0,zero 1: for consistency with other assembly code produced. No functional change. gcc/ * gcc/config/riscv/riscv.md (*mov<GPR:mode><X:mode>cc): Fix output pattern formatting. --- Hi, No regressions in `-mtune=sifive-7-series' testing except for: FAIL: gcc.target/riscv/pr105314.c -O0 scan-assembler-not \tbeq\t FAIL: gcc.target/riscv/pr105314.c -O1 scan-assembler-not \tbeq\t FAIL: gcc.target/riscv/pr105314.c -O2 scan-assembler-not \tbeq\t FAIL: gcc.target/riscv/pr105314.c -O3 -g scan-assembler-not \tbeq\t FAIL: gcc.target/riscv/pr105314.c -Os scan-assembler-not \tbeq\t FAIL: gcc.target/riscv/pr105314.c -O2 -flto -fno-use-linker-plugin -flto-partition=none scan-assembler-not \tbeq\t FAIL: gcc.target/riscv/pr105314.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects scan-assembler-not \tbeq\t as expected due to the brokenness of the test case, as discussed here: <https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598542.html> (still unresolved). OK to apply? Maciej --- gcc/config/riscv/riscv.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) gcc-riscv-movcc-format.diff
Comments
On Tue, 26 Jul 2022, Maciej W. Rozycki wrote: > Standardize the formatting of SFB ALU conditional move operations from: > > beq a2,zero,1f; mv a0,zero; 1: # movcc > > to: > > beq a2,zero,1f # movcc > mv a0,zero > 1: > > for consistency with other assembly code produced. No functional change. Ping for: <https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598854.html> Maciej
OK, thanks for tweaking this! On Thu, Aug 18, 2022 at 10:40 PM Maciej W. Rozycki <macro@embecosm.com> wrote: > > On Tue, 26 Jul 2022, Maciej W. Rozycki wrote: > > > Standardize the formatting of SFB ALU conditional move operations from: > > > > beq a2,zero,1f; mv a0,zero; 1: # movcc > > > > to: > > > > beq a2,zero,1f # movcc > > mv a0,zero > > 1: > > > > for consistency with other assembly code produced. No functional change. > > Ping for: > <https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598854.html> > > Maciej
On Thu, 18 Aug 2022, Kito Cheng wrote:
> OK, thanks for tweaking this!
Committed now, thanks for your review!
Would you mind sharing your opinion on my previous observation here:
<https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598542.html>?
I have since realised we have a `-mbranch-cost=' option letting the user
set the threshold for choosing branches over alternative code sequences,
so my concern is valid even for our tree unchanged and without the change
just committed here applied. Consequently the test case may fail.
E.g. with:
RUNTESTFLAGS="--target_board remote-unmatched/-mbranch-cost=1 riscv.exp=pr105314.c"
I get:
PASS: gcc.target/riscv/pr105314.c -O0 (test for excess errors)
FAIL: gcc.target/riscv/pr105314.c -O0 scan-assembler-not \tbeq\t
PASS: gcc.target/riscv/pr105314.c -O1 (test for excess errors)
FAIL: gcc.target/riscv/pr105314.c -O1 scan-assembler-not \tbeq\t
[...]
=== gcc Summary ===
# of expected passes 9
# of unexpected failures 9
because GCC legitimately chooses to emit branches as less costly in this
case.
I think we need to pacify the test case somehow if it does not match the
criteria for PR105314, either by excluding the case from testing in that
situation or by forcing it via command-line options to make it match the
criteria (or indeed by verifying a branch is produced regardless). Sadly
Jakub chose not to chime in and it's not clear to me which approach would
be the most appropriate here.
Maciej
Index: gcc/gcc/config/riscv/riscv.md =================================================================== --- gcc.orig/gcc/config/riscv/riscv.md +++ gcc/gcc/config/riscv/riscv.md @@ -2187,8 +2187,8 @@ (match_operand:GPR 4 "sfb_alu_operand" "rJ,IL")))] "TARGET_SFB_ALU" "@ - b%C5 %1,%z2,1f; mv %0,%z4; 1: # movcc - b%C5 %1,%z2,1f; li %0,%4; 1: # movcc" + b%C5\t%1,%z2,1f\t# movcc\;mv\t%0,%z4\n1: + b%C5\t%1,%z2,1f\t# movcc\;li\t%0,%4\n1:" [(set_attr "length" "8") (set_attr "type" "sfb_alu") (set_attr "mode" "<GPR:MODE>")])