Commit 5d641ec9 authored by Benedikt Meurer's avatar Benedikt Meurer

[arm] Work-around sNaN issue in ARM simulator builds on IA-32.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/861093003

Cr-Commit-Position: refs/heads/master@{#26184}
parent 322ba6d8
......@@ -1360,6 +1360,7 @@ class LConstantD FINAL : public LTemplateInstruction<1, 0, 0> {
DECLARE_HYDROGEN_ACCESSOR(Constant)
double value() const { return hydrogen()->DoubleValue(); }
uint64_t bits() const { return hydrogen()->DoubleValueAsBits(); }
};
......
......@@ -1904,6 +1904,20 @@ void LCodeGen::DoConstantS(LConstantS* instr) {
void LCodeGen::DoConstantD(LConstantD* instr) {
DCHECK(instr->result()->IsDoubleRegister());
DwVfpRegister 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);
__ mov(ip, Operand(lo));
__ mov(scratch0(), Operand(hi));
__ vmov(result, ip, scratch0());
return;
}
#endif
double v = instr->value();
__ Vmov(result, v, scratch0());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment