JDK 20 | JDK 21 |
---|---|
20.0.2Fixed | 21 b14Fixed |
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
JDK-8303035 :
|
The following code snippet prints twice 31745 with the interpreter, and 32257 31745 with -Xcomp -XX:-TieredCompilation. This means, C2 will eliminate both intrinsifications if they are within the same compilation unit (the latter print), and return the same result as the interpreter. But if it applies the intrinsifications respectively in different compilation units and employ the underlying vcvtps2ph and vcvtph2ps instructions (the former print), then it will return a different value. public class Foo { public static short bar(float f) { return Float.floatToFloat16(f); } public static void main(String[] args) { System.out.println(bar(Float.float16ToFloat((short) 31745))); System.out.println(Float.floatToFloat16(Float.float16ToFloat((short) 31745))); } }
|