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

Unified Diff: test/unittests/compiler/mips64/instruction-selector-mips64-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
« no previous file with comments | « test/unittests/compiler/mips/instruction-selector-mips-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
diff --git a/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc b/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
index 8c0c3b18beed3baa9dc54d2efab3266da63cc471..6cf7171aad9f1b3072aa2e2a2cdb3bad473bee0c 100644
--- a/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
+++ b/test/unittests/compiler/mips64/instruction-selector-mips64-unittest.cc
@@ -228,6 +228,20 @@ const Conversion kConversionInstructions[] = {
kMips64TruncUwD, kMachFloat64},
kMachInt32}};
+const Conversion kFloat64RoundInstructions[] = {
+ {{&RawMachineAssembler::Float64RoundUp, "Float64RoundUp", kMips64CeilWD,
+ kMachFloat64},
+ kMachInt32},
+ {{&RawMachineAssembler::Float64RoundDown, "Float64RoundDown",
+ kMips64FloorWD, kMachFloat64},
+ kMachInt32},
+ {{&RawMachineAssembler::Float64RoundTiesEven, "Float64RoundTiesEven",
+ kMips64RoundWD, kMachFloat64},
+ kMachInt32},
+ {{&RawMachineAssembler::Float64RoundTruncate, "Float64RoundTruncate",
+ kMips64TruncWD, kMachFloat64},
+ kMachInt32}};
+
} // namespace
@@ -774,6 +788,28 @@ TEST_F(InstructionSelectorTest, ChangesFromToSmi) {
}
+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));
+
+
TEST_F(InstructionSelectorTest, CombineShiftsWithMul) {
{
StreamBuilder m(this, kMachInt32, kMachInt32);
« no previous file with comments | « test/unittests/compiler/mips/instruction-selector-mips-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698