On Tue, 3 Sep 2024 08:39:02 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>> I found similar small improvements to be had (I wrote about them offline) >> when replacing the bitwise-based tests (e.g. `foo & 4 != 0`) with a more >> explicit check for `remainingBytes >=4`. Seems like bitwise operations are >> not as optimized (or perhaps the assembly instructions for them is overall >> more convoluted - I haven't checked). > > I've tried > > > final long longValue = Byte.toUnsignedLong(value) * 0x0101010101010101L; > > > But it had the same performance as explicit bit shifting on M1. @minborg the ` ELEM_SIZE` is a `Param` field right? Just to be 100% sure of it... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20712#discussion_r1741681612