But the whole point is that it stays enabled when you return, right?
Yes, the point is to have it stay enabled so that it works with the fp code the JVM runs, not just inside the JNI call.
So just for my (perhaps slow) understanding, does this mean you might have to set some non-standard flags on the JVM to stop it from enforcing default settings there? Or is it just a testing issue?
No, you don't have to set a flag, there's no such flag anyway. The JVM, at some point around Java 5, was restoring MXCSR with the value it expects after every single JNI call. Unfortunately changing MXCSR is a very expensive, serializing operation and it totally killed performance, so the JVM doesn't do it anymore. You can enable that behavior with . Afaict, this flag resets MXCSR without even checking if it changed. Using on the other hand does in fact check if the value changed, prints a warning, then resets MXCSR (or crashes on Linux ). This is what was happening with the LWJGL tests.
So, indeed it's a testing issue. But people should be aware that they're going behind the JVM's back with this trick and only use it if absolutely necessary.