RFR (S): Failure after windows compiler upgrade
Nils Eliasson
nils.eliasson at oracle.com
Mon Apr 27 14:10:38 UTC 2015
Hi,
Please review this patch.
The bug is caused by the instruction sequence generated by the visual
studio compiler when casting a long to a float.
Visual Studio 2013 has a new behavior where it defaults to generating
code targeting SSE2 (and avoids x87). Compiling for a 64-bit target
gives the same result as before. Compiling for 32bit VS2013 generates a
call to _ltod3 (long2double) and then uses a sse2 instruction to cast it
to a float. Casting the long to a double and then to a float gives a
different result than casting directly to a float. This is true on all
tested configurations. It is unclear why they just didn't use a MOVQ to
load the long to an XMM register and then use the same cvtsi2ss as in
the other configurations.
To fix this we need to add the /arch:IA32 flag to all i586 windows
builds. It looks like the IA32 option is ignored on 64-bit builds but we
shouldn't count on that. A drawback is that this option also prevents
any usage of SSE on the i586 platform.
Bug: https://bugs.openjdk.java.net/browse/JDK-8077590
Webrev: http://cr.openjdk.java.net/~neliasso/8077590/webrev.03/
Regards
Nils
More information about the hotspot-dev
mailing list