Index: test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
diff --git a/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc b/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
index ec0474e40885cc33658152e552e5c85b8e7091c9..d88cff24e87eb795a60f73101cab01d3e6021798 100644 |
--- a/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
+++ b/test/unittests/compiler/mips/instruction-selector-mips-unittest.cc |
@@ -218,6 +218,20 @@ const Conversion kConversionInstructions[] = { |
kMipsTruncUwD, kMachFloat64}, |
kMachInt32}}; |
+const Conversion kFloat64RoundInstructions[] = { |
+ {{&RawMachineAssembler::Float64RoundUp, "Float64RoundUp", kMipsCeilWD, |
+ kMachFloat64}, |
+ kMachInt32}, |
+ {{&RawMachineAssembler::Float64RoundDown, "Float64RoundDown", kMipsFloorWD, |
+ kMachFloat64}, |
+ kMachInt32}, |
+ {{&RawMachineAssembler::Float64RoundTiesEven, "Float64RoundTiesEven", |
+ kMipsRoundWD, kMachFloat64}, |
+ kMachInt32}, |
+ {{&RawMachineAssembler::Float64RoundTruncate, "Float64RoundTruncate", |
+ kMipsTruncWD, kMachFloat64}, |
+ kMachInt32}}; |
+ |
} // namespace |
@@ -629,6 +643,28 @@ INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, |
::testing::ValuesIn(kConversionInstructions)); |
+typedef InstructionSelectorTestWithParam<Conversion> |
+ CombineChangeFloat64ToInt32WithRoundFloat64; |
+ |
+TEST_P(CombineChangeFloat64ToInt32WithRoundFloat64, Parameter) { |
+ { |
+ const Conversion conv = GetParam(); |
+ StreamBuilder m(this, conv.mi.machine_type, conv.src_machine_type); |
+ m.Return(m.ChangeFloat64ToInt32((m.*conv.mi.constructor)(m.Parameter(0)))); |
+ Stream s = m.Build(); |
+ ASSERT_EQ(1U, s.size()); |
+ EXPECT_EQ(conv.mi.arch_opcode, s[0]->arch_opcode()); |
+ EXPECT_EQ(kMode_None, s[0]->addressing_mode()); |
+ ASSERT_EQ(1U, s[0]->InputCount()); |
+ EXPECT_EQ(1U, s[0]->OutputCount()); |
+ } |
+} |
+ |
+INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, |
+ CombineChangeFloat64ToInt32WithRoundFloat64, |
+ ::testing::ValuesIn(kFloat64RoundInstructions)); |
+ |
+ |
// ---------------------------------------------------------------------------- |
// Loads and stores. |
// ---------------------------------------------------------------------------- |