Problems with double reminder on Windows/x86_64 and Visual Studio 2005
Thomas.Rodriguez at Sun.COM
Tue Aug 26 13:30:37 PDT 2008
I can't confirm your problem but I'm not entirely surprised by it.
> 1. Is it ok that the intrinsic for Math.log10() leaves the exceptions
> bits as they are in the FP status word?
The assembly we generate assumes that this is ok but it appears that
calling out into library code could expose problems with this.
> PS: the obvious solution of calling "_clearfp()" as defined in
> <float.h> just before a call to "fmod()" unfortunately doesn't work,
> because "_clearfp()" (at least in MSVC 2005) only cleans the SSE
> status register MXCSR. The only solution I see right now is using the
> FCLEX assembler instruction, and because MSVC 2005 has no inline
> assembler for x86_64 I'll probably have to write the whole assembler
> function for the assembler instruction. Or does somebody have a
> smarter solution?
You could add the FCLEX to Java_to_Runtime encoding in
windows_x86_64.ad though this will change all the CallLeaf variants.
It would be nice if we never called out to C code for utility
functions like this. We should have our own assembly versions of
these functions to shield ourselves from problems.
> PPS: this is a nice example, how a compiler switch can get you a lot
> of fun (isn't it Kelly:) ...
More information about the hotspot-dev