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/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/assembler-inl.h" | 8 #include "src/assembler-inl.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 break; | 1542 break; |
1543 } | 1543 } |
1544 case kArmFloat32x4Abs: { | 1544 case kArmFloat32x4Abs: { |
1545 __ vabs(i.OutputSimd128Register(), i.InputSimd128Register(0)); | 1545 __ vabs(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
1546 break; | 1546 break; |
1547 } | 1547 } |
1548 case kArmFloat32x4Neg: { | 1548 case kArmFloat32x4Neg: { |
1549 __ vneg(i.OutputSimd128Register(), i.InputSimd128Register(0)); | 1549 __ vneg(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
1550 break; | 1550 break; |
1551 } | 1551 } |
| 1552 case kArmFloat32x4RecipApprox: { |
| 1553 __ vrecpe(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
| 1554 break; |
| 1555 } |
| 1556 case kArmFloat32x4RecipSqrtApprox: { |
| 1557 __ vrsqrte(i.OutputSimd128Register(), i.InputSimd128Register(0)); |
| 1558 break; |
| 1559 } |
1552 case kArmFloat32x4Add: { | 1560 case kArmFloat32x4Add: { |
1553 __ vadd(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1561 __ vadd(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1554 i.InputSimd128Register(1)); | 1562 i.InputSimd128Register(1)); |
1555 break; | 1563 break; |
1556 } | 1564 } |
1557 case kArmFloat32x4Sub: { | 1565 case kArmFloat32x4Sub: { |
1558 __ vsub(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1566 __ vsub(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1559 i.InputSimd128Register(1)); | 1567 i.InputSimd128Register(1)); |
1560 break; | 1568 break; |
1561 } | 1569 } |
| 1570 case kArmFloat32x4Mul: { |
| 1571 __ vmul(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1572 i.InputSimd128Register(1)); |
| 1573 break; |
| 1574 } |
| 1575 case kArmFloat32x4Min: { |
| 1576 __ vmin(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1577 i.InputSimd128Register(1)); |
| 1578 break; |
| 1579 } |
| 1580 case kArmFloat32x4Max: { |
| 1581 __ vmax(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1582 i.InputSimd128Register(1)); |
| 1583 break; |
| 1584 } |
| 1585 case kArmFloat32x4RecipRefine: { |
| 1586 __ vrecps(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1587 i.InputSimd128Register(1)); |
| 1588 break; |
| 1589 } |
| 1590 case kArmFloat32x4RecipSqrtRefine: { |
| 1591 __ vrsqrts(i.OutputSimd128Register(), i.InputSimd128Register(0), |
| 1592 i.InputSimd128Register(1)); |
| 1593 break; |
| 1594 } |
1562 case kArmFloat32x4Equal: { | 1595 case kArmFloat32x4Equal: { |
1563 __ vceq(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1596 __ vceq(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1564 i.InputSimd128Register(1)); | 1597 i.InputSimd128Register(1)); |
1565 break; | 1598 break; |
1566 } | 1599 } |
1567 case kArmFloat32x4NotEqual: { | 1600 case kArmFloat32x4NotEqual: { |
1568 Simd128Register dst = i.OutputSimd128Register(); | 1601 Simd128Register dst = i.OutputSimd128Register(); |
1569 __ vceq(dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); | 1602 __ vceq(dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); |
1570 __ vmvn(dst, dst); | 1603 __ vmvn(dst, dst); |
1571 break; | 1604 break; |
1572 } | 1605 } |
| 1606 case kArmFloat32x4LessThan: { |
| 1607 __ vcgt(i.OutputSimd128Register(), i.InputSimd128Register(1), |
| 1608 i.InputSimd128Register(0)); |
| 1609 break; |
| 1610 } |
| 1611 case kArmFloat32x4LessThanOrEqual: { |
| 1612 __ vcge(i.OutputSimd128Register(), i.InputSimd128Register(1), |
| 1613 i.InputSimd128Register(0)); |
| 1614 break; |
| 1615 } |
1573 case kArmInt32x4Splat: { | 1616 case kArmInt32x4Splat: { |
1574 __ vdup(Neon32, i.OutputSimd128Register(), i.InputRegister(0)); | 1617 __ vdup(Neon32, i.OutputSimd128Register(), i.InputRegister(0)); |
1575 break; | 1618 break; |
1576 } | 1619 } |
1577 case kArmInt32x4ExtractLane: { | 1620 case kArmInt32x4ExtractLane: { |
1578 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS32, | 1621 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS32, |
1579 i.InputInt8(1)); | 1622 i.InputInt8(1)); |
1580 break; | 1623 break; |
1581 } | 1624 } |
1582 case kArmInt32x4ReplaceLane: { | 1625 case kArmInt32x4ReplaceLane: { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 i.InputSimd128Register(1)); | 1679 i.InputSimd128Register(1)); |
1637 break; | 1680 break; |
1638 } | 1681 } |
1639 case kArmInt32x4NotEqual: { | 1682 case kArmInt32x4NotEqual: { |
1640 Simd128Register dst = i.OutputSimd128Register(); | 1683 Simd128Register dst = i.OutputSimd128Register(); |
1641 __ vceq(Neon32, dst, i.InputSimd128Register(0), | 1684 __ vceq(Neon32, dst, i.InputSimd128Register(0), |
1642 i.InputSimd128Register(1)); | 1685 i.InputSimd128Register(1)); |
1643 __ vmvn(dst, dst); | 1686 __ vmvn(dst, dst); |
1644 break; | 1687 break; |
1645 } | 1688 } |
1646 case kArmInt32x4GreaterThan: { | 1689 case kArmInt32x4LessThan: { |
1647 __ vcgt(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1690 __ vcgt(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1648 i.InputSimd128Register(1)); | 1691 i.InputSimd128Register(0)); |
1649 break; | 1692 break; |
1650 } | 1693 } |
1651 case kArmInt32x4GreaterThanOrEqual: { | 1694 case kArmInt32x4LessThanOrEqual: { |
1652 __ vcge(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1695 __ vcge(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1653 i.InputSimd128Register(1)); | 1696 i.InputSimd128Register(0)); |
1654 break; | 1697 break; |
1655 } | 1698 } |
1656 case kArmUint32x4ShiftRightByScalar: { | 1699 case kArmUint32x4ShiftRightByScalar: { |
1657 __ vshr(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1700 __ vshr(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1658 i.InputInt5(1)); | 1701 i.InputInt5(1)); |
1659 break; | 1702 break; |
1660 } | 1703 } |
1661 case kArmUint32x4Min: { | 1704 case kArmUint32x4Min: { |
1662 __ vmin(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1705 __ vmin(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1663 i.InputSimd128Register(1)); | 1706 i.InputSimd128Register(1)); |
1664 break; | 1707 break; |
1665 } | 1708 } |
1666 case kArmUint32x4Max: { | 1709 case kArmUint32x4Max: { |
1667 __ vmax(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1710 __ vmax(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1668 i.InputSimd128Register(1)); | 1711 i.InputSimd128Register(1)); |
1669 break; | 1712 break; |
1670 } | 1713 } |
1671 case kArmUint32x4GreaterThan: { | 1714 case kArmUint32x4LessThan: { |
1672 __ vcgt(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1715 __ vcgt(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1673 i.InputSimd128Register(1)); | 1716 i.InputSimd128Register(0)); |
1674 break; | 1717 break; |
1675 } | 1718 } |
1676 case kArmUint32x4GreaterThanOrEqual: { | 1719 case kArmUint32x4LessThanOrEqual: { |
1677 __ vcge(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1720 __ vcge(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1678 i.InputSimd128Register(1)); | 1721 i.InputSimd128Register(0)); |
1679 break; | 1722 break; |
1680 } | 1723 } |
1681 case kArmInt16x8Splat: { | 1724 case kArmInt16x8Splat: { |
1682 __ vdup(Neon16, i.OutputSimd128Register(), i.InputRegister(0)); | 1725 __ vdup(Neon16, i.OutputSimd128Register(), i.InputRegister(0)); |
1683 break; | 1726 break; |
1684 } | 1727 } |
1685 case kArmInt16x8ExtractLane: { | 1728 case kArmInt16x8ExtractLane: { |
1686 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS16, | 1729 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS16, |
1687 i.InputInt8(1)); | 1730 i.InputInt8(1)); |
1688 break; | 1731 break; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 i.InputSimd128Register(1)); | 1789 i.InputSimd128Register(1)); |
1747 break; | 1790 break; |
1748 } | 1791 } |
1749 case kArmInt16x8NotEqual: { | 1792 case kArmInt16x8NotEqual: { |
1750 Simd128Register dst = i.OutputSimd128Register(); | 1793 Simd128Register dst = i.OutputSimd128Register(); |
1751 __ vceq(Neon16, dst, i.InputSimd128Register(0), | 1794 __ vceq(Neon16, dst, i.InputSimd128Register(0), |
1752 i.InputSimd128Register(1)); | 1795 i.InputSimd128Register(1)); |
1753 __ vmvn(dst, dst); | 1796 __ vmvn(dst, dst); |
1754 break; | 1797 break; |
1755 } | 1798 } |
1756 case kArmInt16x8GreaterThan: { | 1799 case kArmInt16x8LessThan: { |
1757 __ vcgt(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1800 __ vcgt(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1758 i.InputSimd128Register(1)); | 1801 i.InputSimd128Register(0)); |
1759 break; | 1802 break; |
1760 } | 1803 } |
1761 case kArmInt16x8GreaterThanOrEqual: { | 1804 case kArmInt16x8LessThanOrEqual: { |
1762 __ vcge(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1805 __ vcge(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1763 i.InputSimd128Register(1)); | 1806 i.InputSimd128Register(0)); |
1764 break; | 1807 break; |
1765 } | 1808 } |
1766 case kArmUint16x8ShiftRightByScalar: { | 1809 case kArmUint16x8ShiftRightByScalar: { |
1767 __ vshr(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1810 __ vshr(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1768 i.InputInt4(1)); | 1811 i.InputInt4(1)); |
1769 break; | 1812 break; |
1770 } | 1813 } |
1771 case kArmUint16x8AddSaturate: { | 1814 case kArmUint16x8AddSaturate: { |
1772 __ vqadd(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1815 __ vqadd(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1773 i.InputSimd128Register(1)); | 1816 i.InputSimd128Register(1)); |
1774 break; | 1817 break; |
1775 } | 1818 } |
1776 case kArmUint16x8SubSaturate: { | 1819 case kArmUint16x8SubSaturate: { |
1777 __ vqsub(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1820 __ vqsub(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1778 i.InputSimd128Register(1)); | 1821 i.InputSimd128Register(1)); |
1779 break; | 1822 break; |
1780 } | 1823 } |
1781 case kArmUint16x8Min: { | 1824 case kArmUint16x8Min: { |
1782 __ vmin(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1825 __ vmin(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1783 i.InputSimd128Register(1)); | 1826 i.InputSimd128Register(1)); |
1784 break; | 1827 break; |
1785 } | 1828 } |
1786 case kArmUint16x8Max: { | 1829 case kArmUint16x8Max: { |
1787 __ vmax(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1830 __ vmax(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1788 i.InputSimd128Register(1)); | 1831 i.InputSimd128Register(1)); |
1789 break; | 1832 break; |
1790 } | 1833 } |
1791 case kArmUint16x8GreaterThan: { | 1834 case kArmUint16x8LessThan: { |
1792 __ vcgt(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1835 __ vcgt(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1793 i.InputSimd128Register(1)); | 1836 i.InputSimd128Register(0)); |
1794 break; | 1837 break; |
1795 } | 1838 } |
1796 case kArmUint16x8GreaterThanOrEqual: { | 1839 case kArmUint16x8LessThanOrEqual: { |
1797 __ vcge(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1840 __ vcge(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1798 i.InputSimd128Register(1)); | 1841 i.InputSimd128Register(0)); |
1799 break; | 1842 break; |
1800 } | 1843 } |
1801 case kArmInt8x16Splat: { | 1844 case kArmInt8x16Splat: { |
1802 __ vdup(Neon8, i.OutputSimd128Register(), i.InputRegister(0)); | 1845 __ vdup(Neon8, i.OutputSimd128Register(), i.InputRegister(0)); |
1803 break; | 1846 break; |
1804 } | 1847 } |
1805 case kArmInt8x16ExtractLane: { | 1848 case kArmInt8x16ExtractLane: { |
1806 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS8, | 1849 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS8, |
1807 i.InputInt8(1)); | 1850 i.InputInt8(1)); |
1808 break; | 1851 break; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 __ vceq(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1908 __ vceq(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1866 i.InputSimd128Register(1)); | 1909 i.InputSimd128Register(1)); |
1867 break; | 1910 break; |
1868 } | 1911 } |
1869 case kArmInt8x16NotEqual: { | 1912 case kArmInt8x16NotEqual: { |
1870 Simd128Register dst = i.OutputSimd128Register(); | 1913 Simd128Register dst = i.OutputSimd128Register(); |
1871 __ vceq(Neon8, dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); | 1914 __ vceq(Neon8, dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); |
1872 __ vmvn(dst, dst); | 1915 __ vmvn(dst, dst); |
1873 break; | 1916 break; |
1874 } | 1917 } |
1875 case kArmInt8x16GreaterThan: { | 1918 case kArmInt8x16LessThan: { |
1876 __ vcgt(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1919 __ vcgt(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1877 i.InputSimd128Register(1)); | 1920 i.InputSimd128Register(0)); |
1878 break; | 1921 break; |
1879 } | 1922 } |
1880 case kArmInt8x16GreaterThanOrEqual: { | 1923 case kArmInt8x16LessThanOrEqual: { |
1881 __ vcge(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1924 __ vcge(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1882 i.InputSimd128Register(1)); | 1925 i.InputSimd128Register(0)); |
1883 break; | 1926 break; |
1884 } | 1927 } |
1885 case kArmUint8x16ShiftRightByScalar: { | 1928 case kArmUint8x16ShiftRightByScalar: { |
1886 __ vshr(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1929 __ vshr(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1887 i.InputInt3(1)); | 1930 i.InputInt3(1)); |
1888 break; | 1931 break; |
1889 } | 1932 } |
1890 case kArmUint8x16AddSaturate: { | 1933 case kArmUint8x16AddSaturate: { |
1891 __ vqadd(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1934 __ vqadd(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1892 i.InputSimd128Register(1)); | 1935 i.InputSimd128Register(1)); |
1893 break; | 1936 break; |
1894 } | 1937 } |
1895 case kArmUint8x16SubSaturate: { | 1938 case kArmUint8x16SubSaturate: { |
1896 __ vqsub(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1939 __ vqsub(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1897 i.InputSimd128Register(1)); | 1940 i.InputSimd128Register(1)); |
1898 break; | 1941 break; |
1899 } | 1942 } |
1900 case kArmUint8x16Min: { | 1943 case kArmUint8x16Min: { |
1901 __ vmin(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1944 __ vmin(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1902 i.InputSimd128Register(1)); | 1945 i.InputSimd128Register(1)); |
1903 break; | 1946 break; |
1904 } | 1947 } |
1905 case kArmUint8x16Max: { | 1948 case kArmUint8x16Max: { |
1906 __ vmax(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1949 __ vmax(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), |
1907 i.InputSimd128Register(1)); | 1950 i.InputSimd128Register(1)); |
1908 break; | 1951 break; |
1909 } | 1952 } |
1910 case kArmUint8x16GreaterThan: { | 1953 case kArmUint8x16LessThan: { |
1911 __ vcgt(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1954 __ vcgt(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1912 i.InputSimd128Register(1)); | 1955 i.InputSimd128Register(0)); |
1913 break; | 1956 break; |
1914 } | 1957 } |
1915 case kArmUint8x16GreaterThanOrEqual: { | 1958 case kArmUint8x16LessThanOrEqual: { |
1916 __ vcge(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), | 1959 __ vcge(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(1), |
1917 i.InputSimd128Register(1)); | 1960 i.InputSimd128Register(0)); |
1918 break; | 1961 break; |
1919 } | 1962 } |
1920 case kArmSimd128Zero: { | 1963 case kArmSimd128Zero: { |
1921 __ veor(i.OutputSimd128Register(), i.OutputSimd128Register(), | 1964 __ veor(i.OutputSimd128Register(), i.OutputSimd128Register(), |
1922 i.OutputSimd128Register()); | 1965 i.OutputSimd128Register()); |
1923 break; | 1966 break; |
1924 } | 1967 } |
1925 case kArmSimd128And: { | 1968 case kArmSimd128And: { |
1926 __ vand(i.OutputSimd128Register(), i.InputSimd128Register(0), | 1969 __ vand(i.OutputSimd128Register(), i.InputSimd128Register(0), |
1927 i.InputSimd128Register(1)); | 1970 i.InputSimd128Register(1)); |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2684 padding_size -= v8::internal::Assembler::kInstrSize; | 2727 padding_size -= v8::internal::Assembler::kInstrSize; |
2685 } | 2728 } |
2686 } | 2729 } |
2687 } | 2730 } |
2688 | 2731 |
2689 #undef __ | 2732 #undef __ |
2690 | 2733 |
2691 } // namespace compiler | 2734 } // namespace compiler |
2692 } // namespace internal | 2735 } // namespace internal |
2693 } // namespace v8 | 2736 } // namespace v8 |
OLD | NEW |