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

Unified Diff: src/mips/lithium-codegen-mips.cc

Issue 867453002: MIPS: Use signaling NaN for holes in fixed double arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: port Benedikt's fix for x87 sNaN corruption in simulator. Created 5 years, 11 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/codegen-mips.cc ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
index 4ec552dde1da15b6d9f0cfa070ce5a8771406766..2c5e7f1cb8f2bd2a450a58e4a527cc86b3c240e2 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -1744,6 +1744,20 @@ void LCodeGen::DoConstantS(LConstantS* instr) {
void LCodeGen::DoConstantD(LConstantD* instr) {
DCHECK(instr->result()->IsDoubleRegister());
DoubleRegister result = ToDoubleRegister(instr->result());
+#if V8_HOST_ARCH_IA32
+ // Need some crappy work-around for x87 sNaN -> qNaN breakage in simulator
+ // builds.
+ uint64_t bits = instr->bits();
+ if ((bits & V8_UINT64_C(0x7FF8000000000000)) ==
+ V8_UINT64_C(0x7FF0000000000000)) {
+ uint32_t lo = static_cast<uint32_t>(bits);
+ uint32_t hi = static_cast<uint32_t>(bits >> 32);
+ __ li(at, Operand(lo));
+ __ li(scratch0(), Operand(hi));
+ __ Move(result, at, scratch0());
+ return;
+ }
+#endif
double v = instr->value();
__ Move(result, v);
}
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698