| Index: src/compiler/ia32/code-generator-ia32.cc
|
| diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc
|
| index 9d9a5691c6c3454bf3b910b39dc1905a78ce1b48..97b37060be3ee12b14d012ce592a4da22bf239e2 100644
|
| --- a/src/compiler/ia32/code-generator-ia32.cc
|
| +++ b/src/compiler/ia32/code-generator-ia32.cc
|
| @@ -59,6 +59,9 @@ class IA32OperandConverter : public InstructionOperandConverter {
|
| switch (constant.type()) {
|
| case Constant::kInt32:
|
| return Immediate(constant.ToInt32());
|
| + case Constant::kFloat32:
|
| + return Immediate(
|
| + isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED));
|
| case Constant::kFloat64:
|
| return Immediate(
|
| isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED));
|
| @@ -839,8 +842,22 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
|
| } else if (destination->IsStackSlot()) {
|
| Operand dst = g.ToOperand(destination);
|
| __ mov(dst, g.ToImmediate(source));
|
| + } else if (src_constant.type() == Constant::kFloat32) {
|
| + // TODO(turbofan): Can we do better here?
|
| + Immediate src(bit_cast<int32_t>(src_constant.ToFloat32()));
|
| + if (destination->IsDoubleRegister()) {
|
| + XMMRegister dst = g.ToDoubleRegister(destination);
|
| + __ push(Immediate(src));
|
| + __ movss(dst, Operand(esp, 0));
|
| + __ add(esp, Immediate(kDoubleSize / 2));
|
| + } else {
|
| + DCHECK(destination->IsDoubleStackSlot());
|
| + Operand dst = g.ToOperand(destination);
|
| + __ mov(dst, src);
|
| + }
|
| } else {
|
| - double v = g.ToDouble(source);
|
| + DCHECK_EQ(Constant::kFloat64, src_constant.type());
|
| + double v = src_constant.ToFloat64();
|
| uint64_t int_val = bit_cast<uint64_t, double>(v);
|
| int32_t lower = static_cast<int32_t>(int_val);
|
| int32_t upper = static_cast<int32_t>(int_val >> kBitsPerInt);
|
|
|