Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 7d62d5c76e535117f32c1a9627b2b9f68d03a318..95fba8c4e065b87e6f6c863a5d2303f613bf0302 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -1414,10 +1414,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) { |
return; |
} |
- __ FlooringDiv(dividend, Abs(divisor)); |
- __ mov(eax, dividend); |
- __ shr(eax, 31); |
- __ add(edx, eax); |
+ __ TruncatingDiv(dividend, Abs(divisor)); |
__ imul(edx, edx, Abs(divisor)); |
__ mov(eax, dividend); |
__ sub(eax, edx); |
@@ -1544,10 +1541,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) { |
DeoptimizeIf(zero, instr->environment()); |
} |
- __ FlooringDiv(dividend, Abs(divisor)); |
- __ mov(eax, dividend); |
- __ shr(eax, 31); |
- __ add(edx, eax); |
+ __ TruncatingDiv(dividend, Abs(divisor)); |
if (divisor < 0) __ neg(edx); |
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) { |
@@ -1671,7 +1665,8 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) { |
DeoptimizeIf(zero, instr->environment()); |
} |
- __ FlooringDiv(dividend, divisor); |
+ // TODO(svenpanne) Add correction terms. |
+ __ TruncatingDiv(dividend, divisor); |
} |