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 8d1631dfa2825e94db192f85d3418c3fcc2641cb..0fe5c5a88f1c7084e81e585e0b66d2900ec4073f 100644 |
--- a/src/compiler/mips/instruction-selector-mips.cc |
+++ b/src/compiler/mips/instruction-selector-mips.cc |
@@ -487,6 +487,33 @@ void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { |
void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { |
+ MipsOperandGenerator g(this); |
+ Node* value = node->InputAt(0); |
+ // Match ChangeFloat64ToInt32(Float64Round##OP) to corresponding instruction |
+ // which does rounding and conversion to integer format. |
+ if (CanCover(node, value)) { |
+ switch (value->opcode()) { |
+ case IrOpcode::kFloat64RoundDown: |
+ Emit(kMipsFloorWD, g.DefineAsRegister(node), |
+ g.UseRegister(value->InputAt(0))); |
+ return; |
+ case IrOpcode::kFloat64RoundUp: |
+ Emit(kMipsCeilWD, g.DefineAsRegister(node), |
+ g.UseRegister(value->InputAt(0))); |
+ return; |
+ case IrOpcode::kFloat64RoundTiesEven: |
+ Emit(kMipsRoundWD, g.DefineAsRegister(node), |
+ g.UseRegister(value->InputAt(0))); |
+ return; |
+ case IrOpcode::kFloat64RoundTruncate: |
+ Emit(kMipsTruncWD, g.DefineAsRegister(node), |
+ g.UseRegister(value->InputAt(0))); |
+ return; |
+ default: |
+ VisitRR(this, kMipsTruncWD, node); |
+ return; |
+ } |
+ } |
VisitRR(this, kMipsTruncWD, node); |
} |