Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 10f8e0eba85da7a77957693364a889483b9487ec..7d0d5776c0e8ba42cfc7fab02d7924108820da7a 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -1033,10 +1033,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) { |
return; |
} |
- __ FlooringDiv(dividend, Abs(divisor)); |
- __ movl(rax, dividend); |
- __ shrl(rax, Immediate(31)); |
- __ addl(rdx, rax); |
+ __ TruncatingDiv(dividend, Abs(divisor)); |
__ imull(rdx, rdx, Immediate(Abs(divisor))); |
__ movl(rax, dividend); |
__ subl(rax, rdx); |
@@ -1163,7 +1160,8 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) { |
DeoptimizeIf(zero, instr->environment()); |
} |
- __ FlooringDiv(dividend, divisor); |
+ // TODO(svenpanne) Add correction terms. |
+ __ TruncatingDiv(dividend, divisor); |
} |
@@ -1222,10 +1220,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) { |
DeoptimizeIf(zero, instr->environment()); |
} |
- __ FlooringDiv(dividend, Abs(divisor)); |
- __ movl(rax, dividend); |
- __ shrl(rax, Immediate(31)); |
- __ addl(rdx, rax); |
+ __ TruncatingDiv(dividend, Abs(divisor)); |
if (divisor < 0) __ neg(rdx); |
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) { |