[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.22.394.2302121611010.9268@hadrien>
Date: Sun, 12 Feb 2023 16:11:58 +0100 (CET)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Deepak R Varma <drv@...lo.com>
cc: Bart Van Assche <bvanassche@....org>, Michael Reed <mdr@....com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
Saurabh Singh Sengar <ssengar@...rosoft.com>,
Praveen Kumar <kumarpraveen@...ux.microsoft.com>
Subject: Re: [PATCH] scsi: qla1280: Replace arithmetic addition by bitwise
OR
On Sun, 12 Feb 2023, Deepak R Varma wrote:
> On Sat, Feb 11, 2023 at 03:25:03PM -0800, Bart Van Assche wrote:
> > On 2/7/23 03:54, Deepak R Varma wrote:
> > > When adding two bit-field mask values, an OR operation offers higher
> > > performance over an arithmetic operation. So, convert such addition to
> > > an OR based expression.
> >
> > Where is the evidence that supports this claim? On the following page I read
> > that there is no performance difference when using a modern CPU: https://cs.stackexchange.com/questions/75811/why-is-addition-as-fast-as-bit-wise-operations-in-modern-processors
> >
>
> Hello Bart,
> You are correct. Modern CPU designs have improved addition and the performance
> is at par with the bitwise operation. The document I had read earlier mentioned
> a performance improvement for old CPUs and microprocessors, which today is not
> the case. Thank you for sharing the link.
>
> > > Issue identified using orplus.cocci semantic patch script.
> >
> > Where is that script located? Can it be deleted such that submission of
> > patches similar to this patch stops?
>
> I have added Julia to this email to understand how to best use this semantic
> patch. I already discussed with her on improving the Semantic patch such that it
> doesn't suggest making change when constants are involved.
FWIW, the semantic patch was never motivated by efficiency, but rather
with the goal of making the code more understandable.
julia
Powered by blists - more mailing lists