From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Gustavo Pimentel <Gustavo.Pimentel@synopsys.com>
Cc: "linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
Joao Pinto <Joao.Pinto@synopsys.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARC: bitops: Remove unecessary operation and value
Date: Thu, 5 Nov 2020 23:16:42 +0000 [thread overview]
Message-ID: <d1851511-51aa-de74-cdfd-d1bfc510b5a3@synopsys.com> (raw)
In-Reply-To: <21124fbdd2ebfe150cc750f673a31e89d6fe5752.1603314740.git.gustavo.pimentel@synopsys.com>
On 10/21/20 2:12 PM, Gustavo Pimentel wrote:
> The 1-bit shift rotation to the left on x variable located on
> 4 last if statement can be removed because the computed value is will
> not be used afront.
All of constant_fls() is anyhow optimized away at compile time, so this
won't affect any code-gen at all, still this patch is legit.
> Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Added to for-curr !
Thx,
-Vineet
> ---
> arch/arc/include/asm/bitops.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h
> index 50eb3f6..8cddddc 100644
> --- a/arch/arc/include/asm/bitops.h
> +++ b/arch/arc/include/asm/bitops.h
> @@ -297,10 +297,8 @@ static inline int constant_fls(unsigned int x)
> x <<= 2;
> r -= 2;
> }
> - if (!(x & 0x80000000u)) {
> - x <<= 1;
> + if (!(x & 0x80000000u))
> r -= 1;
> - }
> return r;
> }
>
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
prev parent reply other threads:[~2020-11-05 23:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 21:12 [PATCH] ARC: bitops: Remove unecessary operation and value Gustavo Pimentel
2020-11-05 23:16 ` Vineet Gupta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d1851511-51aa-de74-cdfd-d1bfc510b5a3@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=Gustavo.Pimentel@synopsys.com \
--cc=Joao.Pinto@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).