RFR: 8331311: C2: Big Endian Port of 8318446: optimize stores into primitive arrays by combining values into larger store [v4]
Richard Reingruber
rrich at openjdk.org
Wed Jun 5 07:30:04 UTC 2024
On Fri, 24 May 2024 08:24:39 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> I'm running testing again, but the code looks good now!
>
> I just had another idea: Could we use some sort of "byte reverse / shuffle" operation to do these use cases for both big/little-endian?
>
> ```
> storeBytes(bytes, offset, (byte)(value >> 8),
> (byte)(value >> 0));
>
> storeBytes(bytes, offset, (byte)(value >> 0),
> (byte)(value >> 8));
> ```
>
> Not sure if that would be profitable or even available on all platforms. Could be a future RFE someone can work on after this. What do you think? It might make performance more predictable across platforms.
You mean to combine the stores even if the explicit ordering does not match the ordering of the store instruction, adding a `ReverseBytes[SIL]Node` iff supported in that case, right? I've been thinking about this, too. In my opinion it would be worthwhile.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19218#issuecomment-2149074109
More information about the hotspot-compiler-dev
mailing list