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

Unified Diff: src/platform-posix.cc

Issue 11275184: First draft of the sh4 port Base URL: http://github.com/v8/v8.git@master
Patch Set: Use GYP and fixe some typos Created 8 years, 1 month 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/platform-linux.cc ('k') | src/regexp-macro-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index 3bc83733ca21249808c74388dd98de6be4125497..1c65be226c385ffbe47305caf84e27c57e5a102a 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -149,7 +149,19 @@ UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction())
double OS::nan_value() {
// NAN from math.h is defined in C99 and not in POSIX.
+
+#if defined(V8_TARGET_ARCH_SH4)
+ // Return a qNaN as expected by the v8 core. In sh4 tool chain, the NAN macro
+ // is defined to be an sNaN while the C specifications require a qNaN.
+ union {
+ uint64_t ui64;
+ double d;
+ } value;
+ value.ui64 = (static_cast<uint64_t>(0x7ff00000) << 32) | 0x00000001;
+ return value.d;
+#else
return NAN;
+#endif
}
« no previous file with comments | « src/platform-linux.cc ('k') | src/regexp-macro-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698