Reviewers: Yang,

Description:
Set x87 FPU precision to 64-bit for MinGW on V8 init to fix failing test

Contributed by [email protected]

BUGS=v8:1062
TEST=

Please review this at https://chromiumcodereview.appspot.com/9599004/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/platform-win32.cc
  M     src/win32-headers.h
  M     test/cctest/test-strtod.cc


Index: src/platform-win32.cc
===================================================================
--- src/platform-win32.cc       (revision 10912)
+++ src/platform-win32.cc       (working copy)
@@ -539,6 +539,10 @@


 void OS::SetUp() {
+#ifdef __MINGW32__
+  // Set x87 FPU precision to 64-bit to be consistent with MSVC.
+  _controlfp(_PC_53, _MCW_PC);
+#endif
   // Seed the random number generator.
// Convert the current time to a 64-bit integer first, before converting it // to an unsigned. Going directly can cause an overflow and the seed to be
Index: src/win32-headers.h
===================================================================
--- src/win32-headers.h (revision 10912)
+++ src/win32-headers.h (working copy)
@@ -63,6 +63,7 @@
 // header files to expose getaddrinfo.
 #undef _WIN32_WINNT
 #define _WIN32_WINNT 0x501
+#include <float.h>  // for _controlfp
 #endif  // __MINGW32__
 #if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR)
 #include <dbghelp.h>  // For SymLoadModule64 and al.
Index: test/cctest/test-strtod.cc
===================================================================
--- test/cctest/test-strtod.cc  (revision 10912)
+++ test/cctest/test-strtod.cc  (working copy)
@@ -23,6 +23,8 @@


 TEST(Strtod) {
+  v8::V8::Initialize();
+
   Vector<const char> vector;

   vector = StringToVector("0");


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to