Integrated: 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:57 UTC 2026
On Mon, 5 Jan 2026 11:55:01 GMT, Emanuel Peter <epeter 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.
This pull request has now been integrated.
Changeset: 2cb228e1
Author: Emanuel Peter <epeter at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/2cb228e142369ec73d768d8a69653a984b1c5908
Stats: 5 lines in 1 file changed: 2 ins; 1 del; 2 mod
8374489: Template Library: need to tag Float16.float16ToRawShortBits as having non-deterministic result because of multiple NaN bit patterns
Reviewed-by: chagedorn, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/29033
More information about the hotspot-compiler-dev
mailing list