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

Unified Diff: src/ia32/lithium-codegen-ia32.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/arm/macro-assembler-arm.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698