Commit ee563d78 authored by yangguo@chromium.org's avatar yangguo@chromium.org

MIPS: Fix ARM code for DoModI.

Port r13247 (4dda8131)

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/11782009
Patch from Akos Palfi <palfia@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13316 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 74026ea4
...@@ -976,6 +976,14 @@ void LCodeGen::DoModI(LModI* instr) { ...@@ -976,6 +976,14 @@ void LCodeGen::DoModI(LModI* instr) {
DeoptimizeIf(eq, instr->environment(), right, Operand(zero_reg)); DeoptimizeIf(eq, instr->environment(), right, Operand(zero_reg));
} }
// Check for (kMinInt % -1).
if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
Label left_not_min_int;
__ Branch(&left_not_min_int, ne, left, Operand(kMinInt));
DeoptimizeIf(eq, instr->environment(), right, Operand(-1));
__ bind(&left_not_min_int);
}
__ Branch(USE_DELAY_SLOT, &done, ge, left, Operand(zero_reg)); __ Branch(USE_DELAY_SLOT, &done, ge, left, Operand(zero_reg));
__ mfhi(result); __ mfhi(result);
...@@ -1009,7 +1017,7 @@ void LCodeGen::DoDivI(LDivI* instr) { ...@@ -1009,7 +1017,7 @@ void LCodeGen::DoDivI(LDivI* instr) {
__ bind(&left_not_zero); __ bind(&left_not_zero);
} }
// Check for (-kMinInt / -1). // Check for (kMinInt / -1).
if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
Label left_not_min_int; Label left_not_min_int;
__ Branch(&left_not_min_int, ne, left, Operand(kMinInt)); __ Branch(&left_not_min_int, ne, left, Operand(kMinInt));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment