diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index abac964224..33f02b6696 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -1083,9 +1083,9 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { static_cast(static_cast(1) << shift) / divisor_abs; int64_t multiplier; if (multiplier_f - floor(multiplier_f) < 0.5) { - multiplier = floor(multiplier_f); + multiplier = static_cast(floor(multiplier_f)); } else { - multiplier = floor(multiplier_f) + 1; + multiplier = static_cast(floor(multiplier_f)) + 1; } // The multiplier is a uint32. ASSERT(multiplier > 0 && @@ -1096,7 +1096,7 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { __ test(dividend, dividend); DeoptimizeIf(zero, instr->environment()); } - __ mov(edx, multiplier); + __ mov(edx, static_cast(multiplier)); __ imul(edx); if (static_cast(multiplier) < 0) { __ add(edx, scratch); diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 4f71f83bf9..5d4316af1c 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -945,9 +945,9 @@ void LCodeGen::DoMathFloorOfDiv(LMathFloorOfDiv* instr) { static_cast(static_cast(1) << shift) / divisor_abs; int64_t multiplier; if (multiplier_f - floor(multiplier_f) < 0.5) { - multiplier = floor(multiplier_f); + multiplier = static_cast(floor(multiplier_f)); } else { - multiplier = floor(multiplier_f) + 1; + multiplier = static_cast(floor(multiplier_f)) + 1; } // The multiplier is a uint32. ASSERT(multiplier > 0 &&