Index: src/compiler/mips/instruction-selector-mips.cc |
diff --git a/src/compiler/mips/instruction-selector-mips.cc b/src/compiler/mips/instruction-selector-mips.cc |
index 602b9f9b1ca6a1d5f74a78ff98321447f3c9cdec..80c356509fee9c00af9c7d17a2bbb5a8fa77541e 100644 |
--- a/src/compiler/mips/instruction-selector-mips.cc |
+++ b/src/compiler/mips/instruction-selector-mips.cc |
@@ -481,16 +481,64 @@ void InstructionSelector::VisitFloat64Mod(Node* node) { |
} |
-void InstructionSelector::VisitFloat32Max(Node* node) { UNREACHABLE(); } |
+void InstructionSelector::VisitFloat32Max(Node* node) { |
+ MipsOperandGenerator g(this); |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ Emit(kMipsFloat32Max, g.DefineAsRegister(node), |
+ g.UseUniqueRegister(node->InputAt(0)), |
+ g.UseUniqueRegister(node->InputAt(1))); |
+ |
+ } else { |
+ // Reverse operands, and use same reg. for result and right operand. |
+ Emit(kMipsFloat32Max, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
+ } |
+} |
+ |
+ |
+void InstructionSelector::VisitFloat64Max(Node* node) { |
+ MipsOperandGenerator g(this); |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ Emit(kMipsFloat64Max, g.DefineAsRegister(node), |
+ g.UseUniqueRegister(node->InputAt(0)), |
+ g.UseUniqueRegister(node->InputAt(1))); |
+ |
+ } else { |
+ // Reverse operands, and use same reg. for result and right operand. |
+ Emit(kMipsFloat64Max, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
+ } |
+} |
-void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); } |
+void InstructionSelector::VisitFloat32Min(Node* node) { |
+ MipsOperandGenerator g(this); |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ Emit(kMipsFloat32Min, g.DefineAsRegister(node), |
+ g.UseUniqueRegister(node->InputAt(0)), |
+ g.UseUniqueRegister(node->InputAt(1))); |
+ } else { |
+ // Reverse operands, and use same reg. for result and right operand. |
+ Emit(kMipsFloat32Min, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
+ } |
+} |
-void InstructionSelector::VisitFloat32Min(Node* node) { UNREACHABLE(); } |
+void InstructionSelector::VisitFloat64Min(Node* node) { |
+ MipsOperandGenerator g(this); |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ Emit(kMipsFloat64Min, g.DefineAsRegister(node), |
+ g.UseUniqueRegister(node->InputAt(0)), |
+ g.UseUniqueRegister(node->InputAt(1))); |
-void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); } |
+ } else { |
+ // Reverse operands, and use same reg. for result and right operand. |
+ Emit(kMipsFloat64Min, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
+ } |
+} |
void InstructionSelector::VisitFloat32Abs(Node* node) { |
@@ -1034,7 +1082,10 @@ InstructionSelector::SupportedMachineOperatorFlags() { |
flags |= MachineOperatorBuilder::kFloat64RoundDown | |
MachineOperatorBuilder::kFloat64RoundTruncate; |
} |
- return flags; |
+ return flags | MachineOperatorBuilder::kFloat64Min | |
+ MachineOperatorBuilder::kFloat64Max | |
+ MachineOperatorBuilder::kFloat32Min | |
+ MachineOperatorBuilder::kFloat32Max; |
} |
} // namespace compiler |