RFR: 8347405: MergeStores with reverse bytes order value

Emanuel Peter epeter at openjdk.org
Fri Jan 10 11:21:46 UTC 2025


On Fri, 10 Jan 2025 11:01:44 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/memnode.cpp line 3002:
>> 
>>> 3000:                Matcher::match_rule_supported(Op_ReverseBytesL)) {
>>> 3001:       _value_order = DataOrder::Reverse;  // only support reverse bytes
>>> 3002: #endif
>> 
>> Can you leave a comment why we only need this for little endian? It seems you are now generating `ReverseByte` nodes on any platform, right?
>
> Ah, maybe that is because you have not `big-endian` machine to test on. We could leave this to someone who cares about big-endian - and they could also adjust the tests accordingly.

Suggestion:

#ifdef VM_LITTLE_ENDIAN
    // For now, we only implement Reverse order for little-endian, and only for bytes.
    } else if (memory_size == 1 &&
               Matcher::match_rule_supported(Op_ReverseBytesI) &&
               Matcher::match_rule_supported(Op_ReverseBytesL)) {
      _value_order = DataOrder::Reverse;  // First pair has Reverse order.
#endif

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23030#discussion_r1910228511


More information about the hotspot-compiler-dev mailing list