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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "test/unittests/compiler/instruction-selector-unittest.h" | 7 #include "test/unittests/compiler/instruction-selector-unittest.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1475 | 1475 |
1476 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, | 1476 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, |
1477 InstructionSelectorComparisonTest, | 1477 InstructionSelectorComparisonTest, |
1478 ::testing::ValuesIn(kComparisons)); | 1478 ::testing::ValuesIn(kComparisons)); |
1479 | 1479 |
1480 | 1480 |
1481 // ----------------------------------------------------------------------------- | 1481 // ----------------------------------------------------------------------------- |
1482 // Miscellaneous. | 1482 // Miscellaneous. |
1483 | 1483 |
1484 | 1484 |
1485 TEST_F(InstructionSelectorTest, Float64SubWithMinusZero) { | |
1486 StreamBuilder m(this, kMachFloat64, kMachFloat64); | |
1487 Node* const p0 = m.Parameter(0); | |
1488 Node* const n = m.Float64Sub(m.Float64Constant(-0.0), p0); | |
1489 m.Return(n); | |
1490 Stream s = m.Build(); | |
1491 ASSERT_EQ(1U, s.size()); | |
1492 EXPECT_EQ(kArmVnegF64, s[0]->arch_opcode()); | |
1493 ASSERT_EQ(1U, s[0]->InputCount()); | |
1494 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); | |
1495 ASSERT_EQ(1U, s[0]->OutputCount()); | |
1496 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); | |
1497 } | |
1498 | |
1499 | |
1500 TEST_F(InstructionSelectorTest, Int32AddWithInt32Mul) { | 1485 TEST_F(InstructionSelectorTest, Int32AddWithInt32Mul) { |
1501 { | 1486 { |
1502 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32); | 1487 StreamBuilder m(this, kMachInt32, kMachInt32, kMachInt32, kMachInt32); |
1503 Node* const p0 = m.Parameter(0); | 1488 Node* const p0 = m.Parameter(0); |
1504 Node* const p1 = m.Parameter(1); | 1489 Node* const p1 = m.Parameter(1); |
1505 Node* const p2 = m.Parameter(2); | 1490 Node* const p2 = m.Parameter(2); |
1506 Node* const n = m.Int32Add(p0, m.Int32Mul(p1, p2)); | 1491 Node* const n = m.Int32Add(p0, m.Int32Mul(p1, p2)); |
1507 m.Return(n); | 1492 m.Return(n); |
1508 Stream s = m.Build(); | 1493 Stream s = m.Build(); |
1509 ASSERT_EQ(1U, s.size()); | 1494 ASSERT_EQ(1U, s.size()); |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2343 ASSERT_EQ(3U, s[0]->InputCount()); | 2328 ASSERT_EQ(3U, s[0]->InputCount()); |
2344 EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1))); | 2329 EXPECT_EQ(lsb, s.ToInt32(s[0]->InputAt(1))); |
2345 EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2))); | 2330 EXPECT_EQ(width, s.ToInt32(s[0]->InputAt(2))); |
2346 } | 2331 } |
2347 } | 2332 } |
2348 } | 2333 } |
2349 | 2334 |
2350 } // namespace compiler | 2335 } // namespace compiler |
2351 } // namespace internal | 2336 } // namespace internal |
2352 } // namespace v8 | 2337 } // namespace v8 |
OLD | NEW |