RFR: 8350835: C2 SuperWord: assert/wrong result when using Float.float16ToFloat with byte instead of short input [v2]

Emanuel Peter epeter at openjdk.org
Thu Mar 13 07:45:57 UTC 2025


On Mon, 10 Mar 2025 21:26:41 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Float.float16ToFloat generates wrong vectorized code in product build and asserts in fastdebug/debug when argument is of type byte, int, or long array. The short term solution is to not auto vectorize in these cases.
>> 
>> Review comments are welcome.
>> 
>> Best Regards,
>> Sandhya
>
> Sandhya Viswanathan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review comments

Looks much better :)

You are right `Generators` are missing cases for `short`, `byte`, `char`. You could leave those cases with regular `Random`, but the `int` and `long` cases with `Generators`, to make sure interesing values are added to the mix more frequently.

test/hotspot/jtreg/compiler/vectorization/TestFloat16ToFloatConv.java line 30:

> 28: * @summary Test bug fix for JDK-8350835 discovered through Template Framework
> 29: * @library /test/lib /
> 30: * @run main/othervm compiler.vectorization.TestFloat16ToFloatConv

Suggestion:

* @run driver compiler.vectorization.TestFloat16ToFloatConv

I don't think you need a new VM if you have no additional flags ;)

test/hotspot/jtreg/compiler/vectorization/TestFloat16ToFloatConv.java line 113:

> 111: 
> 112:     @Test
> 113:     // Not vectorized due to JDK-8350835

That's very non-descriptive. Actually, that is the current bug, so this is not even a future RFE that intends to fix it.
Can you please say why it is not vectorizing now, and what might be possible conditions when it would be ok to vectorize in the future? Could we even file an RFE for this?

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

Changes requested by epeter (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23939#pullrequestreview-2680819988
PR Review Comment: https://git.openjdk.org/jdk/pull/23939#discussion_r1992943827
PR Review Comment: https://git.openjdk.org/jdk/pull/23939#discussion_r1992942306


More information about the hotspot-compiler-dev mailing list