Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 279eba314911ad49f92c63ffde651354496896a1..06c7a1c7b479490341ac9d15e15b3776ffac02fb 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -5723,9 +5723,9 @@ void CodePatcher::ChangeBranchCondition(Condition cond) { |
} |
-void MacroAssembler::FlooringDiv(Register result, |
- Register dividend, |
- int32_t divisor) { |
+void MacroAssembler::TruncatingDiv(Register result, |
+ Register dividend, |
+ int32_t divisor) { |
ASSERT(!dividend.is(result)); |
ASSERT(!dividend.is(at)); |
ASSERT(!result.is(at)); |
@@ -5739,9 +5739,9 @@ void MacroAssembler::FlooringDiv(Register result, |
if (divisor < 0 && ms.multiplier() > 0) { |
Subu(result, result, Operand(dividend)); |
} |
- if (ms.shift() > 0) { |
- sra(result, result, ms.shift()); |
- } |
+ if (ms.shift() > 0) sra(result, result, ms.shift()); |
+ srl(at, dividend, 31); |
+ Addu(result, result, Operand(at)); |
} |