On Mon, 17 Jun 2024 08:07:40 GMT, Shaojin Wen wrote:
>> test/micro/org/openjdk/bench/java/lang/MergeStoreBench.java line 656:
>>
>>> 654: array[offset + 2] = (byte) (value >> 8);
>>> 655: array[offset + 3] = (byte) (value );
>>> 656: }
>>
>> You say that here `MergeStore` does not work. That is because the indices
>> are increasing, but the shifts decreasing. So that does not work on
>> little-endian machines (most architectures), but I would expect it to work
>> on big-endian machines with https://github.com/openjdk/jdk/pull/19218.
>
> Big endian is often used in network data transmission scenarios, and it is
> common to process big endian data on a little endian machine. In this case,
> can it be optimized to Integer.reverseBytes & putIntLittleEndian on a
> LittleEndian machine? `setIntB -> setIntRL`
I had already suggested that here:
https://github.com/openjdk/jdk/pull/19218#pullrequestreview-2076196539
Feel free to file an RFE. Maybe someone wants to work on it. I think it would
not be that hard to make it work given all the code that is already there now.
And it would be helpful in for both big/little endian to be able to do both
orders.
-
PR Review Comment: https://git.openjdk.org/jdk/pull/19734#discussion_r1643088147