RFR: 8374489: Template Library: need to tag Float16.float16ToRawShortBits as having non-deterministic result because of multiple NaN bit patterns
Emanuel Peter
epeter at openjdk.org
Tue Jan 6 08:54:55 UTC 2026
On Mon, 5 Jan 2026 18:46:10 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> In [JDK-8370922](https://bugs.openjdk.org/browse/JDK-8370922), I added Float16 support to the Template Library. I missed to tag Float16.float16ToRawShortBits as having non-deterministic result.
>>
>> We need to do that, just like for float and double equivalents:
>> Arithmetic operations (e.g. add, mul, fma, ...) are allowed to pick either input if it gets two NaNs of different bit patterns.
>> That way, those operations can generate different NaN bit patterns depending on if we use interpreter/C1/C2.
>> If we now convert to raw bits, we get different bits, and would wrongly conclude that we get a wrong result.
>>
>> Since this is a test-bug, I have no regression test. But I verified it manually, that with the same seed (for the ExpressionFuzzer) that fails before this change, we now succeed after the change.
>
> Good.
@vnkozlov @chhagedorn Thanks for the reviews!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29033#issuecomment-3713746281
More information about the hotspot-compiler-dev
mailing list