Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8302976 C2 Intrinsification of Float.floatToFloat16 and Float.float16ToFloat Yields Different Result than the Interpreter
  3. JDK-8303035

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`

            thartmann Tobias Hartmann
            mikael Mikael Vidstedt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: