Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Unified Diff: src/mips/simulator-mips.cc

Issue 24067002: MIPS/ARM: Fix benchmarks failures on simulator. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix ARM port Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/simulator-mips.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/simulator-mips.cc
diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc
index ea8b65948afe4732a4867024ac93c075d8220cff..1cb330a804115914711e7d88dbcd93f207d2a544 100644
--- a/src/mips/simulator-mips.cc
+++ b/src/mips/simulator-mips.cc
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <limits.h>
+#include <fpu_control.h>
#include <cmath>
#include <cstdarg>
#include "v8.h"
@@ -882,6 +883,8 @@ void Simulator::Initialize(Isolate* isolate) {
Simulator::Simulator(Isolate* isolate) : isolate_(isolate) {
+ set_host_fp_precision();
+
i_cache_ = isolate_->simulator_i_cache();
if (i_cache_ == NULL) {
i_cache_ = new v8::internal::HashMap(&ICacheMatch);
@@ -2917,6 +2920,20 @@ uintptr_t Simulator::PopAddress() {
}
+void Simulator::set_host_fp_precision() {
+#if !V8_HOST_ARCH_MIPS
+ // Set Intel x87 FPU mode to 64-bit double.
+ // The default FPU mode is extended (80-bit),
+ // which can lead to unexpected precision failures.
+ fpu_control_t cw;
+ _FPU_GETCW(cw);
+ cw &= ~_FPU_EXTENDED;
+ cw |= _FPU_DOUBLE;
+ _FPU_SETCW(cw);
+#endif
+}
+
+
#undef UNSUPPORTED
} } // namespace v8::internal
« no previous file with comments | « src/mips/simulator-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698