Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 197873029: Tweaked FlooringDiv back to TruncatingDiv again. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698