| 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 "src/compiler/instruction-selector-unittest.h" | 5 #include "src/compiler/instruction-selector-unittest.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace compiler { | 9 namespace compiler { |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 Stream s = m.Build(); | 68 Stream s = m.Build(); |
| 69 ASSERT_EQ(1U, s.size()); | 69 ASSERT_EQ(1U, s.size()); |
| 70 EXPECT_EQ(kIA32Sub, s[0]->arch_opcode()); | 70 EXPECT_EQ(kIA32Sub, s[0]->arch_opcode()); |
| 71 ASSERT_EQ(2U, s[0]->InputCount()); | 71 ASSERT_EQ(2U, s[0]->InputCount()); |
| 72 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1))); | 72 EXPECT_EQ(imm, s.ToInt32(s[0]->InputAt(1))); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 | 76 |
| 77 // ----------------------------------------------------------------------------- | 77 // ----------------------------------------------------------------------------- |
| 78 // Conversions. |
| 79 |
| 80 TEST_F(InstructionSelectorTest, ChangeUint32ToFloat64WithParameter) { |
| 81 StreamBuilder m(this, kMachFloat64, kMachUint32); |
| 82 m.Return(m.ChangeUint32ToFloat64(m.Parameter(0))); |
| 83 Stream s = m.Build(); |
| 84 ASSERT_EQ(1U, s.size()); |
| 85 EXPECT_EQ(kSSEUint32ToFloat64, s[0]->arch_opcode()); |
| 86 } |
| 87 |
| 88 |
| 89 // ----------------------------------------------------------------------------- |
| 78 // Loads and stores | 90 // Loads and stores |
| 79 | 91 |
| 80 namespace { | 92 namespace { |
| 81 | 93 |
| 82 struct MemoryAccess { | 94 struct MemoryAccess { |
| 83 MachineType type; | 95 MachineType type; |
| 84 ArchOpcode load_opcode; | 96 ArchOpcode load_opcode; |
| 85 ArchOpcode store_opcode; | 97 ArchOpcode store_opcode; |
| 86 }; | 98 }; |
| 87 | 99 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 } | 214 } |
| 203 | 215 |
| 204 | 216 |
| 205 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, | 217 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, |
| 206 InstructionSelectorMemoryAccessTest, | 218 InstructionSelectorMemoryAccessTest, |
| 207 ::testing::ValuesIn(kMemoryAccesses)); | 219 ::testing::ValuesIn(kMemoryAccesses)); |
| 208 | 220 |
| 209 } // namespace compiler | 221 } // namespace compiler |
| 210 } // namespace internal | 222 } // namespace internal |
| 211 } // namespace v8 | 223 } // namespace v8 |
| OLD | NEW |