Commit c21dd8e0 authored by dusan.m.milosavljevic's avatar dusan.m.milosavljevic Committed by Commit bot

MIPS: [turbofan] Fixed Div operations by zero on r6.

TEST=cctest/test-run-machops/RunInt32DivP,
     mjsunit/asm/uint32div
BUG=

Review URL: https://codereview.chromium.org/1517243004

Cr-Commit-Position: refs/heads/master@{#32820}
parent 5aa5258e
......@@ -648,7 +648,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kMipsDiv:
__ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
if (IsMipsArchVariant(kMips32r6)) {
__ selnez(i.OutputRegister(), i.InputRegister(1), i.InputRegister(0));
__ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
} else {
__ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
}
......@@ -656,7 +656,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kMipsDivU:
__ Divu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
if (IsMipsArchVariant(kMips32r6)) {
__ selnez(i.OutputRegister(), i.InputRegister(1), i.InputRegister(0));
__ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
} else {
__ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
}
......
......@@ -661,7 +661,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kMips64Div:
__ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
if (kArchVariant == kMips64r6) {
__ selnez(i.OutputRegister(), i.InputRegister(1), i.InputRegister(0));
__ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
} else {
__ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
}
......@@ -669,7 +669,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kMips64DivU:
__ Divu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
if (kArchVariant == kMips64r6) {
__ selnez(i.OutputRegister(), i.InputRegister(1), i.InputRegister(0));
__ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
} else {
__ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
}
......@@ -686,7 +686,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kMips64Ddiv:
__ Ddiv(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
if (kArchVariant == kMips64r6) {
__ selnez(i.OutputRegister(), i.InputRegister(1), i.InputRegister(0));
__ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
} else {
__ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
}
......@@ -694,7 +694,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kMips64DdivU:
__ Ddivu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1));
if (kArchVariant == kMips64r6) {
__ selnez(i.OutputRegister(), i.InputRegister(1), i.InputRegister(0));
__ selnez(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
} else {
__ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1));
}
......
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