Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: test/unittests/compiler/mips/instruction-selector-mips-unittest.cc

Issue 1510493002: MIPS: [turbofan] Combine ChangeFloat64ToInt32 with Float64Round ops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
// ----------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698