Index: src/compiler/mips/code-generator-mips.cc |
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc |
index 239de312da27ecdac38bed6b8a2a95efb98357a6..ea9fbbaa78e3df3c563222967784ff0083abfcb5 100644 |
--- a/src/compiler/mips/code-generator-mips.cc |
+++ b/src/compiler/mips/code-generator-mips.cc |
@@ -648,9 +648,19 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kMipsDiv: |
__ Div(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ __ seleqz(i.OutputRegister(), i.InputRegister(0), i.InputRegister(0)); |
+ } else { |
+ __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1)); |
+ } |
break; |
case kMipsDivU: |
__ Divu(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ __ seleqz(i.OutputRegister(), i.InputRegister(0), i.InputRegister(0)); |
+ } else { |
+ __ Movz(i.OutputRegister(), i.InputRegister(1), i.InputRegister(1)); |
+ } |
break; |
case kMipsMod: |
__ Mod(i.OutputRegister(), i.InputRegister(0), i.InputOperand(1)); |