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

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

Issue 487723002: [turbofan] Add proper conversion operators for int32<->int64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc
diff --git a/test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc b/test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc
index 2a86924248054f530b32e426c2a8fd0857d9a453..e0de59060ae4aca8ab88a8cd841074dd74f61883 100644
--- a/test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc
+++ b/test/compiler-unittests/arm64/instruction-selector-arm64-unittest.cc
@@ -6,8 +6,6 @@
#include "test/compiler-unittests/instruction-selector-unittest.h"
-#include "test/cctest/compiler/instruction-selector-tester.h"
-
namespace v8 {
namespace internal {
namespace compiler {
@@ -128,6 +126,37 @@ TEST_F(InstructionSelectorTest, MulDivWithParameter) {
}
}
+
+// -----------------------------------------------------------------------------
+// Conversions.
+
+
+TEST_F(InstructionSelectorTest, ChangeInt32ToInt64WithParameter) {
+ StreamBuilder m(this, kMachInt64, kMachInt32);
+ m.Return(m.ChangeInt32ToInt64(m.Parameter(0)));
+ Stream s = m.Build();
+ ASSERT_EQ(1U, s.size());
+ EXPECT_EQ(kArm64Sxtw, s[0]->arch_opcode());
+}
+
+
+TEST_F(InstructionSelectorTest, ChangeUint32ToUint64WithParameter) {
+ StreamBuilder m(this, kMachUint64, kMachUint32);
+ m.Return(m.ChangeUint32ToUint64(m.Parameter(0)));
+ Stream s = m.Build();
+ ASSERT_EQ(1U, s.size());
+ EXPECT_EQ(kArm64Mov32, s[0]->arch_opcode());
+}
+
+
+TEST_F(InstructionSelectorTest, TruncateInt64ToInt32WithParameter) {
+ StreamBuilder m(this, kMachInt32, kMachInt64);
+ m.Return(m.TruncateInt64ToInt32(m.Parameter(0)));
+ Stream s = m.Build();
+ ASSERT_EQ(1U, s.size());
+ EXPECT_EQ(kArm64Mov32, s[0]->arch_opcode());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698