Re: [PATCH v3 0/5] bswap.h: Rework ntohl handling
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Jul 15, 2025, 22:36 UTC
- Message-ID
- <aHbX4hIKbjO6h1R5@fruit.crustytoothpaste.net>
- In-Reply-To
- <xmqqple1f7ge.fsf@gitster.g>
On 2025-07-15 at 21:52:01, Junio C Hamano wrote:
Show 5 quoted lines
> Thanks for updating the proposed log messages with typofixes. I > understand the patch text has no changes? > > Cc'ed those who gave comments on the previous round. How does this > version look to you folks?
This seems fine to me.
I might go a little farther and simply say that recognizing the pattern and emitting the most efficient code, whether that's a single instruction or an optimized pattern of instructions, is a quality-of-implementation issue in the compiler's peephole optimizer[0] and that we don't really need to use the builtin functions or provide special cases for MSVC still, but I realize that is not a very popular opinion and I think this series is fine without that.
[0] Byte swapping, population count, and rotations are, in my view, the most frequently open-coded functions and thus every compiler with a peephole optimizer should recognize and handle them.
-- brian m. carlson (they/them) Toronto, Ontario, CA