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

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

Issue 203443009: MIPS: Tweaked FlooringDiv back to TruncatingDiv again. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: 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 | « no previous file | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
index 7311db6a127da5d04fed5dac8aef783b55e89a1a..827503e8760cbf84ce12350283600d2ebe04a605 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -1111,9 +1111,7 @@ void LCodeGen::DoModByConstI(LModByConstI* instr) {
return;
}
- __ FlooringDiv(result, dividend, Abs(divisor));
- __ srl(at, dividend, 31);
- __ Addu(result, result, at);
+ __ TruncatingDiv(result, dividend, Abs(divisor));
__ Mul(result, result, Operand(Abs(divisor)));
__ Subu(result, dividend, Operand(result));
@@ -1230,9 +1228,7 @@ void LCodeGen::DoDivByConstI(LDivByConstI* instr) {
DeoptimizeIf(eq, instr->environment(), dividend, Operand(zero_reg));
}
- __ FlooringDiv(result, dividend, Abs(divisor));
- __ srl(at, dividend, 31);
- __ Addu(result, result, Operand(at));
+ __ TruncatingDiv(result, dividend, Abs(divisor));
if (divisor < 0) __ Subu(result, zero_reg, result);
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) {
@@ -1371,7 +1367,8 @@ void LCodeGen::DoFlooringDivByConstI(LFlooringDivByConstI* instr) {
DeoptimizeIf(eq, instr->environment(), dividend, Operand(zero_reg));
}
- __ FlooringDiv(result, dividend, divisor);
+ // TODO(svenpanne) Add correction terms.
+ __ TruncatingDiv(result, dividend, divisor);
}
« no previous file with comments | « no previous file | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698