RFR: 8295159: DSO created with -ffast-math breaks Java floating-point arithmetic [v7]

John R Rose jrose at openjdk.org
Wed Oct 26 02:27:29 UTC 2022


On Tue, 25 Oct 2022 23:13:08 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> …very modest impact while still being able to catch important types of MXCSR corruption. I fully support having it turned on by default for JNI calls.

I guess I agree.  With the clever test for the bad mode Java cares about, the overhead is small compared to an empty JNI call, and very small compared to any normally non-empty JNI call.

Now I'm curious:  What's this magic code?  Does it multiply a couple of well-chosen constants and test for zero?

I said "I guess" because I'm not clear on (a) the benefit of adding that nanosecond (other than preserving denorms against a rare system fault), nor on (b) what are the remaining faults not checked for, but which a more expensive MSR spill/restore would fix.

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

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



More information about the build-dev mailing list