Index: src/ia32/lithium-gap-resolver-ia32.cc |
diff --git a/src/ia32/lithium-gap-resolver-ia32.cc b/src/ia32/lithium-gap-resolver-ia32.cc |
index 3da8f320d0b897e4fe66efe6fed9f8d45839384c..d8ea524e3792887cc38e57c8d85ddff315a995c5 100644 |
--- a/src/ia32/lithium-gap-resolver-ia32.cc |
+++ b/src/ia32/lithium-gap-resolver-ia32.cc |
@@ -313,6 +313,25 @@ void LGapResolver::EmitMove(int index) { |
} else { |
__ LoadObject(dst, cgen_->ToHandle(constant_source)); |
} |
+ } else if (destination->IsDoubleRegister()) { |
+ if (CpuFeatures::IsSupported(SSE2)) { |
+ CpuFeatureScope scope(cgen_->masm(), SSE2); |
+ XMMRegister dst = cgen_->ToDoubleRegister(destination); |
+ double v = cgen_->ToDouble(constant_source); |
+ uint64_t int_val = BitCast<uint64_t, double>(v); |
+ int32_t lower = static_cast<int32_t>(int_val); |
+ int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); |
+ if (int_val == 0) { |
+ __ xorps(dst, dst); |
+ } else { |
+ __ push(Immediate(upper)); |
+ __ push(Immediate(lower)); |
+ __ movdbl(dst, Operand(esp, 0)); |
+ __ add(esp, Immediate(kDoubleSize)); |
+ } |
+ } else { |
+ UNREACHABLE(); |
+ } |
} else { |
ASSERT(destination->IsStackSlot()); |
Operand dst = cgen_->ToOperand(destination); |