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

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

Issue 484103002: [turbofan] Add TruncateFloat64ToInt32 machine operator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Disable test-run-machops/RunTruncateFloat64ToInt32P on arm64. Created 6 years, 4 months 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/compiler-unittests/graph-unittest.cc ('k') | test/compiler-unittests/machine-operator-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/compiler-unittests/instruction-selector-unittest.cc
diff --git a/test/compiler-unittests/instruction-selector-unittest.cc b/test/compiler-unittests/instruction-selector-unittest.cc
index 91ae7cdd320667c7bf068e4f98c625c9c615ad55..d6fef2e8070d02d43882a42ac10f060019fe9d10 100644
--- a/test/compiler-unittests/instruction-selector-unittest.cc
+++ b/test/compiler-unittests/instruction-selector-unittest.cc
@@ -71,6 +71,10 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
}
+// -----------------------------------------------------------------------------
+// Return.
+
+
TARGET_TEST_F(InstructionSelectorTest, ReturnParameter) {
StreamBuilder m(this, kMachInt32, kMachInt32);
m.Return(m.Parameter(0));
@@ -96,6 +100,23 @@ TARGET_TEST_F(InstructionSelectorTest, ReturnZero) {
EXPECT_EQ(1U, s[1]->InputCount());
}
+
+// -----------------------------------------------------------------------------
+// Conversions.
+
+
+TARGET_TEST_F(InstructionSelectorTest, TruncateFloat64ToInt32WithParameter) {
+ StreamBuilder m(this, kMachInt32, kMachFloat64);
+ m.Return(m.TruncateFloat64ToInt32(m.Parameter(0)));
+ Stream s = m.Build(kAllInstructions);
+ ASSERT_EQ(3U, s.size());
+ EXPECT_EQ(kArchNop, s[0]->arch_opcode());
+ EXPECT_EQ(kArchTruncateDoubleToI, s[1]->arch_opcode());
+ EXPECT_EQ(1U, s[1]->InputCount());
+ EXPECT_EQ(1U, s[1]->OutputCount());
+ EXPECT_EQ(kArchRet, s[2]->arch_opcode());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « test/compiler-unittests/graph-unittest.cc ('k') | test/compiler-unittests/machine-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698