Thread (31 messages) 31 messages, 6 authors, 2024-03-01

Re: [PATCH 4/6] arm64/io: Provide a WC friendly __iowriteXX_copy()

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2024-02-23 12:54:26
Also in: linux-arch, linux-arm-kernel, linux-patches, linux-rdma, linux-s390, llvm

On Fri, Feb 23, 2024 at 11:05:29AM +0000, David Laight wrote:
...
quoted
quoted
quoted
quoted
quoted
+		if ((_count % 8) >= 4) {
If (_count & 4) {
That would be obfuscating, IMHO. The compiler doesn't need such things
to generate optimal code.
Try it: https://godbolt.org/z/EvvGrTxv3
And it isn't that obfuscated - no more so than your version.
The godbolt link does "n % 8 > 4" instead of "... >= 4" as in Jason's
original code. With ">=" the compiled code matches that for "n & 4".
Bugger :-)
Yes, I already fine tuned things to get good codegen.

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help