Release Note: java.lang.Float.floatToFloat16 and java.lang.Float.float16ToFloat May Return Different NaN Results when Optimized by the JIT Compiler

XMLWordPrintable

    • 20

      JDK 20 introduces two new methods which can be used to convert to and from the IEEE 754 binary16 format: `java.lang.Float.floatToFloat16` and `java.lang.Float.float16ToFloat`.

      The new methods may return different NaN results when optimized by the JIT compiler. To disable the JIT compiler optimization of these methods, the following command line options can be used:

      `-XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_floatToFloat16,_float16ToFloat`

            Assignee:
            Tobias Hartmann
            Reporter:
            Mikael Vidstedt
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: