Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: runtime/vm/assembler_arm_test.cc

Issue 120723003: Refactors CPU feature detection. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h"
9 #include "vm/os.h" 10 #include "vm/os.h"
10 #include "vm/unit_test.h" 11 #include "vm/unit_test.h"
11 #include "vm/virtual_memory.h" 12 #include "vm/virtual_memory.h"
12 13
13 namespace dart { 14 namespace dart {
14 15
15 #define __ assembler-> 16 #define __ assembler->
16 17
17 18
18 ASSEMBLER_TEST_GENERATE(Simple, assembler) { 19 ASSEMBLER_TEST_GENERATE(Simple, assembler) {
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 1451
1451 1452
1452 ASSEMBLER_TEST_RUN(VstmsVldms_off, test) { 1453 ASSEMBLER_TEST_RUN(VstmsVldms_off, test) {
1453 EXPECT(test != NULL); 1454 EXPECT(test != NULL);
1454 typedef int (*Tst)(); 1455 typedef int (*Tst)();
1455 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1456 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1456 } 1457 }
1457 1458
1458 1459
1459 ASSEMBLER_TEST_GENERATE(Udiv, assembler) { 1460 ASSEMBLER_TEST_GENERATE(Udiv, assembler) {
1460 if (CPUFeatures::integer_division_supported()) { 1461 if (TargetCPUFeatures::integer_division_supported()) {
1461 __ mov(R0, ShifterOperand(27)); 1462 __ mov(R0, ShifterOperand(27));
1462 __ mov(R1, ShifterOperand(9)); 1463 __ mov(R1, ShifterOperand(9));
1463 __ udiv(R2, R0, R1); 1464 __ udiv(R2, R0, R1);
1464 __ mov(R0, ShifterOperand(R2)); 1465 __ mov(R0, ShifterOperand(R2));
1465 } else { 1466 } else {
1466 __ mov(R0, ShifterOperand(3)); 1467 __ mov(R0, ShifterOperand(3));
1467 } 1468 }
1468 __ bx(LR); 1469 __ bx(LR);
1469 } 1470 }
1470 1471
1471 1472
1472 ASSEMBLER_TEST_RUN(Udiv, test) { 1473 ASSEMBLER_TEST_RUN(Udiv, test) {
1473 EXPECT(test != NULL); 1474 EXPECT(test != NULL);
1474 typedef int (*Tst)(); 1475 typedef int (*Tst)();
1475 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1476 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1476 } 1477 }
1477 1478
1478 1479
1479 ASSEMBLER_TEST_GENERATE(Sdiv, assembler) { 1480 ASSEMBLER_TEST_GENERATE(Sdiv, assembler) {
1480 if (CPUFeatures::integer_division_supported()) { 1481 if (TargetCPUFeatures::integer_division_supported()) {
1481 __ mov(R0, ShifterOperand(27)); 1482 __ mov(R0, ShifterOperand(27));
1482 __ LoadImmediate(R1, -9); 1483 __ LoadImmediate(R1, -9);
1483 __ sdiv(R2, R0, R1); 1484 __ sdiv(R2, R0, R1);
1484 __ mov(R0, ShifterOperand(R2)); 1485 __ mov(R0, ShifterOperand(R2));
1485 } else { 1486 } else {
1486 __ LoadImmediate(R0, -3); 1487 __ LoadImmediate(R0, -3);
1487 } 1488 }
1488 __ bx(LR); 1489 __ bx(LR);
1489 } 1490 }
1490 1491
1491 1492
1492 ASSEMBLER_TEST_RUN(Sdiv, test) { 1493 ASSEMBLER_TEST_RUN(Sdiv, test) {
1493 EXPECT(test != NULL); 1494 EXPECT(test != NULL);
1494 typedef int (*Tst)(); 1495 typedef int (*Tst)();
1495 EXPECT_EQ(-3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1496 EXPECT_EQ(-3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1496 } 1497 }
1497 1498
1498 1499
1499 ASSEMBLER_TEST_GENERATE(Udiv_zero, assembler) { 1500 ASSEMBLER_TEST_GENERATE(Udiv_zero, assembler) {
1500 if (CPUFeatures::integer_division_supported()) { 1501 if (TargetCPUFeatures::integer_division_supported()) {
1501 __ mov(R0, ShifterOperand(27)); 1502 __ mov(R0, ShifterOperand(27));
1502 __ mov(R1, ShifterOperand(0)); 1503 __ mov(R1, ShifterOperand(0));
1503 __ udiv(R2, R0, R1); 1504 __ udiv(R2, R0, R1);
1504 __ mov(R0, ShifterOperand(R2)); 1505 __ mov(R0, ShifterOperand(R2));
1505 } else { 1506 } else {
1506 __ LoadImmediate(R0, 0); 1507 __ LoadImmediate(R0, 0);
1507 } 1508 }
1508 __ bx(LR); 1509 __ bx(LR);
1509 } 1510 }
1510 1511
1511 1512
1512 ASSEMBLER_TEST_RUN(Udiv_zero, test) { 1513 ASSEMBLER_TEST_RUN(Udiv_zero, test) {
1513 EXPECT(test != NULL); 1514 EXPECT(test != NULL);
1514 typedef int (*Tst)(); 1515 typedef int (*Tst)();
1515 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1516 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1516 } 1517 }
1517 1518
1518 1519
1519 ASSEMBLER_TEST_GENERATE(Sdiv_zero, assembler) { 1520 ASSEMBLER_TEST_GENERATE(Sdiv_zero, assembler) {
1520 if (CPUFeatures::integer_division_supported()) { 1521 if (TargetCPUFeatures::integer_division_supported()) {
1521 __ mov(R0, ShifterOperand(27)); 1522 __ mov(R0, ShifterOperand(27));
1522 __ mov(R1, ShifterOperand(0)); 1523 __ mov(R1, ShifterOperand(0));
1523 __ udiv(R2, R0, R1); 1524 __ udiv(R2, R0, R1);
1524 __ mov(R0, ShifterOperand(R2)); 1525 __ mov(R0, ShifterOperand(R2));
1525 } else { 1526 } else {
1526 __ LoadImmediate(R0, 0); 1527 __ LoadImmediate(R0, 0);
1527 } 1528 }
1528 __ bx(LR); 1529 __ bx(LR);
1529 } 1530 }
1530 1531
1531 1532
1532 ASSEMBLER_TEST_RUN(Sdiv_zero, test) { 1533 ASSEMBLER_TEST_RUN(Sdiv_zero, test) {
1533 EXPECT(test != NULL); 1534 EXPECT(test != NULL);
1534 typedef int (*Tst)(); 1535 typedef int (*Tst)();
1535 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1536 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1536 } 1537 }
1537 1538
1538 1539
1539 ASSEMBLER_TEST_GENERATE(Udiv_corner, assembler) { 1540 ASSEMBLER_TEST_GENERATE(Udiv_corner, assembler) {
1540 if (CPUFeatures::integer_division_supported()) { 1541 if (TargetCPUFeatures::integer_division_supported()) {
1541 __ LoadImmediate(R0, 0x80000000); 1542 __ LoadImmediate(R0, 0x80000000);
1542 __ LoadImmediate(R1, 0xffffffff); 1543 __ LoadImmediate(R1, 0xffffffff);
1543 __ udiv(R2, R0, R1); 1544 __ udiv(R2, R0, R1);
1544 __ mov(R0, ShifterOperand(R2)); 1545 __ mov(R0, ShifterOperand(R2));
1545 } else { 1546 } else {
1546 __ LoadImmediate(R0, 0); 1547 __ LoadImmediate(R0, 0);
1547 } 1548 }
1548 __ bx(LR); 1549 __ bx(LR);
1549 } 1550 }
1550 1551
1551 1552
1552 ASSEMBLER_TEST_RUN(Udiv_corner, test) { 1553 ASSEMBLER_TEST_RUN(Udiv_corner, test) {
1553 EXPECT(test != NULL); 1554 EXPECT(test != NULL);
1554 typedef int (*Tst)(); 1555 typedef int (*Tst)();
1555 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1556 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1556 } 1557 }
1557 1558
1558 1559
1559 ASSEMBLER_TEST_GENERATE(Sdiv_corner, assembler) { 1560 ASSEMBLER_TEST_GENERATE(Sdiv_corner, assembler) {
1560 if (CPUFeatures::integer_division_supported()) { 1561 if (TargetCPUFeatures::integer_division_supported()) {
1561 __ LoadImmediate(R0, 0x80000000); 1562 __ LoadImmediate(R0, 0x80000000);
1562 __ LoadImmediate(R1, 0xffffffff); 1563 __ LoadImmediate(R1, 0xffffffff);
1563 __ sdiv(R2, R0, R1); 1564 __ sdiv(R2, R0, R1);
1564 __ mov(R0, ShifterOperand(R2)); 1565 __ mov(R0, ShifterOperand(R2));
1565 } else { 1566 } else {
1566 __ LoadImmediate(R0, 0x80000000); 1567 __ LoadImmediate(R0, 0x80000000);
1567 } 1568 }
1568 __ bx(LR); 1569 __ bx(LR);
1569 } 1570 }
1570 1571
1571 1572
1572 ASSEMBLER_TEST_RUN(Sdiv_corner, test) { 1573 ASSEMBLER_TEST_RUN(Sdiv_corner, test) {
1573 EXPECT(test != NULL); 1574 EXPECT(test != NULL);
1574 typedef int (*Tst)(); 1575 typedef int (*Tst)();
1575 EXPECT_EQ(static_cast<int32_t>(0x80000000), 1576 EXPECT_EQ(static_cast<int32_t>(0x80000000),
1576 EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1577 EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1577 } 1578 }
1578 1579
1579 1580
1580 ASSEMBLER_TEST_GENERATE(IntDiv_supported, assembler) { 1581 ASSEMBLER_TEST_GENERATE(IntDiv_supported, assembler) {
1581 #if defined(USING_SIMULATOR) 1582 #if defined(USING_SIMULATOR)
1582 bool orig = CPUFeatures::integer_division_supported(); 1583 bool orig = TargetCPUFeatures::integer_division_supported();
1583 CPUFeatures::set_integer_division_supported(true); 1584 HostCPUFeatures::set_integer_division_supported(true);
1584 __ mov(R0, ShifterOperand(27)); 1585 __ mov(R0, ShifterOperand(27));
1585 __ mov(R1, ShifterOperand(9)); 1586 __ mov(R1, ShifterOperand(9));
1586 __ IntegerDivide(R0, R0, R1, D0, D1); 1587 __ IntegerDivide(R0, R0, R1, D0, D1);
1587 CPUFeatures::set_integer_division_supported(orig); 1588 HostCPUFeatures::set_integer_division_supported(orig);
1588 __ bx(LR); 1589 __ bx(LR);
1589 #else 1590 #else
1590 __ mov(R0, ShifterOperand(27)); 1591 __ mov(R0, ShifterOperand(27));
1591 __ mov(R1, ShifterOperand(9)); 1592 __ mov(R1, ShifterOperand(9));
1592 __ IntegerDivide(R0, R0, R1, D0, D1); 1593 __ IntegerDivide(R0, R0, R1, D0, D1);
1593 __ bx(LR); 1594 __ bx(LR);
1594 #endif 1595 #endif
1595 } 1596 }
1596 1597
1597 1598
1598 ASSEMBLER_TEST_RUN(IntDiv_supported, test) { 1599 ASSEMBLER_TEST_RUN(IntDiv_supported, test) {
1599 EXPECT(test != NULL); 1600 EXPECT(test != NULL);
1600 typedef int (*Tst)(); 1601 typedef int (*Tst)();
1601 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1602 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1602 } 1603 }
1603 1604
1604 1605
1605 ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) { 1606 ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) {
1606 #if defined(USING_SIMULATOR) 1607 #if defined(USING_SIMULATOR)
1607 bool orig = CPUFeatures::integer_division_supported(); 1608 bool orig = TargetCPUFeatures::integer_division_supported();
1608 CPUFeatures::set_integer_division_supported(false); 1609 HostCPUFeatures::set_integer_division_supported(false);
1609 __ mov(R0, ShifterOperand(27)); 1610 __ mov(R0, ShifterOperand(27));
1610 __ mov(R1, ShifterOperand(9)); 1611 __ mov(R1, ShifterOperand(9));
1611 __ IntegerDivide(R0, R0, R1, D0, D1); 1612 __ IntegerDivide(R0, R0, R1, D0, D1);
1612 CPUFeatures::set_integer_division_supported(orig); 1613 HostCPUFeatures::set_integer_division_supported(orig);
1613 __ bx(LR); 1614 __ bx(LR);
1614 #else 1615 #else
1615 __ mov(R0, ShifterOperand(27)); 1616 __ mov(R0, ShifterOperand(27));
1616 __ mov(R1, ShifterOperand(9)); 1617 __ mov(R1, ShifterOperand(9));
1617 __ IntegerDivide(R0, R0, R1, D0, D1); 1618 __ IntegerDivide(R0, R0, R1, D0, D1);
1618 __ bx(LR); 1619 __ bx(LR);
1619 #endif 1620 #endif
1620 } 1621 }
1621 1622
1622 1623
(...skipping 14 matching lines...) Expand all
1637 1638
1638 1639
1639 ASSEMBLER_TEST_RUN(Muls, test) { 1640 ASSEMBLER_TEST_RUN(Muls, test) {
1640 EXPECT(test != NULL); 1641 EXPECT(test != NULL);
1641 typedef int (*Tst)(); 1642 typedef int (*Tst)();
1642 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1643 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1643 } 1644 }
1644 1645
1645 1646
1646 ASSEMBLER_TEST_GENERATE(Vaddqi8, assembler) { 1647 ASSEMBLER_TEST_GENERATE(Vaddqi8, assembler) {
1647 if (CPUFeatures::neon_supported()) { 1648 if (TargetCPUFeatures::neon_supported()) {
1648 __ mov(R0, ShifterOperand(1)); 1649 __ mov(R0, ShifterOperand(1));
1649 __ vmovsr(S0, R0); 1650 __ vmovsr(S0, R0);
1650 __ mov(R0, ShifterOperand(2)); 1651 __ mov(R0, ShifterOperand(2));
1651 __ vmovsr(S1, R0); 1652 __ vmovsr(S1, R0);
1652 __ mov(R0, ShifterOperand(3)); 1653 __ mov(R0, ShifterOperand(3));
1653 __ vmovsr(S2, R0); 1654 __ vmovsr(S2, R0);
1654 __ mov(R0, ShifterOperand(4)); 1655 __ mov(R0, ShifterOperand(4));
1655 __ vmovsr(S3, R0); 1656 __ vmovsr(S3, R0);
1656 __ mov(R0, ShifterOperand(5)); 1657 __ mov(R0, ShifterOperand(5));
1657 __ vmovsr(S4, R0); 1658 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
1681 1682
1682 1683
1683 ASSEMBLER_TEST_RUN(Vaddqi8, test) { 1684 ASSEMBLER_TEST_RUN(Vaddqi8, test) {
1684 EXPECT(test != NULL); 1685 EXPECT(test != NULL);
1685 typedef int (*Tst)(); 1686 typedef int (*Tst)();
1686 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1687 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1687 } 1688 }
1688 1689
1689 1690
1690 ASSEMBLER_TEST_GENERATE(Vaddqi16, assembler) { 1691 ASSEMBLER_TEST_GENERATE(Vaddqi16, assembler) {
1691 if (CPUFeatures::neon_supported()) { 1692 if (TargetCPUFeatures::neon_supported()) {
1692 __ mov(R0, ShifterOperand(1)); 1693 __ mov(R0, ShifterOperand(1));
1693 __ vmovsr(S0, R0); 1694 __ vmovsr(S0, R0);
1694 __ mov(R0, ShifterOperand(2)); 1695 __ mov(R0, ShifterOperand(2));
1695 __ vmovsr(S1, R0); 1696 __ vmovsr(S1, R0);
1696 __ mov(R0, ShifterOperand(3)); 1697 __ mov(R0, ShifterOperand(3));
1697 __ vmovsr(S2, R0); 1698 __ vmovsr(S2, R0);
1698 __ mov(R0, ShifterOperand(4)); 1699 __ mov(R0, ShifterOperand(4));
1699 __ vmovsr(S3, R0); 1700 __ vmovsr(S3, R0);
1700 __ mov(R0, ShifterOperand(5)); 1701 __ mov(R0, ShifterOperand(5));
1701 __ vmovsr(S4, R0); 1702 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
1725 1726
1726 1727
1727 ASSEMBLER_TEST_RUN(Vaddqi16, test) { 1728 ASSEMBLER_TEST_RUN(Vaddqi16, test) {
1728 EXPECT(test != NULL); 1729 EXPECT(test != NULL);
1729 typedef int (*Tst)(); 1730 typedef int (*Tst)();
1730 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1731 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1731 } 1732 }
1732 1733
1733 1734
1734 ASSEMBLER_TEST_GENERATE(Vaddqi32, assembler) { 1735 ASSEMBLER_TEST_GENERATE(Vaddqi32, assembler) {
1735 if (CPUFeatures::neon_supported()) { 1736 if (TargetCPUFeatures::neon_supported()) {
1736 __ mov(R0, ShifterOperand(1)); 1737 __ mov(R0, ShifterOperand(1));
1737 __ vmovsr(S0, R0); 1738 __ vmovsr(S0, R0);
1738 __ mov(R0, ShifterOperand(2)); 1739 __ mov(R0, ShifterOperand(2));
1739 __ vmovsr(S1, R0); 1740 __ vmovsr(S1, R0);
1740 __ mov(R0, ShifterOperand(3)); 1741 __ mov(R0, ShifterOperand(3));
1741 __ vmovsr(S2, R0); 1742 __ vmovsr(S2, R0);
1742 __ mov(R0, ShifterOperand(4)); 1743 __ mov(R0, ShifterOperand(4));
1743 __ vmovsr(S3, R0); 1744 __ vmovsr(S3, R0);
1744 __ mov(R0, ShifterOperand(5)); 1745 __ mov(R0, ShifterOperand(5));
1745 __ vmovsr(S4, R0); 1746 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
1769 1770
1770 1771
1771 ASSEMBLER_TEST_RUN(Vaddqi32, test) { 1772 ASSEMBLER_TEST_RUN(Vaddqi32, test) {
1772 EXPECT(test != NULL); 1773 EXPECT(test != NULL);
1773 typedef int (*Tst)(); 1774 typedef int (*Tst)();
1774 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1775 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1775 } 1776 }
1776 1777
1777 1778
1778 ASSEMBLER_TEST_GENERATE(Vaddqi64, assembler) { 1779 ASSEMBLER_TEST_GENERATE(Vaddqi64, assembler) {
1779 if (CPUFeatures::neon_supported()) { 1780 if (TargetCPUFeatures::neon_supported()) {
1780 __ mov(R0, ShifterOperand(1)); 1781 __ mov(R0, ShifterOperand(1));
1781 __ vmovsr(S0, R0); 1782 __ vmovsr(S0, R0);
1782 __ mov(R0, ShifterOperand(2)); 1783 __ mov(R0, ShifterOperand(2));
1783 __ vmovsr(S2, R0); 1784 __ vmovsr(S2, R0);
1784 __ mov(R0, ShifterOperand(3)); 1785 __ mov(R0, ShifterOperand(3));
1785 __ vmovsr(S4, R0); 1786 __ vmovsr(S4, R0);
1786 __ mov(R0, ShifterOperand(4)); 1787 __ mov(R0, ShifterOperand(4));
1787 __ vmovsr(S6, R0); 1788 __ vmovsr(S6, R0);
1788 1789
1789 __ vaddqi(kWordPair, Q2, Q0, Q1); 1790 __ vaddqi(kWordPair, Q2, Q0, Q1);
(...skipping 11 matching lines...) Expand all
1801 1802
1802 1803
1803 ASSEMBLER_TEST_RUN(Vaddqi64, test) { 1804 ASSEMBLER_TEST_RUN(Vaddqi64, test) {
1804 EXPECT(test != NULL); 1805 EXPECT(test != NULL);
1805 typedef int (*Tst)(); 1806 typedef int (*Tst)();
1806 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1807 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1807 } 1808 }
1808 1809
1809 1810
1810 ASSEMBLER_TEST_GENERATE(Vsubqi8, assembler) { 1811 ASSEMBLER_TEST_GENERATE(Vsubqi8, assembler) {
1811 if (CPUFeatures::neon_supported()) { 1812 if (TargetCPUFeatures::neon_supported()) {
1812 __ mov(R0, ShifterOperand(1)); 1813 __ mov(R0, ShifterOperand(1));
1813 __ vmovsr(S0, R0); 1814 __ vmovsr(S0, R0);
1814 __ mov(R0, ShifterOperand(2)); 1815 __ mov(R0, ShifterOperand(2));
1815 __ vmovsr(S1, R0); 1816 __ vmovsr(S1, R0);
1816 __ mov(R0, ShifterOperand(3)); 1817 __ mov(R0, ShifterOperand(3));
1817 __ vmovsr(S2, R0); 1818 __ vmovsr(S2, R0);
1818 __ mov(R0, ShifterOperand(4)); 1819 __ mov(R0, ShifterOperand(4));
1819 __ vmovsr(S3, R0); 1820 __ vmovsr(S3, R0);
1820 __ mov(R0, ShifterOperand(2)); 1821 __ mov(R0, ShifterOperand(2));
1821 __ vmovsr(S4, R0); 1822 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
1845 1846
1846 1847
1847 ASSEMBLER_TEST_RUN(Vsubqi8, test) { 1848 ASSEMBLER_TEST_RUN(Vsubqi8, test) {
1848 EXPECT(test != NULL); 1849 EXPECT(test != NULL);
1849 typedef int (*Tst)(); 1850 typedef int (*Tst)();
1850 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1851 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1851 } 1852 }
1852 1853
1853 1854
1854 ASSEMBLER_TEST_GENERATE(Vsubqi16, assembler) { 1855 ASSEMBLER_TEST_GENERATE(Vsubqi16, assembler) {
1855 if (CPUFeatures::neon_supported()) { 1856 if (TargetCPUFeatures::neon_supported()) {
1856 __ mov(R0, ShifterOperand(1)); 1857 __ mov(R0, ShifterOperand(1));
1857 __ vmovsr(S0, R0); 1858 __ vmovsr(S0, R0);
1858 __ mov(R0, ShifterOperand(2)); 1859 __ mov(R0, ShifterOperand(2));
1859 __ vmovsr(S1, R0); 1860 __ vmovsr(S1, R0);
1860 __ mov(R0, ShifterOperand(3)); 1861 __ mov(R0, ShifterOperand(3));
1861 __ vmovsr(S2, R0); 1862 __ vmovsr(S2, R0);
1862 __ mov(R0, ShifterOperand(4)); 1863 __ mov(R0, ShifterOperand(4));
1863 __ vmovsr(S3, R0); 1864 __ vmovsr(S3, R0);
1864 __ mov(R0, ShifterOperand(2)); 1865 __ mov(R0, ShifterOperand(2));
1865 __ vmovsr(S4, R0); 1866 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
1889 1890
1890 1891
1891 ASSEMBLER_TEST_RUN(Vsubqi16, test) { 1892 ASSEMBLER_TEST_RUN(Vsubqi16, test) {
1892 EXPECT(test != NULL); 1893 EXPECT(test != NULL);
1893 typedef int (*Tst)(); 1894 typedef int (*Tst)();
1894 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1895 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1895 } 1896 }
1896 1897
1897 1898
1898 ASSEMBLER_TEST_GENERATE(Vsubqi32, assembler) { 1899 ASSEMBLER_TEST_GENERATE(Vsubqi32, assembler) {
1899 if (CPUFeatures::neon_supported()) { 1900 if (TargetCPUFeatures::neon_supported()) {
1900 __ mov(R0, ShifterOperand(1)); 1901 __ mov(R0, ShifterOperand(1));
1901 __ vmovsr(S0, R0); 1902 __ vmovsr(S0, R0);
1902 __ mov(R0, ShifterOperand(2)); 1903 __ mov(R0, ShifterOperand(2));
1903 __ vmovsr(S1, R0); 1904 __ vmovsr(S1, R0);
1904 __ mov(R0, ShifterOperand(3)); 1905 __ mov(R0, ShifterOperand(3));
1905 __ vmovsr(S2, R0); 1906 __ vmovsr(S2, R0);
1906 __ mov(R0, ShifterOperand(4)); 1907 __ mov(R0, ShifterOperand(4));
1907 __ vmovsr(S3, R0); 1908 __ vmovsr(S3, R0);
1908 __ mov(R0, ShifterOperand(2)); 1909 __ mov(R0, ShifterOperand(2));
1909 __ vmovsr(S4, R0); 1910 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
1933 1934
1934 1935
1935 ASSEMBLER_TEST_RUN(Vsubqi32, test) { 1936 ASSEMBLER_TEST_RUN(Vsubqi32, test) {
1936 EXPECT(test != NULL); 1937 EXPECT(test != NULL);
1937 typedef int (*Tst)(); 1938 typedef int (*Tst)();
1938 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1939 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1939 } 1940 }
1940 1941
1941 1942
1942 ASSEMBLER_TEST_GENERATE(Vsubqi64, assembler) { 1943 ASSEMBLER_TEST_GENERATE(Vsubqi64, assembler) {
1943 if (CPUFeatures::neon_supported()) { 1944 if (TargetCPUFeatures::neon_supported()) {
1944 __ mov(R0, ShifterOperand(1)); 1945 __ mov(R0, ShifterOperand(1));
1945 __ vmovsr(S0, R0); 1946 __ vmovsr(S0, R0);
1946 __ mov(R0, ShifterOperand(2)); 1947 __ mov(R0, ShifterOperand(2));
1947 __ vmovsr(S2, R0); 1948 __ vmovsr(S2, R0);
1948 __ mov(R0, ShifterOperand(2)); 1949 __ mov(R0, ShifterOperand(2));
1949 __ vmovsr(S4, R0); 1950 __ vmovsr(S4, R0);
1950 __ mov(R0, ShifterOperand(4)); 1951 __ mov(R0, ShifterOperand(4));
1951 __ vmovsr(S6, R0); 1952 __ vmovsr(S6, R0);
1952 1953
1953 __ vsubqi(kWordPair, Q2, Q1, Q0); 1954 __ vsubqi(kWordPair, Q2, Q1, Q0);
(...skipping 11 matching lines...) Expand all
1965 1966
1966 1967
1967 ASSEMBLER_TEST_RUN(Vsubqi64, test) { 1968 ASSEMBLER_TEST_RUN(Vsubqi64, test) {
1968 EXPECT(test != NULL); 1969 EXPECT(test != NULL);
1969 typedef int (*Tst)(); 1970 typedef int (*Tst)();
1970 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1971 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1971 } 1972 }
1972 1973
1973 1974
1974 ASSEMBLER_TEST_GENERATE(Vmulqi8, assembler) { 1975 ASSEMBLER_TEST_GENERATE(Vmulqi8, assembler) {
1975 if (CPUFeatures::neon_supported()) { 1976 if (TargetCPUFeatures::neon_supported()) {
1976 __ mov(R0, ShifterOperand(1)); 1977 __ mov(R0, ShifterOperand(1));
1977 __ vmovsr(S0, R0); 1978 __ vmovsr(S0, R0);
1978 __ mov(R0, ShifterOperand(2)); 1979 __ mov(R0, ShifterOperand(2));
1979 __ vmovsr(S1, R0); 1980 __ vmovsr(S1, R0);
1980 __ mov(R0, ShifterOperand(3)); 1981 __ mov(R0, ShifterOperand(3));
1981 __ vmovsr(S2, R0); 1982 __ vmovsr(S2, R0);
1982 __ mov(R0, ShifterOperand(4)); 1983 __ mov(R0, ShifterOperand(4));
1983 __ vmovsr(S3, R0); 1984 __ vmovsr(S3, R0);
1984 __ mov(R0, ShifterOperand(5)); 1985 __ mov(R0, ShifterOperand(5));
1985 __ vmovsr(S4, R0); 1986 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
2009 2010
2010 2011
2011 ASSEMBLER_TEST_RUN(Vmulqi8, test) { 2012 ASSEMBLER_TEST_RUN(Vmulqi8, test) {
2012 EXPECT(test != NULL); 2013 EXPECT(test != NULL);
2013 typedef int (*Tst)(); 2014 typedef int (*Tst)();
2014 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2015 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2015 } 2016 }
2016 2017
2017 2018
2018 ASSEMBLER_TEST_GENERATE(Vmulqi16, assembler) { 2019 ASSEMBLER_TEST_GENERATE(Vmulqi16, assembler) {
2019 if (CPUFeatures::neon_supported()) { 2020 if (TargetCPUFeatures::neon_supported()) {
2020 __ mov(R0, ShifterOperand(1)); 2021 __ mov(R0, ShifterOperand(1));
2021 __ vmovsr(S0, R0); 2022 __ vmovsr(S0, R0);
2022 __ mov(R0, ShifterOperand(2)); 2023 __ mov(R0, ShifterOperand(2));
2023 __ vmovsr(S1, R0); 2024 __ vmovsr(S1, R0);
2024 __ mov(R0, ShifterOperand(3)); 2025 __ mov(R0, ShifterOperand(3));
2025 __ vmovsr(S2, R0); 2026 __ vmovsr(S2, R0);
2026 __ mov(R0, ShifterOperand(4)); 2027 __ mov(R0, ShifterOperand(4));
2027 __ vmovsr(S3, R0); 2028 __ vmovsr(S3, R0);
2028 __ mov(R0, ShifterOperand(5)); 2029 __ mov(R0, ShifterOperand(5));
2029 __ vmovsr(S4, R0); 2030 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
2053 2054
2054 2055
2055 ASSEMBLER_TEST_RUN(Vmulqi16, test) { 2056 ASSEMBLER_TEST_RUN(Vmulqi16, test) {
2056 EXPECT(test != NULL); 2057 EXPECT(test != NULL);
2057 typedef int (*Tst)(); 2058 typedef int (*Tst)();
2058 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2059 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2059 } 2060 }
2060 2061
2061 2062
2062 ASSEMBLER_TEST_GENERATE(Vmulqi32, assembler) { 2063 ASSEMBLER_TEST_GENERATE(Vmulqi32, assembler) {
2063 if (CPUFeatures::neon_supported()) { 2064 if (TargetCPUFeatures::neon_supported()) {
2064 __ mov(R0, ShifterOperand(1)); 2065 __ mov(R0, ShifterOperand(1));
2065 __ vmovsr(S0, R0); 2066 __ vmovsr(S0, R0);
2066 __ mov(R0, ShifterOperand(2)); 2067 __ mov(R0, ShifterOperand(2));
2067 __ vmovsr(S1, R0); 2068 __ vmovsr(S1, R0);
2068 __ mov(R0, ShifterOperand(3)); 2069 __ mov(R0, ShifterOperand(3));
2069 __ vmovsr(S2, R0); 2070 __ vmovsr(S2, R0);
2070 __ mov(R0, ShifterOperand(4)); 2071 __ mov(R0, ShifterOperand(4));
2071 __ vmovsr(S3, R0); 2072 __ vmovsr(S3, R0);
2072 __ mov(R0, ShifterOperand(5)); 2073 __ mov(R0, ShifterOperand(5));
2073 __ vmovsr(S4, R0); 2074 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
2097 2098
2098 2099
2099 ASSEMBLER_TEST_RUN(Vmulqi32, test) { 2100 ASSEMBLER_TEST_RUN(Vmulqi32, test) {
2100 EXPECT(test != NULL); 2101 EXPECT(test != NULL);
2101 typedef int (*Tst)(); 2102 typedef int (*Tst)();
2102 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2103 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2103 } 2104 }
2104 2105
2105 2106
2106 ASSEMBLER_TEST_GENERATE(Vaddqs, assembler) { 2107 ASSEMBLER_TEST_GENERATE(Vaddqs, assembler) {
2107 if (CPUFeatures::neon_supported()) { 2108 if (TargetCPUFeatures::neon_supported()) {
2108 __ LoadSImmediate(S0, 1.0); 2109 __ LoadSImmediate(S0, 1.0);
2109 __ LoadSImmediate(S1, 2.0); 2110 __ LoadSImmediate(S1, 2.0);
2110 __ LoadSImmediate(S2, 3.0); 2111 __ LoadSImmediate(S2, 3.0);
2111 __ LoadSImmediate(S3, 4.0); 2112 __ LoadSImmediate(S3, 4.0);
2112 __ LoadSImmediate(S4, 5.0); 2113 __ LoadSImmediate(S4, 5.0);
2113 __ LoadSImmediate(S5, 6.0); 2114 __ LoadSImmediate(S5, 6.0);
2114 __ LoadSImmediate(S6, 7.0); 2115 __ LoadSImmediate(S6, 7.0);
2115 __ LoadSImmediate(S7, 8.0); 2116 __ LoadSImmediate(S7, 8.0);
2116 2117
2117 __ vaddqs(Q2, Q0, Q1); 2118 __ vaddqs(Q2, Q0, Q1);
(...skipping 14 matching lines...) Expand all
2132 2133
2133 2134
2134 ASSEMBLER_TEST_RUN(Vaddqs, test) { 2135 ASSEMBLER_TEST_RUN(Vaddqs, test) {
2135 EXPECT(test != NULL); 2136 EXPECT(test != NULL);
2136 typedef int (*Tst)(); 2137 typedef int (*Tst)();
2137 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2138 EXPECT_EQ(36, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2138 } 2139 }
2139 2140
2140 2141
2141 ASSEMBLER_TEST_GENERATE(Vsubqs, assembler) { 2142 ASSEMBLER_TEST_GENERATE(Vsubqs, assembler) {
2142 if (CPUFeatures::neon_supported()) { 2143 if (TargetCPUFeatures::neon_supported()) {
2143 __ LoadSImmediate(S0, 1.0); 2144 __ LoadSImmediate(S0, 1.0);
2144 __ LoadSImmediate(S1, 2.0); 2145 __ LoadSImmediate(S1, 2.0);
2145 __ LoadSImmediate(S2, 3.0); 2146 __ LoadSImmediate(S2, 3.0);
2146 __ LoadSImmediate(S3, 4.0); 2147 __ LoadSImmediate(S3, 4.0);
2147 __ LoadSImmediate(S4, 2.0); 2148 __ LoadSImmediate(S4, 2.0);
2148 __ LoadSImmediate(S5, 4.0); 2149 __ LoadSImmediate(S5, 4.0);
2149 __ LoadSImmediate(S6, 6.0); 2150 __ LoadSImmediate(S6, 6.0);
2150 __ LoadSImmediate(S7, 8.0); 2151 __ LoadSImmediate(S7, 8.0);
2151 2152
2152 __ vsubqs(Q2, Q1, Q0); 2153 __ vsubqs(Q2, Q1, Q0);
(...skipping 14 matching lines...) Expand all
2167 2168
2168 2169
2169 ASSEMBLER_TEST_RUN(Vsubqs, test) { 2170 ASSEMBLER_TEST_RUN(Vsubqs, test) {
2170 EXPECT(test != NULL); 2171 EXPECT(test != NULL);
2171 typedef int (*Tst)(); 2172 typedef int (*Tst)();
2172 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2173 EXPECT_EQ(10, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2173 } 2174 }
2174 2175
2175 2176
2176 ASSEMBLER_TEST_GENERATE(Vmulqs, assembler) { 2177 ASSEMBLER_TEST_GENERATE(Vmulqs, assembler) {
2177 if (CPUFeatures::neon_supported()) { 2178 if (TargetCPUFeatures::neon_supported()) {
2178 __ LoadSImmediate(S0, 1.0); 2179 __ LoadSImmediate(S0, 1.0);
2179 __ LoadSImmediate(S1, 2.0); 2180 __ LoadSImmediate(S1, 2.0);
2180 __ LoadSImmediate(S2, 3.0); 2181 __ LoadSImmediate(S2, 3.0);
2181 __ LoadSImmediate(S3, 4.0); 2182 __ LoadSImmediate(S3, 4.0);
2182 __ LoadSImmediate(S4, 5.0); 2183 __ LoadSImmediate(S4, 5.0);
2183 __ LoadSImmediate(S5, 6.0); 2184 __ LoadSImmediate(S5, 6.0);
2184 __ LoadSImmediate(S6, 7.0); 2185 __ LoadSImmediate(S6, 7.0);
2185 __ LoadSImmediate(S7, 8.0); 2186 __ LoadSImmediate(S7, 8.0);
2186 2187
2187 __ vmulqs(Q2, Q1, Q0); 2188 __ vmulqs(Q2, Q1, Q0);
(...skipping 14 matching lines...) Expand all
2202 2203
2203 2204
2204 ASSEMBLER_TEST_RUN(Vmulqs, test) { 2205 ASSEMBLER_TEST_RUN(Vmulqs, test) {
2205 EXPECT(test != NULL); 2206 EXPECT(test != NULL);
2206 typedef int (*Tst)(); 2207 typedef int (*Tst)();
2207 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2208 EXPECT_EQ(70, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2208 } 2209 }
2209 2210
2210 2211
2211 ASSEMBLER_TEST_GENERATE(VtblX, assembler) { 2212 ASSEMBLER_TEST_GENERATE(VtblX, assembler) {
2212 if (CPUFeatures::neon_supported()) { 2213 if (TargetCPUFeatures::neon_supported()) {
2213 // Index. 2214 // Index.
2214 __ LoadImmediate(R0, 0x03020100); 2215 __ LoadImmediate(R0, 0x03020100);
2215 __ vmovsr(S0, R0); 2216 __ vmovsr(S0, R0);
2216 __ vmovsr(S1, R0); 2217 __ vmovsr(S1, R0);
2217 2218
2218 // Table. 2219 // Table.
2219 __ LoadSImmediate(S2, 1.0); 2220 __ LoadSImmediate(S2, 1.0);
2220 __ LoadSImmediate(S3, 2.0); 2221 __ LoadSImmediate(S3, 2.0);
2221 __ LoadSImmediate(S4, 3.0); 2222 __ LoadSImmediate(S4, 3.0);
2222 __ LoadSImmediate(S5, 4.0); 2223 __ LoadSImmediate(S5, 4.0);
(...skipping 22 matching lines...) Expand all
2245 2246
2246 2247
2247 ASSEMBLER_TEST_RUN(VtblX, test) { 2248 ASSEMBLER_TEST_RUN(VtblX, test) {
2248 EXPECT(test != NULL); 2249 EXPECT(test != NULL);
2249 typedef int (*Tst)(); 2250 typedef int (*Tst)();
2250 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2251 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2251 } 2252 }
2252 2253
2253 2254
2254 ASSEMBLER_TEST_GENERATE(VtblY, assembler) { 2255 ASSEMBLER_TEST_GENERATE(VtblY, assembler) {
2255 if (CPUFeatures::neon_supported()) { 2256 if (TargetCPUFeatures::neon_supported()) {
2256 // Index. 2257 // Index.
2257 __ LoadImmediate(R0, 0x07060504); 2258 __ LoadImmediate(R0, 0x07060504);
2258 __ vmovsr(S0, R0); 2259 __ vmovsr(S0, R0);
2259 __ vmovsr(S1, R0); 2260 __ vmovsr(S1, R0);
2260 2261
2261 // Table. 2262 // Table.
2262 __ LoadSImmediate(S2, 2.0); 2263 __ LoadSImmediate(S2, 2.0);
2263 __ LoadSImmediate(S3, 1.0); 2264 __ LoadSImmediate(S3, 1.0);
2264 __ LoadSImmediate(S4, 3.0); 2265 __ LoadSImmediate(S4, 3.0);
2265 __ LoadSImmediate(S5, 4.0); 2266 __ LoadSImmediate(S5, 4.0);
(...skipping 22 matching lines...) Expand all
2288 2289
2289 2290
2290 ASSEMBLER_TEST_RUN(VtblY, test) { 2291 ASSEMBLER_TEST_RUN(VtblY, test) {
2291 EXPECT(test != NULL); 2292 EXPECT(test != NULL);
2292 typedef int (*Tst)(); 2293 typedef int (*Tst)();
2293 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2294 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2294 } 2295 }
2295 2296
2296 2297
2297 ASSEMBLER_TEST_GENERATE(VtblZ, assembler) { 2298 ASSEMBLER_TEST_GENERATE(VtblZ, assembler) {
2298 if (CPUFeatures::neon_supported()) { 2299 if (TargetCPUFeatures::neon_supported()) {
2299 // Index. 2300 // Index.
2300 __ LoadImmediate(R0, 0x0b0a0908); 2301 __ LoadImmediate(R0, 0x0b0a0908);
2301 __ vmovsr(S0, R0); 2302 __ vmovsr(S0, R0);
2302 __ vmovsr(S1, R0); 2303 __ vmovsr(S1, R0);
2303 2304
2304 // Table. 2305 // Table.
2305 __ LoadSImmediate(S2, 2.0); 2306 __ LoadSImmediate(S2, 2.0);
2306 __ LoadSImmediate(S3, 3.0); 2307 __ LoadSImmediate(S3, 3.0);
2307 __ LoadSImmediate(S4, 1.0); 2308 __ LoadSImmediate(S4, 1.0);
2308 __ LoadSImmediate(S5, 4.0); 2309 __ LoadSImmediate(S5, 4.0);
(...skipping 22 matching lines...) Expand all
2331 2332
2332 2333
2333 ASSEMBLER_TEST_RUN(VtblZ, test) { 2334 ASSEMBLER_TEST_RUN(VtblZ, test) {
2334 EXPECT(test != NULL); 2335 EXPECT(test != NULL);
2335 typedef int (*Tst)(); 2336 typedef int (*Tst)();
2336 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2337 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2337 } 2338 }
2338 2339
2339 2340
2340 ASSEMBLER_TEST_GENERATE(VtblW, assembler) { 2341 ASSEMBLER_TEST_GENERATE(VtblW, assembler) {
2341 if (CPUFeatures::neon_supported()) { 2342 if (TargetCPUFeatures::neon_supported()) {
2342 // Index. 2343 // Index.
2343 __ LoadImmediate(R0, 0x0f0e0d0c); 2344 __ LoadImmediate(R0, 0x0f0e0d0c);
2344 __ vmovsr(S0, R0); 2345 __ vmovsr(S0, R0);
2345 __ vmovsr(S1, R0); 2346 __ vmovsr(S1, R0);
2346 2347
2347 // Table. 2348 // Table.
2348 __ LoadSImmediate(S2, 2.0); 2349 __ LoadSImmediate(S2, 2.0);
2349 __ LoadSImmediate(S3, 3.0); 2350 __ LoadSImmediate(S3, 3.0);
2350 __ LoadSImmediate(S4, 4.0); 2351 __ LoadSImmediate(S4, 4.0);
2351 __ LoadSImmediate(S5, 1.0); 2352 __ LoadSImmediate(S5, 1.0);
(...skipping 22 matching lines...) Expand all
2374 2375
2375 2376
2376 ASSEMBLER_TEST_RUN(VtblW, test) { 2377 ASSEMBLER_TEST_RUN(VtblW, test) {
2377 EXPECT(test != NULL); 2378 EXPECT(test != NULL);
2378 typedef int (*Tst)(); 2379 typedef int (*Tst)();
2379 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2380 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2380 } 2381 }
2381 2382
2382 2383
2383 ASSEMBLER_TEST_GENERATE(Veorq, assembler) { 2384 ASSEMBLER_TEST_GENERATE(Veorq, assembler) {
2384 if (CPUFeatures::neon_supported()) { 2385 if (TargetCPUFeatures::neon_supported()) {
2385 // Q0 2386 // Q0
2386 __ LoadImmediate(R0, 0xaaaaaaab); 2387 __ LoadImmediate(R0, 0xaaaaaaab);
2387 __ vmovsr(S0, R0); 2388 __ vmovsr(S0, R0);
2388 __ vmovsr(S1, R0); 2389 __ vmovsr(S1, R0);
2389 __ vmovsr(S2, R0); 2390 __ vmovsr(S2, R0);
2390 __ vmovsr(S3, R0); 2391 __ vmovsr(S3, R0);
2391 2392
2392 // Q1 2393 // Q1
2393 __ LoadImmediate(R0, 0x55555555); 2394 __ LoadImmediate(R0, 0x55555555);
2394 __ vmovsr(S4, R0); 2395 __ vmovsr(S4, R0);
(...skipping 21 matching lines...) Expand all
2416 2417
2417 2418
2418 ASSEMBLER_TEST_RUN(Veorq, test) { 2419 ASSEMBLER_TEST_RUN(Veorq, test) {
2419 EXPECT(test != NULL); 2420 EXPECT(test != NULL);
2420 typedef int (*Tst)(); 2421 typedef int (*Tst)();
2421 EXPECT_EQ(-8, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2422 EXPECT_EQ(-8, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2422 } 2423 }
2423 2424
2424 2425
2425 ASSEMBLER_TEST_GENERATE(Vornq, assembler) { 2426 ASSEMBLER_TEST_GENERATE(Vornq, assembler) {
2426 if (CPUFeatures::neon_supported()) { 2427 if (TargetCPUFeatures::neon_supported()) {
2427 // Q0 2428 // Q0
2428 __ LoadImmediate(R0, 0xfffffff0); 2429 __ LoadImmediate(R0, 0xfffffff0);
2429 __ vmovsr(S0, R0); 2430 __ vmovsr(S0, R0);
2430 __ vmovsr(S1, R0); 2431 __ vmovsr(S1, R0);
2431 __ vmovsr(S2, R0); 2432 __ vmovsr(S2, R0);
2432 __ vmovsr(S3, R0); 2433 __ vmovsr(S3, R0);
2433 2434
2434 // Q1 2435 // Q1
2435 __ LoadImmediate(R0, 0); 2436 __ LoadImmediate(R0, 0);
2436 __ vmovsr(S4, R0); 2437 __ vmovsr(S4, R0);
(...skipping 21 matching lines...) Expand all
2458 2459
2459 2460
2460 ASSEMBLER_TEST_RUN(Vornq, test) { 2461 ASSEMBLER_TEST_RUN(Vornq, test) {
2461 EXPECT(test != NULL); 2462 EXPECT(test != NULL);
2462 typedef int (*Tst)(); 2463 typedef int (*Tst)();
2463 EXPECT_EQ(60, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2464 EXPECT_EQ(60, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2464 } 2465 }
2465 2466
2466 2467
2467 ASSEMBLER_TEST_GENERATE(Vorrq, assembler) { 2468 ASSEMBLER_TEST_GENERATE(Vorrq, assembler) {
2468 if (CPUFeatures::neon_supported()) { 2469 if (TargetCPUFeatures::neon_supported()) {
2469 // Q0 2470 // Q0
2470 __ LoadImmediate(R0, 0xaaaaaaaa); 2471 __ LoadImmediate(R0, 0xaaaaaaaa);
2471 __ vmovsr(S0, R0); 2472 __ vmovsr(S0, R0);
2472 __ vmovsr(S1, R0); 2473 __ vmovsr(S1, R0);
2473 __ vmovsr(S2, R0); 2474 __ vmovsr(S2, R0);
2474 __ vmovsr(S3, R0); 2475 __ vmovsr(S3, R0);
2475 2476
2476 // Q1 2477 // Q1
2477 __ LoadImmediate(R0, 0x55555555); 2478 __ LoadImmediate(R0, 0x55555555);
2478 __ vmovsr(S4, R0); 2479 __ vmovsr(S4, R0);
(...skipping 21 matching lines...) Expand all
2500 2501
2501 2502
2502 ASSEMBLER_TEST_RUN(Vorrq, test) { 2503 ASSEMBLER_TEST_RUN(Vorrq, test) {
2503 EXPECT(test != NULL); 2504 EXPECT(test != NULL);
2504 typedef int (*Tst)(); 2505 typedef int (*Tst)();
2505 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2506 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2506 } 2507 }
2507 2508
2508 2509
2509 ASSEMBLER_TEST_GENERATE(Vandq, assembler) { 2510 ASSEMBLER_TEST_GENERATE(Vandq, assembler) {
2510 if (CPUFeatures::neon_supported()) { 2511 if (TargetCPUFeatures::neon_supported()) {
2511 // Q0 2512 // Q0
2512 __ LoadImmediate(R0, 0xaaaaaaab); 2513 __ LoadImmediate(R0, 0xaaaaaaab);
2513 __ vmovsr(S0, R0); 2514 __ vmovsr(S0, R0);
2514 __ vmovsr(S1, R0); 2515 __ vmovsr(S1, R0);
2515 __ vmovsr(S2, R0); 2516 __ vmovsr(S2, R0);
2516 __ vmovsr(S3, R0); 2517 __ vmovsr(S3, R0);
2517 2518
2518 // Q1 2519 // Q1
2519 __ LoadImmediate(R0, 0x55555555); 2520 __ LoadImmediate(R0, 0x55555555);
2520 __ vmovsr(S4, R0); 2521 __ vmovsr(S4, R0);
(...skipping 21 matching lines...) Expand all
2542 2543
2543 2544
2544 ASSEMBLER_TEST_RUN(Vandq, test) { 2545 ASSEMBLER_TEST_RUN(Vandq, test) {
2545 EXPECT(test != NULL); 2546 EXPECT(test != NULL);
2546 typedef int (*Tst)(); 2547 typedef int (*Tst)();
2547 EXPECT_EQ(4, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2548 EXPECT_EQ(4, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2548 } 2549 }
2549 2550
2550 2551
2551 ASSEMBLER_TEST_GENERATE(Vmovq, assembler) { 2552 ASSEMBLER_TEST_GENERATE(Vmovq, assembler) {
2552 if (CPUFeatures::neon_supported()) { 2553 if (TargetCPUFeatures::neon_supported()) {
2553 // Q0 2554 // Q0
2554 __ LoadSImmediate(S0, 1.0); 2555 __ LoadSImmediate(S0, 1.0);
2555 __ vmovs(S1, S0); 2556 __ vmovs(S1, S0);
2556 __ vmovs(S2, S0); 2557 __ vmovs(S2, S0);
2557 __ vmovs(S3, S0); 2558 __ vmovs(S3, S0);
2558 2559
2559 // Q0 2560 // Q0
2560 __ LoadSImmediate(S4, -1.0); 2561 __ LoadSImmediate(S4, -1.0);
2561 __ vmovs(S5, S0); 2562 __ vmovs(S5, S0);
2562 __ vmovs(S6, S0); 2563 __ vmovs(S6, S0);
(...skipping 17 matching lines...) Expand all
2580 2581
2581 2582
2582 ASSEMBLER_TEST_RUN(Vmovq, test) { 2583 ASSEMBLER_TEST_RUN(Vmovq, test) {
2583 EXPECT(test != NULL); 2584 EXPECT(test != NULL);
2584 typedef int (*Tst)(); 2585 typedef int (*Tst)();
2585 EXPECT_EQ(4, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2586 EXPECT_EQ(4, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2586 } 2587 }
2587 2588
2588 2589
2589 ASSEMBLER_TEST_GENERATE(Vdupb, assembler) { 2590 ASSEMBLER_TEST_GENERATE(Vdupb, assembler) {
2590 if (CPUFeatures::neon_supported()) { 2591 if (TargetCPUFeatures::neon_supported()) {
2591 __ LoadImmediate(R0, 0x00000000); 2592 __ LoadImmediate(R0, 0x00000000);
2592 __ LoadImmediate(R1, 0x00ff0000); 2593 __ LoadImmediate(R1, 0x00ff0000);
2593 __ vmovsr(S4, R0); 2594 __ vmovsr(S4, R0);
2594 __ vmovsr(S5, R1); 2595 __ vmovsr(S5, R1);
2595 2596
2596 // Should copy 0xff to each byte of Q0. 2597 // Should copy 0xff to each byte of Q0.
2597 __ vdup(kByte, Q0, D2, 6); 2598 __ vdup(kByte, Q0, D2, 6);
2598 2599
2599 __ vmovrs(R0, S0); 2600 __ vmovrs(R0, S0);
2600 __ vmovrs(R1, S1); 2601 __ vmovrs(R1, S1);
(...skipping 12 matching lines...) Expand all
2613 2614
2614 2615
2615 ASSEMBLER_TEST_RUN(Vdupb, test) { 2616 ASSEMBLER_TEST_RUN(Vdupb, test) {
2616 EXPECT(test != NULL); 2617 EXPECT(test != NULL);
2617 typedef int (*Tst)(); 2618 typedef int (*Tst)();
2618 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2619 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2619 } 2620 }
2620 2621
2621 2622
2622 ASSEMBLER_TEST_GENERATE(Vduph, assembler) { 2623 ASSEMBLER_TEST_GENERATE(Vduph, assembler) {
2623 if (CPUFeatures::neon_supported()) { 2624 if (TargetCPUFeatures::neon_supported()) {
2624 __ LoadImmediate(R0, 0xffff0000); 2625 __ LoadImmediate(R0, 0xffff0000);
2625 __ LoadImmediate(R1, 0x00000000); 2626 __ LoadImmediate(R1, 0x00000000);
2626 __ vmovsr(S4, R0); 2627 __ vmovsr(S4, R0);
2627 __ vmovsr(S5, R1); 2628 __ vmovsr(S5, R1);
2628 2629
2629 // Should copy 0xff to each byte of Q0. 2630 // Should copy 0xff to each byte of Q0.
2630 __ vdup(kHalfword, Q0, D2, 1); 2631 __ vdup(kHalfword, Q0, D2, 1);
2631 2632
2632 __ vmovrs(R0, S0); 2633 __ vmovrs(R0, S0);
2633 __ vmovrs(R1, S1); 2634 __ vmovrs(R1, S1);
(...skipping 12 matching lines...) Expand all
2646 2647
2647 2648
2648 ASSEMBLER_TEST_RUN(Vduph, test) { 2649 ASSEMBLER_TEST_RUN(Vduph, test) {
2649 EXPECT(test != NULL); 2650 EXPECT(test != NULL);
2650 typedef int (*Tst)(); 2651 typedef int (*Tst)();
2651 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2652 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2652 } 2653 }
2653 2654
2654 2655
2655 ASSEMBLER_TEST_GENERATE(Vdupw, assembler) { 2656 ASSEMBLER_TEST_GENERATE(Vdupw, assembler) {
2656 if (CPUFeatures::neon_supported()) { 2657 if (TargetCPUFeatures::neon_supported()) {
2657 __ LoadImmediate(R0, 0x00000000); 2658 __ LoadImmediate(R0, 0x00000000);
2658 __ LoadImmediate(R1, 0xffffffff); 2659 __ LoadImmediate(R1, 0xffffffff);
2659 __ vmovsr(S4, R0); 2660 __ vmovsr(S4, R0);
2660 __ vmovsr(S5, R1); 2661 __ vmovsr(S5, R1);
2661 2662
2662 // Should copy 0xff to each byte of Q0. 2663 // Should copy 0xff to each byte of Q0.
2663 __ vdup(kWord, Q0, D2, 1); 2664 __ vdup(kWord, Q0, D2, 1);
2664 2665
2665 __ vmovrs(R0, S0); 2666 __ vmovrs(R0, S0);
2666 __ vmovrs(R1, S1); 2667 __ vmovrs(R1, S1);
(...skipping 12 matching lines...) Expand all
2679 2680
2680 2681
2681 ASSEMBLER_TEST_RUN(Vdupw, test) { 2682 ASSEMBLER_TEST_RUN(Vdupw, test) {
2682 EXPECT(test != NULL); 2683 EXPECT(test != NULL);
2683 typedef int (*Tst)(); 2684 typedef int (*Tst)();
2684 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2685 EXPECT_EQ(-4, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2685 } 2686 }
2686 2687
2687 2688
2688 ASSEMBLER_TEST_GENERATE(Vzipqw, assembler) { 2689 ASSEMBLER_TEST_GENERATE(Vzipqw, assembler) {
2689 if (CPUFeatures::neon_supported()) { 2690 if (TargetCPUFeatures::neon_supported()) {
2690 __ LoadSImmediate(S0, 0.0); 2691 __ LoadSImmediate(S0, 0.0);
2691 __ LoadSImmediate(S1, 1.0); 2692 __ LoadSImmediate(S1, 1.0);
2692 __ LoadSImmediate(S2, 2.0); 2693 __ LoadSImmediate(S2, 2.0);
2693 __ LoadSImmediate(S3, 3.0); 2694 __ LoadSImmediate(S3, 3.0);
2694 __ LoadSImmediate(S4, 4.0); 2695 __ LoadSImmediate(S4, 4.0);
2695 __ LoadSImmediate(S5, 5.0); 2696 __ LoadSImmediate(S5, 5.0);
2696 __ LoadSImmediate(S6, 6.0); 2697 __ LoadSImmediate(S6, 6.0);
2697 __ LoadSImmediate(S7, 7.0); 2698 __ LoadSImmediate(S7, 7.0);
2698 2699
2699 __ vzipqw(Q0, Q1); 2700 __ vzipqw(Q0, Q1);
(...skipping 13 matching lines...) Expand all
2713 2714
2714 ASSEMBLER_TEST_RUN(Vzipqw, test) { 2715 ASSEMBLER_TEST_RUN(Vzipqw, test) {
2715 EXPECT(test != NULL); 2716 EXPECT(test != NULL);
2716 typedef float (*Vzipqw)(); 2717 typedef float (*Vzipqw)();
2717 float res = EXECUTE_TEST_CODE_FLOAT(Vzipqw, test->entry()); 2718 float res = EXECUTE_TEST_CODE_FLOAT(Vzipqw, test->entry());
2718 EXPECT_FLOAT_EQ(8.0, res, 0.0001f); 2719 EXPECT_FLOAT_EQ(8.0, res, 0.0001f);
2719 } 2720 }
2720 2721
2721 2722
2722 ASSEMBLER_TEST_GENERATE(Vceqqi32, assembler) { 2723 ASSEMBLER_TEST_GENERATE(Vceqqi32, assembler) {
2723 if (CPUFeatures::neon_supported()) { 2724 if (TargetCPUFeatures::neon_supported()) {
2724 __ mov(R0, ShifterOperand(1)); 2725 __ mov(R0, ShifterOperand(1));
2725 __ vmovsr(S0, R0); 2726 __ vmovsr(S0, R0);
2726 __ mov(R0, ShifterOperand(2)); 2727 __ mov(R0, ShifterOperand(2));
2727 __ vmovsr(S1, R0); 2728 __ vmovsr(S1, R0);
2728 __ mov(R0, ShifterOperand(3)); 2729 __ mov(R0, ShifterOperand(3));
2729 __ vmovsr(S2, R0); 2730 __ vmovsr(S2, R0);
2730 __ mov(R0, ShifterOperand(4)); 2731 __ mov(R0, ShifterOperand(4));
2731 __ vmovsr(S3, R0); 2732 __ vmovsr(S3, R0);
2732 __ mov(R0, ShifterOperand(1)); 2733 __ mov(R0, ShifterOperand(1));
2733 __ vmovsr(S4, R0); 2734 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
2757 2758
2758 2759
2759 ASSEMBLER_TEST_RUN(Vceqqi32, test) { 2760 ASSEMBLER_TEST_RUN(Vceqqi32, test) {
2760 EXPECT(test != NULL); 2761 EXPECT(test != NULL);
2761 typedef int (*Tst)(); 2762 typedef int (*Tst)();
2762 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2763 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2763 } 2764 }
2764 2765
2765 2766
2766 ASSEMBLER_TEST_GENERATE(Vceqqs, assembler) { 2767 ASSEMBLER_TEST_GENERATE(Vceqqs, assembler) {
2767 if (CPUFeatures::neon_supported()) { 2768 if (TargetCPUFeatures::neon_supported()) {
2768 __ LoadSImmediate(S0, 1.0); 2769 __ LoadSImmediate(S0, 1.0);
2769 __ LoadSImmediate(S1, 2.0); 2770 __ LoadSImmediate(S1, 2.0);
2770 __ LoadSImmediate(S2, 3.0); 2771 __ LoadSImmediate(S2, 3.0);
2771 __ LoadSImmediate(S3, 4.0); 2772 __ LoadSImmediate(S3, 4.0);
2772 __ LoadSImmediate(S4, 1.0); 2773 __ LoadSImmediate(S4, 1.0);
2773 __ LoadSImmediate(S5, 4.0); 2774 __ LoadSImmediate(S5, 4.0);
2774 __ LoadSImmediate(S6, 3.0); 2775 __ LoadSImmediate(S6, 3.0);
2775 __ LoadSImmediate(S7, 8.0); 2776 __ LoadSImmediate(S7, 8.0);
2776 2777
2777 __ vceqqs(Q2, Q1, Q0); 2778 __ vceqqs(Q2, Q1, Q0);
(...skipping 15 matching lines...) Expand all
2793 2794
2794 2795
2795 ASSEMBLER_TEST_RUN(Vceqqs, test) { 2796 ASSEMBLER_TEST_RUN(Vceqqs, test) {
2796 EXPECT(test != NULL); 2797 EXPECT(test != NULL);
2797 typedef int (*Tst)(); 2798 typedef int (*Tst)();
2798 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2799 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2799 } 2800 }
2800 2801
2801 2802
2802 ASSEMBLER_TEST_GENERATE(Vcgeqi32, assembler) { 2803 ASSEMBLER_TEST_GENERATE(Vcgeqi32, assembler) {
2803 if (CPUFeatures::neon_supported()) { 2804 if (TargetCPUFeatures::neon_supported()) {
2804 __ mov(R0, ShifterOperand(1)); 2805 __ mov(R0, ShifterOperand(1));
2805 __ vmovsr(S0, R0); 2806 __ vmovsr(S0, R0);
2806 __ mov(R0, ShifterOperand(2)); 2807 __ mov(R0, ShifterOperand(2));
2807 __ vmovsr(S1, R0); 2808 __ vmovsr(S1, R0);
2808 __ mov(R0, ShifterOperand(3)); 2809 __ mov(R0, ShifterOperand(3));
2809 __ vmovsr(S2, R0); 2810 __ vmovsr(S2, R0);
2810 __ mov(R0, ShifterOperand(4)); 2811 __ mov(R0, ShifterOperand(4));
2811 __ vmovsr(S3, R0); 2812 __ vmovsr(S3, R0);
2812 __ mov(R0, ShifterOperand(1)); 2813 __ mov(R0, ShifterOperand(1));
2813 __ vmovsr(S4, R0); 2814 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
2837 2838
2838 2839
2839 ASSEMBLER_TEST_RUN(Vcgeqi32, test) { 2840 ASSEMBLER_TEST_RUN(Vcgeqi32, test) {
2840 EXPECT(test != NULL); 2841 EXPECT(test != NULL);
2841 typedef int (*Tst)(); 2842 typedef int (*Tst)();
2842 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2843 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2843 } 2844 }
2844 2845
2845 2846
2846 ASSEMBLER_TEST_GENERATE(Vcugeqi32, assembler) { 2847 ASSEMBLER_TEST_GENERATE(Vcugeqi32, assembler) {
2847 if (CPUFeatures::neon_supported()) { 2848 if (TargetCPUFeatures::neon_supported()) {
2848 __ mov(R0, ShifterOperand(1)); 2849 __ mov(R0, ShifterOperand(1));
2849 __ vmovsr(S0, R0); 2850 __ vmovsr(S0, R0);
2850 __ mov(R0, ShifterOperand(2)); 2851 __ mov(R0, ShifterOperand(2));
2851 __ vmovsr(S1, R0); 2852 __ vmovsr(S1, R0);
2852 __ mov(R0, ShifterOperand(3)); 2853 __ mov(R0, ShifterOperand(3));
2853 __ vmovsr(S2, R0); 2854 __ vmovsr(S2, R0);
2854 __ mov(R0, ShifterOperand(4)); 2855 __ mov(R0, ShifterOperand(4));
2855 __ vmovsr(S3, R0); 2856 __ vmovsr(S3, R0);
2856 __ LoadImmediate(R0, -1); 2857 __ LoadImmediate(R0, -1);
2857 __ vmovsr(S4, R0); 2858 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
2881 2882
2882 2883
2883 ASSEMBLER_TEST_RUN(Vcugeqi32, test) { 2884 ASSEMBLER_TEST_RUN(Vcugeqi32, test) {
2884 EXPECT(test != NULL); 2885 EXPECT(test != NULL);
2885 typedef int (*Tst)(); 2886 typedef int (*Tst)();
2886 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2887 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2887 } 2888 }
2888 2889
2889 2890
2890 ASSEMBLER_TEST_GENERATE(Vcgeqs, assembler) { 2891 ASSEMBLER_TEST_GENERATE(Vcgeqs, assembler) {
2891 if (CPUFeatures::neon_supported()) { 2892 if (TargetCPUFeatures::neon_supported()) {
2892 __ LoadSImmediate(S0, 1.0); 2893 __ LoadSImmediate(S0, 1.0);
2893 __ LoadSImmediate(S1, 2.0); 2894 __ LoadSImmediate(S1, 2.0);
2894 __ LoadSImmediate(S2, 3.0); 2895 __ LoadSImmediate(S2, 3.0);
2895 __ LoadSImmediate(S3, 4.0); 2896 __ LoadSImmediate(S3, 4.0);
2896 __ LoadSImmediate(S4, 1.0); 2897 __ LoadSImmediate(S4, 1.0);
2897 __ LoadSImmediate(S5, 1.0); 2898 __ LoadSImmediate(S5, 1.0);
2898 __ LoadSImmediate(S6, 3.0); 2899 __ LoadSImmediate(S6, 3.0);
2899 __ LoadSImmediate(S7, 1.0); 2900 __ LoadSImmediate(S7, 1.0);
2900 2901
2901 __ vcgeqs(Q2, Q1, Q0); 2902 __ vcgeqs(Q2, Q1, Q0);
(...skipping 15 matching lines...) Expand all
2917 2918
2918 2919
2919 ASSEMBLER_TEST_RUN(Vcgeqs, test) { 2920 ASSEMBLER_TEST_RUN(Vcgeqs, test) {
2920 EXPECT(test != NULL); 2921 EXPECT(test != NULL);
2921 typedef int (*Tst)(); 2922 typedef int (*Tst)();
2922 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2923 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2923 } 2924 }
2924 2925
2925 2926
2926 ASSEMBLER_TEST_GENERATE(Vcgtqi32, assembler) { 2927 ASSEMBLER_TEST_GENERATE(Vcgtqi32, assembler) {
2927 if (CPUFeatures::neon_supported()) { 2928 if (TargetCPUFeatures::neon_supported()) {
2928 __ mov(R0, ShifterOperand(1)); 2929 __ mov(R0, ShifterOperand(1));
2929 __ vmovsr(S0, R0); 2930 __ vmovsr(S0, R0);
2930 __ mov(R0, ShifterOperand(2)); 2931 __ mov(R0, ShifterOperand(2));
2931 __ vmovsr(S1, R0); 2932 __ vmovsr(S1, R0);
2932 __ mov(R0, ShifterOperand(3)); 2933 __ mov(R0, ShifterOperand(3));
2933 __ vmovsr(S2, R0); 2934 __ vmovsr(S2, R0);
2934 __ mov(R0, ShifterOperand(4)); 2935 __ mov(R0, ShifterOperand(4));
2935 __ vmovsr(S3, R0); 2936 __ vmovsr(S3, R0);
2936 __ mov(R0, ShifterOperand(2)); 2937 __ mov(R0, ShifterOperand(2));
2937 __ vmovsr(S4, R0); 2938 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
2961 2962
2962 2963
2963 ASSEMBLER_TEST_RUN(Vcgtqi32, test) { 2964 ASSEMBLER_TEST_RUN(Vcgtqi32, test) {
2964 EXPECT(test != NULL); 2965 EXPECT(test != NULL);
2965 typedef int (*Tst)(); 2966 typedef int (*Tst)();
2966 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 2967 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
2967 } 2968 }
2968 2969
2969 2970
2970 ASSEMBLER_TEST_GENERATE(Vcugtqi32, assembler) { 2971 ASSEMBLER_TEST_GENERATE(Vcugtqi32, assembler) {
2971 if (CPUFeatures::neon_supported()) { 2972 if (TargetCPUFeatures::neon_supported()) {
2972 __ mov(R0, ShifterOperand(1)); 2973 __ mov(R0, ShifterOperand(1));
2973 __ vmovsr(S0, R0); 2974 __ vmovsr(S0, R0);
2974 __ mov(R0, ShifterOperand(2)); 2975 __ mov(R0, ShifterOperand(2));
2975 __ vmovsr(S1, R0); 2976 __ vmovsr(S1, R0);
2976 __ mov(R0, ShifterOperand(3)); 2977 __ mov(R0, ShifterOperand(3));
2977 __ vmovsr(S2, R0); 2978 __ vmovsr(S2, R0);
2978 __ mov(R0, ShifterOperand(4)); 2979 __ mov(R0, ShifterOperand(4));
2979 __ vmovsr(S3, R0); 2980 __ vmovsr(S3, R0);
2980 __ LoadImmediate(R0, -1); 2981 __ LoadImmediate(R0, -1);
2981 __ vmovsr(S4, R0); 2982 __ vmovsr(S4, R0);
(...skipping 23 matching lines...) Expand all
3005 3006
3006 3007
3007 ASSEMBLER_TEST_RUN(Vcugtqi32, test) { 3008 ASSEMBLER_TEST_RUN(Vcugtqi32, test) {
3008 EXPECT(test != NULL); 3009 EXPECT(test != NULL);
3009 typedef int (*Tst)(); 3010 typedef int (*Tst)();
3010 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 3011 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
3011 } 3012 }
3012 3013
3013 3014
3014 ASSEMBLER_TEST_GENERATE(Vcgtqs, assembler) { 3015 ASSEMBLER_TEST_GENERATE(Vcgtqs, assembler) {
3015 if (CPUFeatures::neon_supported()) { 3016 if (TargetCPUFeatures::neon_supported()) {
3016 __ LoadSImmediate(S0, 1.0); 3017 __ LoadSImmediate(S0, 1.0);
3017 __ LoadSImmediate(S1, 2.0); 3018 __ LoadSImmediate(S1, 2.0);
3018 __ LoadSImmediate(S2, 3.0); 3019 __ LoadSImmediate(S2, 3.0);
3019 __ LoadSImmediate(S3, 4.0); 3020 __ LoadSImmediate(S3, 4.0);
3020 __ LoadSImmediate(S4, 2.0); 3021 __ LoadSImmediate(S4, 2.0);
3021 __ LoadSImmediate(S5, 1.0); 3022 __ LoadSImmediate(S5, 1.0);
3022 __ LoadSImmediate(S6, 4.0); 3023 __ LoadSImmediate(S6, 4.0);
3023 __ LoadSImmediate(S7, 1.0); 3024 __ LoadSImmediate(S7, 1.0);
3024 3025
3025 __ vcgtqs(Q2, Q1, Q0); 3026 __ vcgtqs(Q2, Q1, Q0);
(...skipping 15 matching lines...) Expand all
3041 3042
3042 3043
3043 ASSEMBLER_TEST_RUN(Vcgtqs, test) { 3044 ASSEMBLER_TEST_RUN(Vcgtqs, test) {
3044 EXPECT(test != NULL); 3045 EXPECT(test != NULL);
3045 typedef int (*Tst)(); 3046 typedef int (*Tst)();
3046 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 3047 EXPECT_EQ(-2, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
3047 } 3048 }
3048 3049
3049 3050
3050 ASSEMBLER_TEST_GENERATE(Vminqs, assembler) { 3051 ASSEMBLER_TEST_GENERATE(Vminqs, assembler) {
3051 if (CPUFeatures::neon_supported()) { 3052 if (TargetCPUFeatures::neon_supported()) {
3052 __ LoadSImmediate(S0, 1.0); 3053 __ LoadSImmediate(S0, 1.0);
3053 __ LoadSImmediate(S1, 2.0); 3054 __ LoadSImmediate(S1, 2.0);
3054 __ LoadSImmediate(S2, 3.0); 3055 __ LoadSImmediate(S2, 3.0);
3055 __ LoadSImmediate(S3, 4.0); 3056 __ LoadSImmediate(S3, 4.0);
3056 3057
3057 __ LoadSImmediate(S4, 2.0); 3058 __ LoadSImmediate(S4, 2.0);
3058 __ LoadSImmediate(S5, 1.0); 3059 __ LoadSImmediate(S5, 1.0);
3059 __ LoadSImmediate(S6, 6.0); 3060 __ LoadSImmediate(S6, 6.0);
3060 __ LoadSImmediate(S7, 3.0); 3061 __ LoadSImmediate(S7, 3.0);
3061 3062
(...skipping 14 matching lines...) Expand all
3076 3077
3077 3078
3078 ASSEMBLER_TEST_RUN(Vminqs, test) { 3079 ASSEMBLER_TEST_RUN(Vminqs, test) {
3079 EXPECT(test != NULL); 3080 EXPECT(test != NULL);
3080 typedef int (*Tst)(); 3081 typedef int (*Tst)();
3081 EXPECT_EQ(8, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 3082 EXPECT_EQ(8, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
3082 } 3083 }
3083 3084
3084 3085
3085 ASSEMBLER_TEST_GENERATE(Vmaxqs, assembler) { 3086 ASSEMBLER_TEST_GENERATE(Vmaxqs, assembler) {
3086 if (CPUFeatures::neon_supported()) { 3087 if (TargetCPUFeatures::neon_supported()) {
3087 __ LoadSImmediate(S0, 1.0); 3088 __ LoadSImmediate(S0, 1.0);
3088 __ LoadSImmediate(S1, 2.0); 3089 __ LoadSImmediate(S1, 2.0);
3089 __ LoadSImmediate(S2, 3.0); 3090 __ LoadSImmediate(S2, 3.0);
3090 __ LoadSImmediate(S3, 4.0); 3091 __ LoadSImmediate(S3, 4.0);
3091 3092
3092 __ LoadSImmediate(S4, 2.0); 3093 __ LoadSImmediate(S4, 2.0);
3093 __ LoadSImmediate(S5, 1.0); 3094 __ LoadSImmediate(S5, 1.0);
3094 __ LoadSImmediate(S6, 6.0); 3095 __ LoadSImmediate(S6, 6.0);
3095 __ LoadSImmediate(S7, 3.0); 3096 __ LoadSImmediate(S7, 3.0);
3096 3097
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
3146 3147
3147 // result = sign : result_exp<7:0> : estimate<51:29> 3148 // result = sign : result_exp<7:0> : estimate<51:29>
3148 int32_t result_bits = 3149 int32_t result_bits =
3149 (a_bits & 0x80000000) | ((result_exp & 0xff) << 23) | 3150 (a_bits & 0x80000000) | ((result_exp & 0xff) << 23) |
3150 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff); 3151 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
3151 return bit_cast<float, int32_t>(result_bits); 3152 return bit_cast<float, int32_t>(result_bits);
3152 } 3153 }
3153 3154
3154 3155
3155 ASSEMBLER_TEST_GENERATE(Vrecpeqs, assembler) { 3156 ASSEMBLER_TEST_GENERATE(Vrecpeqs, assembler) {
3156 if (CPUFeatures::neon_supported()) { 3157 if (TargetCPUFeatures::neon_supported()) {
3157 __ LoadSImmediate(S4, 147.0); 3158 __ LoadSImmediate(S4, 147.0);
3158 __ vmovs(S5, S4); 3159 __ vmovs(S5, S4);
3159 __ vmovs(S6, S4); 3160 __ vmovs(S6, S4);
3160 __ vmovs(S7, S4); 3161 __ vmovs(S7, S4);
3161 3162
3162 __ vrecpeqs(Q0, Q1); 3163 __ vrecpeqs(Q0, Q1);
3163 3164
3164 __ bx(LR); 3165 __ bx(LR);
3165 } else { 3166 } else {
3166 __ LoadSImmediate(S0, arm_recip_estimate(147.0)); 3167 __ LoadSImmediate(S0, arm_recip_estimate(147.0));
3167 __ bx(LR); 3168 __ bx(LR);
3168 } 3169 }
3169 } 3170 }
3170 3171
3171 3172
3172 ASSEMBLER_TEST_RUN(Vrecpeqs, test) { 3173 ASSEMBLER_TEST_RUN(Vrecpeqs, test) {
3173 EXPECT(test != NULL); 3174 EXPECT(test != NULL);
3174 typedef float (*Vrecpeqs)(); 3175 typedef float (*Vrecpeqs)();
3175 float res = EXECUTE_TEST_CODE_FLOAT(Vrecpeqs, test->entry()); 3176 float res = EXECUTE_TEST_CODE_FLOAT(Vrecpeqs, test->entry());
3176 EXPECT_FLOAT_EQ(arm_recip_estimate(147.0), res, 0.0001f); 3177 EXPECT_FLOAT_EQ(arm_recip_estimate(147.0), res, 0.0001f);
3177 } 3178 }
3178 3179
3179 3180
3180 ASSEMBLER_TEST_GENERATE(Vrecpsqs, assembler) { 3181 ASSEMBLER_TEST_GENERATE(Vrecpsqs, assembler) {
3181 if (CPUFeatures::neon_supported()) { 3182 if (TargetCPUFeatures::neon_supported()) {
3182 __ LoadSImmediate(S4, 5.0); 3183 __ LoadSImmediate(S4, 5.0);
3183 __ LoadSImmediate(S5, 2.0); 3184 __ LoadSImmediate(S5, 2.0);
3184 __ LoadSImmediate(S6, 3.0); 3185 __ LoadSImmediate(S6, 3.0);
3185 __ LoadSImmediate(S7, 4.0); 3186 __ LoadSImmediate(S7, 4.0);
3186 3187
3187 __ LoadSImmediate(S8, 10.0); 3188 __ LoadSImmediate(S8, 10.0);
3188 __ LoadSImmediate(S9, 1.0); 3189 __ LoadSImmediate(S9, 1.0);
3189 __ LoadSImmediate(S10, 6.0); 3190 __ LoadSImmediate(S10, 6.0);
3190 __ LoadSImmediate(S11, 3.0); 3191 __ LoadSImmediate(S11, 3.0);
3191 3192
3192 __ vrecpsqs(Q0, Q1, Q2); 3193 __ vrecpsqs(Q0, Q1, Q2);
3193 3194
3194 __ bx(LR); 3195 __ bx(LR);
3195 } else { 3196 } else {
3196 __ LoadSImmediate(S0, 2.0 - 10.0 * 5.0); 3197 __ LoadSImmediate(S0, 2.0 - 10.0 * 5.0);
3197 __ bx(LR); 3198 __ bx(LR);
3198 } 3199 }
3199 } 3200 }
3200 3201
3201 3202
3202 ASSEMBLER_TEST_RUN(Vrecpsqs, test) { 3203 ASSEMBLER_TEST_RUN(Vrecpsqs, test) {
3203 EXPECT(test != NULL); 3204 EXPECT(test != NULL);
3204 typedef float (*Vrecpsqs)(); 3205 typedef float (*Vrecpsqs)();
3205 float res = EXECUTE_TEST_CODE_FLOAT(Vrecpsqs, test->entry()); 3206 float res = EXECUTE_TEST_CODE_FLOAT(Vrecpsqs, test->entry());
3206 EXPECT_FLOAT_EQ(2.0 - 10.0 * 5.0, res, 0.0001f); 3207 EXPECT_FLOAT_EQ(2.0 - 10.0 * 5.0, res, 0.0001f);
3207 } 3208 }
3208 3209
3209 3210
3210 ASSEMBLER_TEST_GENERATE(Reciprocal, assembler) { 3211 ASSEMBLER_TEST_GENERATE(Reciprocal, assembler) {
3211 if (CPUFeatures::neon_supported()) { 3212 if (TargetCPUFeatures::neon_supported()) {
3212 __ LoadSImmediate(S4, 147000.0); 3213 __ LoadSImmediate(S4, 147000.0);
3213 __ vmovs(S5, S4); 3214 __ vmovs(S5, S4);
3214 __ vmovs(S6, S4); 3215 __ vmovs(S6, S4);
3215 __ vmovs(S7, S4); 3216 __ vmovs(S7, S4);
3216 3217
3217 // Reciprocal estimate. 3218 // Reciprocal estimate.
3218 __ vrecpeqs(Q0, Q1); 3219 __ vrecpeqs(Q0, Q1);
3219 // 2 Newton-Raphson steps. 3220 // 2 Newton-Raphson steps.
3220 __ vrecpsqs(Q2, Q1, Q0); 3221 __ vrecpsqs(Q2, Q1, Q0);
3221 __ vmulqs(Q0, Q0, Q2); 3222 __ vmulqs(Q0, Q0, Q2);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0))); 3284 ASSERT((estimate >= 1.0) && (estimate <= (511.0/256.0)));
3284 3285
3285 // result = 0 : result_exp<7:0> : estimate<51:29> 3286 // result = 0 : result_exp<7:0> : estimate<51:29>
3286 int32_t result_bits = ((result_exp & 0xff) << 23) | 3287 int32_t result_bits = ((result_exp & 0xff) << 23) |
3287 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff); 3288 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
3288 return bit_cast<float, int32_t>(result_bits); 3289 return bit_cast<float, int32_t>(result_bits);
3289 } 3290 }
3290 3291
3291 3292
3292 ASSEMBLER_TEST_GENERATE(Vrsqrteqs, assembler) { 3293 ASSEMBLER_TEST_GENERATE(Vrsqrteqs, assembler) {
3293 if (CPUFeatures::neon_supported()) { 3294 if (TargetCPUFeatures::neon_supported()) {
3294 __ LoadSImmediate(S4, 147.0); 3295 __ LoadSImmediate(S4, 147.0);
3295 __ vmovs(S5, S4); 3296 __ vmovs(S5, S4);
3296 __ vmovs(S6, S4); 3297 __ vmovs(S6, S4);
3297 __ vmovs(S7, S4); 3298 __ vmovs(S7, S4);
3298 3299
3299 __ vrsqrteqs(Q0, Q1); 3300 __ vrsqrteqs(Q0, Q1);
3300 3301
3301 __ bx(LR); 3302 __ bx(LR);
3302 } else { 3303 } else {
3303 __ LoadSImmediate(S0, arm_reciprocal_sqrt_estimate(147.0)); 3304 __ LoadSImmediate(S0, arm_reciprocal_sqrt_estimate(147.0));
3304 __ bx(LR); 3305 __ bx(LR);
3305 } 3306 }
3306 } 3307 }
3307 3308
3308 3309
3309 ASSEMBLER_TEST_RUN(Vrsqrteqs, test) { 3310 ASSEMBLER_TEST_RUN(Vrsqrteqs, test) {
3310 EXPECT(test != NULL); 3311 EXPECT(test != NULL);
3311 typedef float (*Vrsqrteqs)(); 3312 typedef float (*Vrsqrteqs)();
3312 float res = EXECUTE_TEST_CODE_FLOAT(Vrsqrteqs, test->entry()); 3313 float res = EXECUTE_TEST_CODE_FLOAT(Vrsqrteqs, test->entry());
3313 EXPECT_FLOAT_EQ(arm_reciprocal_sqrt_estimate(147.0), res, 0.0001f); 3314 EXPECT_FLOAT_EQ(arm_reciprocal_sqrt_estimate(147.0), res, 0.0001f);
3314 } 3315 }
3315 3316
3316 3317
3317 ASSEMBLER_TEST_GENERATE(Vrsqrtsqs, assembler) { 3318 ASSEMBLER_TEST_GENERATE(Vrsqrtsqs, assembler) {
3318 if (CPUFeatures::neon_supported()) { 3319 if (TargetCPUFeatures::neon_supported()) {
3319 __ LoadSImmediate(S4, 5.0); 3320 __ LoadSImmediate(S4, 5.0);
3320 __ LoadSImmediate(S5, 2.0); 3321 __ LoadSImmediate(S5, 2.0);
3321 __ LoadSImmediate(S6, 3.0); 3322 __ LoadSImmediate(S6, 3.0);
3322 __ LoadSImmediate(S7, 4.0); 3323 __ LoadSImmediate(S7, 4.0);
3323 3324
3324 __ LoadSImmediate(S8, 10.0); 3325 __ LoadSImmediate(S8, 10.0);
3325 __ LoadSImmediate(S9, 1.0); 3326 __ LoadSImmediate(S9, 1.0);
3326 __ LoadSImmediate(S10, 6.0); 3327 __ LoadSImmediate(S10, 6.0);
3327 __ LoadSImmediate(S11, 3.0); 3328 __ LoadSImmediate(S11, 3.0);
3328 3329
3329 __ vrsqrtsqs(Q0, Q1, Q2); 3330 __ vrsqrtsqs(Q0, Q1, Q2);
3330 3331
3331 __ bx(LR); 3332 __ bx(LR);
3332 } else { 3333 } else {
3333 __ LoadSImmediate(S0, (3.0 - 10.0 * 5.0) / 2.0); 3334 __ LoadSImmediate(S0, (3.0 - 10.0 * 5.0) / 2.0);
3334 __ bx(LR); 3335 __ bx(LR);
3335 } 3336 }
3336 } 3337 }
3337 3338
3338 3339
3339 ASSEMBLER_TEST_RUN(Vrsqrtsqs, test) { 3340 ASSEMBLER_TEST_RUN(Vrsqrtsqs, test) {
3340 EXPECT(test != NULL); 3341 EXPECT(test != NULL);
3341 typedef float (*Vrsqrtsqs)(); 3342 typedef float (*Vrsqrtsqs)();
3342 float res = EXECUTE_TEST_CODE_FLOAT(Vrsqrtsqs, test->entry()); 3343 float res = EXECUTE_TEST_CODE_FLOAT(Vrsqrtsqs, test->entry());
3343 EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0)/2.0, res, 0.0001f); 3344 EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0)/2.0, res, 0.0001f);
3344 } 3345 }
3345 3346
3346 3347
3347 ASSEMBLER_TEST_GENERATE(ReciprocalSqrt, assembler) { 3348 ASSEMBLER_TEST_GENERATE(ReciprocalSqrt, assembler) {
3348 if (CPUFeatures::neon_supported()) { 3349 if (TargetCPUFeatures::neon_supported()) {
3349 __ LoadSImmediate(S4, 147000.0); 3350 __ LoadSImmediate(S4, 147000.0);
3350 __ vmovs(S5, S4); 3351 __ vmovs(S5, S4);
3351 __ vmovs(S6, S4); 3352 __ vmovs(S6, S4);
3352 __ vmovs(S7, S4); 3353 __ vmovs(S7, S4);
3353 3354
3354 // Reciprocal square root estimate. 3355 // Reciprocal square root estimate.
3355 __ vrsqrteqs(Q0, Q1); 3356 __ vrsqrteqs(Q0, Q1);
3356 // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2. 3357 // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2.
3357 // First step. 3358 // First step.
3358 __ vmulqs(Q2, Q0, Q0); // Q2 <- xn^2 3359 __ vmulqs(Q2, Q0, Q0); // Q2 <- xn^2
(...skipping 14 matching lines...) Expand all
3373 3374
3374 ASSEMBLER_TEST_RUN(ReciprocalSqrt, test) { 3375 ASSEMBLER_TEST_RUN(ReciprocalSqrt, test) {
3375 EXPECT(test != NULL); 3376 EXPECT(test != NULL);
3376 typedef float (*ReciprocalSqrt)(); 3377 typedef float (*ReciprocalSqrt)();
3377 float res = EXECUTE_TEST_CODE_FLOAT(ReciprocalSqrt, test->entry()); 3378 float res = EXECUTE_TEST_CODE_FLOAT(ReciprocalSqrt, test->entry());
3378 EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001f); 3379 EXPECT_FLOAT_EQ(1.0/sqrt(147000.0), res, 0.0001f);
3379 } 3380 }
3380 3381
3381 3382
3382 ASSEMBLER_TEST_GENERATE(SIMDSqrt, assembler) { 3383 ASSEMBLER_TEST_GENERATE(SIMDSqrt, assembler) {
3383 if (CPUFeatures::neon_supported()) { 3384 if (TargetCPUFeatures::neon_supported()) {
3384 __ LoadSImmediate(S4, 147000.0); 3385 __ LoadSImmediate(S4, 147000.0);
3385 __ vmovs(S5, S4); 3386 __ vmovs(S5, S4);
3386 __ vmovs(S6, S4); 3387 __ vmovs(S6, S4);
3387 __ vmovs(S7, S4); 3388 __ vmovs(S7, S4);
3388 3389
3389 // Reciprocal square root estimate. 3390 // Reciprocal square root estimate.
3390 __ vrsqrteqs(Q0, Q1); 3391 __ vrsqrteqs(Q0, Q1);
3391 // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2. 3392 // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2.
3392 // First step. 3393 // First step.
3393 __ vmulqs(Q2, Q0, Q0); // Q2 <- xn^2 3394 __ vmulqs(Q2, Q0, Q0); // Q2 <- xn^2
(...skipping 24 matching lines...) Expand all
3418 3419
3419 ASSEMBLER_TEST_RUN(SIMDSqrt, test) { 3420 ASSEMBLER_TEST_RUN(SIMDSqrt, test) {
3420 EXPECT(test != NULL); 3421 EXPECT(test != NULL);
3421 typedef float (*SIMDSqrt)(); 3422 typedef float (*SIMDSqrt)();
3422 float res = EXECUTE_TEST_CODE_FLOAT(SIMDSqrt, test->entry()); 3423 float res = EXECUTE_TEST_CODE_FLOAT(SIMDSqrt, test->entry());
3423 EXPECT_FLOAT_EQ(sqrt(147000.0), res, 0.0001f); 3424 EXPECT_FLOAT_EQ(sqrt(147000.0), res, 0.0001f);
3424 } 3425 }
3425 3426
3426 3427
3427 ASSEMBLER_TEST_GENERATE(SIMDSqrt2, assembler) { 3428 ASSEMBLER_TEST_GENERATE(SIMDSqrt2, assembler) {
3428 if (CPUFeatures::neon_supported()) { 3429 if (TargetCPUFeatures::neon_supported()) {
3429 __ LoadSImmediate(S4, 1.0); 3430 __ LoadSImmediate(S4, 1.0);
3430 __ LoadSImmediate(S5, 4.0); 3431 __ LoadSImmediate(S5, 4.0);
3431 __ LoadSImmediate(S6, 9.0); 3432 __ LoadSImmediate(S6, 9.0);
3432 __ LoadSImmediate(S7, 16.0); 3433 __ LoadSImmediate(S7, 16.0);
3433 3434
3434 // Reciprocal square root estimate. 3435 // Reciprocal square root estimate.
3435 __ vrsqrteqs(Q0, Q1); 3436 __ vrsqrteqs(Q0, Q1);
3436 // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2. 3437 // 2 Newton-Raphson steps. xn+1 = xn * (3 - Q1*xn^2) / 2.
3437 // First step. 3438 // First step.
3438 __ vmulqs(Q2, Q0, Q0); // Q2 <- xn^2 3439 __ vmulqs(Q2, Q0, Q0); // Q2 <- xn^2
(...skipping 28 matching lines...) Expand all
3467 3468
3468 ASSEMBLER_TEST_RUN(SIMDSqrt2, test) { 3469 ASSEMBLER_TEST_RUN(SIMDSqrt2, test) {
3469 EXPECT(test != NULL); 3470 EXPECT(test != NULL);
3470 typedef float (*SIMDSqrt2)(); 3471 typedef float (*SIMDSqrt2)();
3471 float res = EXECUTE_TEST_CODE_FLOAT(SIMDSqrt2, test->entry()); 3472 float res = EXECUTE_TEST_CODE_FLOAT(SIMDSqrt2, test->entry());
3472 EXPECT_FLOAT_EQ(10.0, res, 0.0001f); 3473 EXPECT_FLOAT_EQ(10.0, res, 0.0001f);
3473 } 3474 }
3474 3475
3475 3476
3476 ASSEMBLER_TEST_GENERATE(SIMDDiv, assembler) { 3477 ASSEMBLER_TEST_GENERATE(SIMDDiv, assembler) {
3477 if (CPUFeatures::neon_supported()) { 3478 if (TargetCPUFeatures::neon_supported()) {
3478 __ LoadSImmediate(S4, 1.0); 3479 __ LoadSImmediate(S4, 1.0);
3479 __ LoadSImmediate(S5, 4.0); 3480 __ LoadSImmediate(S5, 4.0);
3480 __ LoadSImmediate(S6, 9.0); 3481 __ LoadSImmediate(S6, 9.0);
3481 __ LoadSImmediate(S7, 16.0); 3482 __ LoadSImmediate(S7, 16.0);
3482 3483
3483 __ LoadSImmediate(S12, 4.0); 3484 __ LoadSImmediate(S12, 4.0);
3484 __ LoadSImmediate(S13, 16.0); 3485 __ LoadSImmediate(S13, 16.0);
3485 __ LoadSImmediate(S14, 36.0); 3486 __ LoadSImmediate(S14, 36.0);
3486 __ LoadSImmediate(S15, 64.0); 3487 __ LoadSImmediate(S15, 64.0);
3487 3488
(...skipping 20 matching lines...) Expand all
3508 3509
3509 ASSEMBLER_TEST_RUN(SIMDDiv, test) { 3510 ASSEMBLER_TEST_RUN(SIMDDiv, test) {
3510 EXPECT(test != NULL); 3511 EXPECT(test != NULL);
3511 typedef float (*SIMDDiv)(); 3512 typedef float (*SIMDDiv)();
3512 float res = EXECUTE_TEST_CODE_FLOAT(SIMDDiv, test->entry()); 3513 float res = EXECUTE_TEST_CODE_FLOAT(SIMDDiv, test->entry());
3513 EXPECT_FLOAT_EQ(16.0, res, 0.0001f); 3514 EXPECT_FLOAT_EQ(16.0, res, 0.0001f);
3514 } 3515 }
3515 3516
3516 3517
3517 ASSEMBLER_TEST_GENERATE(Vabsqs, assembler) { 3518 ASSEMBLER_TEST_GENERATE(Vabsqs, assembler) {
3518 if (CPUFeatures::neon_supported()) { 3519 if (TargetCPUFeatures::neon_supported()) {
3519 __ LoadSImmediate(S4, 1.0); 3520 __ LoadSImmediate(S4, 1.0);
3520 __ LoadSImmediate(S5, -1.0); 3521 __ LoadSImmediate(S5, -1.0);
3521 __ LoadSImmediate(S6, 1.0); 3522 __ LoadSImmediate(S6, 1.0);
3522 __ LoadSImmediate(S7, -1.0); 3523 __ LoadSImmediate(S7, -1.0);
3523 3524
3524 __ vabsqs(Q0, Q1); 3525 __ vabsqs(Q0, Q1);
3525 3526
3526 __ vadds(S0, S0, S1); 3527 __ vadds(S0, S0, S1);
3527 __ vadds(S0, S0, S2); 3528 __ vadds(S0, S0, S2);
3528 __ vadds(S0, S0, S3); 3529 __ vadds(S0, S0, S3);
3529 3530
3530 __ bx(LR); 3531 __ bx(LR);
3531 } else { 3532 } else {
3532 __ LoadSImmediate(S0, 4.0); 3533 __ LoadSImmediate(S0, 4.0);
3533 __ bx(LR); 3534 __ bx(LR);
3534 } 3535 }
3535 } 3536 }
3536 3537
3537 3538
3538 ASSEMBLER_TEST_RUN(Vabsqs, test) { 3539 ASSEMBLER_TEST_RUN(Vabsqs, test) {
3539 EXPECT(test != NULL); 3540 EXPECT(test != NULL);
3540 typedef float (*Vabsqs)(); 3541 typedef float (*Vabsqs)();
3541 float res = EXECUTE_TEST_CODE_FLOAT(Vabsqs, test->entry()); 3542 float res = EXECUTE_TEST_CODE_FLOAT(Vabsqs, test->entry());
3542 EXPECT_FLOAT_EQ(4.0, res, 0.0001f); 3543 EXPECT_FLOAT_EQ(4.0, res, 0.0001f);
3543 } 3544 }
3544 3545
3545 3546
3546 ASSEMBLER_TEST_GENERATE(Vnegqs, assembler) { 3547 ASSEMBLER_TEST_GENERATE(Vnegqs, assembler) {
3547 if (CPUFeatures::neon_supported()) { 3548 if (TargetCPUFeatures::neon_supported()) {
3548 __ LoadSImmediate(S4, 1.0); 3549 __ LoadSImmediate(S4, 1.0);
3549 __ LoadSImmediate(S5, -2.0); 3550 __ LoadSImmediate(S5, -2.0);
3550 __ LoadSImmediate(S6, 1.0); 3551 __ LoadSImmediate(S6, 1.0);
3551 __ LoadSImmediate(S7, -2.0); 3552 __ LoadSImmediate(S7, -2.0);
3552 3553
3553 __ vnegqs(Q0, Q1); 3554 __ vnegqs(Q0, Q1);
3554 3555
3555 __ vadds(S0, S0, S1); 3556 __ vadds(S0, S0, S1);
3556 __ vadds(S0, S0, S2); 3557 __ vadds(S0, S0, S2);
3557 __ vadds(S0, S0, S3); 3558 __ vadds(S0, S0, S3);
(...skipping 25 matching lines...) Expand all
3583 __ StoreIntoObject(R2, 3584 __ StoreIntoObject(R2,
3584 FieldAddress(R2, GrowableObjectArray::data_offset()), 3585 FieldAddress(R2, GrowableObjectArray::data_offset()),
3585 R1); 3586 R1);
3586 __ PopList((1 << CTX) | (1 << LR)); 3587 __ PopList((1 << CTX) | (1 << LR));
3587 __ Ret(); 3588 __ Ret();
3588 } 3589 }
3589 3590
3590 } // namespace dart 3591 } // namespace dart
3591 3592
3592 #endif // defined TARGET_ARCH_ARM 3593 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698