| 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 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace compiler { | 9 namespace compiler { |
| 10 | 10 |
| (...skipping 2239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2250 m.Return(n); | 2250 m.Return(n); |
| 2251 Stream s = m.Build(); | 2251 Stream s = m.Build(); |
| 2252 ASSERT_EQ(1U, s.size()); | 2252 ASSERT_EQ(1U, s.size()); |
| 2253 EXPECT_EQ(kArm64Clz32, s[0]->arch_opcode()); | 2253 EXPECT_EQ(kArm64Clz32, s[0]->arch_opcode()); |
| 2254 ASSERT_EQ(1U, s[0]->InputCount()); | 2254 ASSERT_EQ(1U, s[0]->InputCount()); |
| 2255 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | 2255 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 2256 ASSERT_EQ(1U, s[0]->OutputCount()); | 2256 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 2257 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | 2257 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 2258 } | 2258 } |
| 2259 | 2259 |
| 2260 |
| 2261 TEST_F(InstructionSelectorTest, Float64SubWithMinusZero) { |
| 2262 StreamBuilder m(this, kMachFloat64, kMachFloat64); |
| 2263 Node* const p0 = m.Parameter(0); |
| 2264 Node* const n = m.Float64Sub(m.Float64Constant(-0.0), p0); |
| 2265 m.Return(n); |
| 2266 Stream s = m.Build(); |
| 2267 ASSERT_EQ(1U, s.size()); |
| 2268 EXPECT_EQ(kArm64Float64Neg, s[0]->arch_opcode()); |
| 2269 ASSERT_EQ(1U, s[0]->InputCount()); |
| 2270 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); |
| 2271 ASSERT_EQ(1U, s[0]->OutputCount()); |
| 2272 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); |
| 2273 } |
| 2274 |
| 2260 } // namespace compiler | 2275 } // namespace compiler |
| 2261 } // namespace internal | 2276 } // namespace internal |
| 2262 } // namespace v8 | 2277 } // namespace v8 |
| OLD | NEW |