From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by sourceware.org (Postfix) with ESMTP id 75D0C3858421 for ; Fri, 19 May 2023 19:21:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75D0C3858421 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id A3F2D92009D; Fri, 19 May 2023 21:21:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 95E5792009B; Fri, 19 May 2023 20:21:11 +0100 (BST) Date: Fri, 19 May 2023 20:21:11 +0100 (BST) From: "Maciej W. Rozycki" To: Jeff Law cc: YunQiang Su , gcc-patches@gcc.gnu.org, jiaxun.yang@flygoat.com, syq@debian.org, richard.sandiford@arm.com Subject: Re: [PATCH] MIPS: don't expand large block move In-Reply-To: <62638b5e-d9a5-0ede-0642-ea363d23d055@gmail.com> Message-ID: References: <20230519061152.3154332-1-yunqiang.su@cipunited.com> <62638b5e-d9a5-0ede-0642-ea363d23d055@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3494.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,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 List-Id: On Fri, 19 May 2023, Jeff Law wrote: > > diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc > > index ca491b981a3..00f26d5e923 100644 > > --- a/gcc/config/mips/mips.cc > > +++ b/gcc/config/mips/mips.cc > > @@ -8313,6 +8313,12 @@ mips_expand_block_move (rtx dest, rtx src, rtx > > length) > > } > > else if (optimize) > > { > > + /* When the length is big enough, the lib call has better performace > > + than load/store insns. > > + In most platform, the value is about 64-128. > > + And in fact lib call may be optimized with SIMD */ > > + if (INTVAL(length) >= 64) > > + return false; > Just a formatting nit. Space between INTVAL and the open paren for its > argument list. This is oddly wrapped too. I'd move "performace" (typo there!) to the second line, to align better with the rest of the text. Plus s/platform/platforms/ and there's a full stop missing along with two spaces at the end. Also there's inconsistent style around <= and >=; the GNU Coding Standards ask for spaces around binary operators. And "don't" in the change heading ought to be capitalised. In fact, I'd justify the whole paragraph as each sentence doesn't have to start on a new line, and the commit description could benefit from some reformatting too, as it's now odd to read. > OK with that change. I think the conditional would be better readable if it was flattened though: if (INTVAL (length) <= MIPS_MAX_MOVE_BYTES_STRAIGHT) ... else if (INTVAL (length) >= 64) ... else if (optimize) ... or even: if (INTVAL (length) <= MIPS_MAX_MOVE_BYTES_STRAIGHT) ... else if (INTVAL (length) < 64 && optimize) ... One just wouldn't write it as proposed if creating the whole piece from scratch rather than retrofitting this extra conditional. Ultimately it may have to be tunable as LWL/LWR, etc. may be subject to fusion and may be faster after all. Maciej