summaryrefslogtreecommitdiff
path: root/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc')
-rw-r--r--deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc b/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
index 1f374c0f85..a83deafe7d 100644
--- a/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
+++ b/deps/v8/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc
@@ -1030,6 +1030,25 @@ TEST_F(InstructionSelectorTest, Float64BinopArithmetic) {
// Miscellaneous.
+TEST_F(InstructionSelectorTest, Uint64LessThanWithLoadAndLoadStackPointer) {
+ StreamBuilder m(this, kMachBool);
+ Node* const sl = m.Load(
+ kMachPtr,
+ m.ExternalConstant(ExternalReference::address_of_stack_limit(isolate())));
+ Node* const sp = m.LoadStackPointer();
+ Node* const n = m.Uint64LessThan(sl, sp);
+ m.Return(n);
+ Stream s = m.Build();
+ ASSERT_EQ(1U, s.size());
+ EXPECT_EQ(kX64StackCheck, s[0]->arch_opcode());
+ ASSERT_EQ(0U, s[0]->InputCount());
+ ASSERT_EQ(1U, s[0]->OutputCount());
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
+ EXPECT_EQ(kFlags_set, s[0]->flags_mode());
+ EXPECT_EQ(kUnsignedGreaterThan, s[0]->flags_condition());
+}
+
+
TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) {
TRACED_FORRANGE(int64_t, x, 32, 63) {
StreamBuilder m(this, kMachInt64, kMachInt32);
@@ -1127,6 +1146,21 @@ TEST_F(InstructionSelectorTest, Word32AndWith0xffff) {
}
}
+
+TEST_F(InstructionSelectorTest, Word32Clz) {
+ StreamBuilder m(this, kMachUint32, kMachUint32);
+ Node* const p0 = m.Parameter(0);
+ Node* const n = m.Word32Clz(p0);
+ m.Return(n);
+ Stream s = m.Build();
+ ASSERT_EQ(1U, s.size());
+ EXPECT_EQ(kX64Lzcnt32, s[0]->arch_opcode());
+ ASSERT_EQ(1U, s[0]->InputCount());
+ EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
+ ASSERT_EQ(1U, s[0]->OutputCount());
+ EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8