RFR: 8333840: C2 SuperWord: wrong result for MulAddS2I when inputs permuted [v2]

Christian Hagedorn chagedorn at openjdk.org
Thu Jun 13 14:26:18 UTC 2024


On Wed, 12 Jun 2024 12:52:24 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> This is an older bug, I discovered it by manual code inspection while refactoring.
>> 
>> I added some regression tests that produced wrong results.
>> 
>> You should understand the fix given the comments in the code, if not: tell me how to improve them ;)
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   improve naming

src/hotspot/share/opto/superword.cpp line 2832:

> 2830: }
> 2831: 
> 2832: // MulAddS2I takes shorts 4 shorts and produces an int. We can reinterpret

Suggestion:

// MulAddS2I takes 4 shorts and produces an int. We can reinterpret

src/hotspot/share/opto/superword.cpp line 2840:

> 2838: //
> 2839: // But permutations are possible, because add and mul are commutative. For
> 2840: // simplicity, we the first input is always either a0 or a1. These are all

Suggestion:

// simplicity, the first input is always either a0 or a1. These are all

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19619#discussion_r1636425803
PR Review Comment: https://git.openjdk.org/jdk/pull/19619#discussion_r1636426802


More information about the hotspot-compiler-dev mailing list