| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "test/unittests/compiler/instruction-selector-unittest.h" | 5 #include "test/unittests/compiler/instruction-selector-unittest.h" |
| 6 | 6 |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 EXPECT_EQ(kSSEFloat64Sub, s[2]->arch_opcode()); | 1023 EXPECT_EQ(kSSEFloat64Sub, s[2]->arch_opcode()); |
| 1024 EXPECT_EQ(kSSEFloat64Div, s[3]->arch_opcode()); | 1024 EXPECT_EQ(kSSEFloat64Div, s[3]->arch_opcode()); |
| 1025 } | 1025 } |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 | 1028 |
| 1029 // ----------------------------------------------------------------------------- | 1029 // ----------------------------------------------------------------------------- |
| 1030 // Miscellaneous. | 1030 // Miscellaneous. |
| 1031 | 1031 |
| 1032 | 1032 |
| 1033 TEST_F(InstructionSelectorTest, Uint64LessThanWithLoadAndLoadStackPointer) { |
| 1034 StreamBuilder m(this, kMachBool); |
| 1035 Node* const sl = m.Load( |
| 1036 kMachPtr, |
| 1037 m.ExternalConstant(ExternalReference::address_of_stack_limit(isolate()))); |
| 1038 Node* const sp = m.LoadStackPointer(); |
| 1039 Node* const n = m.Uint64LessThan(sl, sp); |
| 1040 m.Return(n); |
| 1041 Stream s = m.Build(); |
| 1042 ASSERT_EQ(1U, s.size()); |
| 1043 EXPECT_EQ(kX64StackCheck, s[0]->arch_opcode()); |
| 1044 ASSERT_EQ(0U, s[0]->InputCount()); |
| 1045 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 1046 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 1047 EXPECT_EQ(kFlags_set, s[0]->flags_mode()); |
| 1048 EXPECT_EQ(kUnsignedGreaterThan, s[0]->flags_condition()); |
| 1049 } |
| 1050 |
| 1051 |
| 1033 TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) { | 1052 TEST_F(InstructionSelectorTest, Word64ShlWithChangeInt32ToInt64) { |
| 1034 TRACED_FORRANGE(int64_t, x, 32, 63) { | 1053 TRACED_FORRANGE(int64_t, x, 32, 63) { |
| 1035 StreamBuilder m(this, kMachInt64, kMachInt32); | 1054 StreamBuilder m(this, kMachInt64, kMachInt32); |
| 1036 Node* const p0 = m.Parameter(0); | 1055 Node* const p0 = m.Parameter(0); |
| 1037 Node* const n = m.Word64Shl(m.ChangeInt32ToInt64(p0), m.Int64Constant(x)); | 1056 Node* const n = m.Word64Shl(m.ChangeInt32ToInt64(p0), m.Int64Constant(x)); |
| 1038 m.Return(n); | 1057 m.Return(n); |
| 1039 Stream s = m.Build(); | 1058 Stream s = m.Build(); |
| 1040 ASSERT_EQ(1U, s.size()); | 1059 ASSERT_EQ(1U, s.size()); |
| 1041 EXPECT_EQ(kX64Shl, s[0]->arch_opcode()); | 1060 EXPECT_EQ(kX64Shl, s[0]->arch_opcode()); |
| 1042 ASSERT_EQ(2U, s[0]->InputCount()); | 1061 ASSERT_EQ(2U, s[0]->InputCount()); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 ASSERT_EQ(1U, s[0]->InputCount()); | 1142 ASSERT_EQ(1U, s[0]->InputCount()); |
| 1124 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 1143 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 1125 ASSERT_EQ(1U, s[0]->OutputCount()); | 1144 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 1126 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 1145 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 1127 } | 1146 } |
| 1128 } | 1147 } |
| 1129 | 1148 |
| 1130 } // namespace compiler | 1149 } // namespace compiler |
| 1131 } // namespace internal | 1150 } // namespace internal |
| 1132 } // namespace v8 | 1151 } // namespace v8 |
| OLD | NEW |