RFR: 8295351: java/lang/Float/Binary16Conversion.java fails with "Unexpected result of converting"

David Holmes dholmes at openjdk.org
Wed Nov 23 05:09:23 UTC 2022


On Tue, 22 Nov 2022 21:52:59 GMT, Smita Kamath <svkamath at openjdk.org> wrote:

> 8295351: java/lang/Float/Binary16Conversion.java fails with "Unexpected result of converting"

src/hotspot/share/runtime/sharedRuntime.cpp line 455:

> 453:   union {jfloat f; juint i;} bits;
> 454:   bits.f = x;
> 455:   jint doppel = bits.i;

Doesn't the conversion from unsigned to signed risk a compiler warning being emitted?

Can't you just use the existing `JavaValue` type to perform the union conversion trick?

-------------

PR: https://git.openjdk.org/jdk/pull/11301


More information about the hotspot-dev mailing list