Index: src/compiler/mips64/instruction-selector-mips64.cc |
diff --git a/src/compiler/mips64/instruction-selector-mips64.cc b/src/compiler/mips64/instruction-selector-mips64.cc |
index 6a8d7420e0c982d9ba90f6f3d76e425479d5a1a8..e75283093801ee169a3cb0e07000cb24761e4792 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -581,6 +581,20 @@ void InstructionSelector::VisitFloat64Add(Node* node) { |
void InstructionSelector::VisitFloat64Sub(Node* node) { |
+ Mips64OperandGenerator g(this); |
+ Float64BinopMatcher m(node); |
+ if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && |
+ CanCover(m.node(), m.right().node())) { |
+ if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && |
+ CanCover(m.right().node(), m.right().InputAt(0))) { |
+ Float64BinopMatcher mright0(m.right().InputAt(0)); |
+ if (mright0.left().IsMinusZero()) { |
+ Emit(kMips64Float64RoundUp, g.DefineAsRegister(node), |
+ g.UseRegister(mright0.right().node())); |
+ return; |
+ } |
+ } |
+ } |
VisitRRR(this, kMips64SubD, node); |
} |
@@ -609,13 +623,8 @@ void InstructionSelector::VisitFloat64Sqrt(Node* node) { |
} |
-void InstructionSelector::VisitFloat64Floor(Node* node) { |
- VisitRR(this, kMips64Float64Floor, node); |
-} |
- |
- |
-void InstructionSelector::VisitFloat64Ceil(Node* node) { |
- VisitRR(this, kMips64Float64Ceil, node); |
+void InstructionSelector::VisitFloat64RoundDown(Node* node) { |
+ VisitRR(this, kMips64Float64RoundDown, node); |
} |
@@ -1172,8 +1181,7 @@ void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) { |
// static |
MachineOperatorBuilder::Flags |
InstructionSelector::SupportedMachineOperatorFlags() { |
- return MachineOperatorBuilder::kFloat64Floor | |
- MachineOperatorBuilder::kFloat64Ceil | |
+ return MachineOperatorBuilder::kFloat64RoundDown | |
MachineOperatorBuilder::kFloat64RoundTruncate; |
} |