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

Side by Side Diff: src/compiler/arm/code-generator-arm.cc

Issue 2800523002: [WASM SIMD] Implement packing and unpacking integer conversions. (Closed)
Patch Set: Remove extraneous fn signature. Created 3 years, 8 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
« no previous file with comments | « no previous file | src/compiler/arm/instruction-codes-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 } 1661 }
1662 case kArmI32x4ReplaceLane: { 1662 case kArmI32x4ReplaceLane: {
1663 __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0), 1663 __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0),
1664 i.InputRegister(2), NeonS32, i.InputInt8(1)); 1664 i.InputRegister(2), NeonS32, i.InputInt8(1));
1665 break; 1665 break;
1666 } 1666 }
1667 case kArmI32x4SConvertF32x4: { 1667 case kArmI32x4SConvertF32x4: {
1668 __ vcvt_s32_f32(i.OutputSimd128Register(), i.InputSimd128Register(0)); 1668 __ vcvt_s32_f32(i.OutputSimd128Register(), i.InputSimd128Register(0));
1669 break; 1669 break;
1670 } 1670 }
1671 case kArmI32x4SConvertI16x8Low: {
1672 __ vmovl(NeonS16, i.OutputSimd128Register(),
1673 i.InputSimd128Register(0).low());
1674 break;
1675 }
1676 case kArmI32x4SConvertI16x8High: {
1677 __ vmovl(NeonS16, i.OutputSimd128Register(),
1678 i.InputSimd128Register(0).high());
1679 break;
1680 }
1671 case kArmI32x4Neg: { 1681 case kArmI32x4Neg: {
1672 __ vneg(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0)); 1682 __ vneg(Neon32, i.OutputSimd128Register(), i.InputSimd128Register(0));
1673 break; 1683 break;
1674 } 1684 }
1675 case kArmI32x4Shl: { 1685 case kArmI32x4Shl: {
1676 __ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1686 __ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1677 i.InputInt5(1)); 1687 i.InputInt5(1));
1678 break; 1688 break;
1679 } 1689 }
1680 case kArmI32x4ShrS: { 1690 case kArmI32x4ShrS: {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 } 1736 }
1727 case kArmI32x4LeS: { 1737 case kArmI32x4LeS: {
1728 __ vcge(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(1), 1738 __ vcge(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(1),
1729 i.InputSimd128Register(0)); 1739 i.InputSimd128Register(0));
1730 break; 1740 break;
1731 } 1741 }
1732 case kArmI32x4UConvertF32x4: { 1742 case kArmI32x4UConvertF32x4: {
1733 __ vcvt_u32_f32(i.OutputSimd128Register(), i.InputSimd128Register(0)); 1743 __ vcvt_u32_f32(i.OutputSimd128Register(), i.InputSimd128Register(0));
1734 break; 1744 break;
1735 } 1745 }
1746 case kArmI32x4UConvertI16x8Low: {
1747 __ vmovl(NeonU16, i.OutputSimd128Register(),
1748 i.InputSimd128Register(0).low());
1749 break;
1750 }
1751 case kArmI32x4UConvertI16x8High: {
1752 __ vmovl(NeonU16, i.OutputSimd128Register(),
1753 i.InputSimd128Register(0).high());
1754 break;
1755 }
1736 case kArmI32x4ShrU: { 1756 case kArmI32x4ShrU: {
1737 __ vshr(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1757 __ vshr(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1738 i.InputInt5(1)); 1758 i.InputInt5(1));
1739 break; 1759 break;
1740 } 1760 }
1741 case kArmI32x4MinU: { 1761 case kArmI32x4MinU: {
1742 __ vmin(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1762 __ vmin(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1743 i.InputSimd128Register(1)); 1763 i.InputSimd128Register(1));
1744 break; 1764 break;
1745 } 1765 }
(...skipping 19 matching lines...) Expand all
1765 case kArmI16x8ExtractLane: { 1785 case kArmI16x8ExtractLane: {
1766 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS16, 1786 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS16,
1767 i.InputInt8(1)); 1787 i.InputInt8(1));
1768 break; 1788 break;
1769 } 1789 }
1770 case kArmI16x8ReplaceLane: { 1790 case kArmI16x8ReplaceLane: {
1771 __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0), 1791 __ ReplaceLane(i.OutputSimd128Register(), i.InputSimd128Register(0),
1772 i.InputRegister(2), NeonS16, i.InputInt8(1)); 1792 i.InputRegister(2), NeonS16, i.InputInt8(1));
1773 break; 1793 break;
1774 } 1794 }
1795 case kArmI16x8SConvertI8x16Low: {
1796 __ vmovl(NeonS8, i.OutputSimd128Register(),
1797 i.InputSimd128Register(0).low());
1798 break;
1799 }
1800 case kArmI16x8SConvertI8x16High: {
1801 __ vmovl(NeonS8, i.OutputSimd128Register(),
1802 i.InputSimd128Register(0).high());
1803 break;
1804 }
1775 case kArmI16x8Neg: { 1805 case kArmI16x8Neg: {
1776 __ vneg(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0)); 1806 __ vneg(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0));
1777 break; 1807 break;
1778 } 1808 }
1779 case kArmI16x8Shl: { 1809 case kArmI16x8Shl: {
1780 __ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1810 __ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1781 i.InputInt4(1)); 1811 i.InputInt4(1));
1782 break; 1812 break;
1783 } 1813 }
1784 case kArmI16x8ShrS: { 1814 case kArmI16x8ShrS: {
1785 __ vshr(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1815 __ vshr(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1786 i.InputInt4(1)); 1816 i.InputInt4(1));
1787 break; 1817 break;
1788 } 1818 }
1819 case kArmI16x8SConvertI32x4: {
1820 Simd128Register dst = i.OutputSimd128Register(),
1821 src0 = i.InputSimd128Register(0),
1822 src1 = i.InputSimd128Register(1);
1823 // Take care not to overwrite a source register before it's used.
1824 if (dst.is(src0) && dst.is(src1)) {
1825 __ vqmovn(NeonS16, dst.low(), src0);
1826 __ vmov(dst.high(), dst.low());
1827 } else if (dst.is(src0)) {
1828 // dst is src0, so narrow src0 first.
1829 __ vqmovn(NeonS16, dst.low(), src0);
1830 __ vqmovn(NeonS16, dst.high(), src1);
1831 } else {
1832 // dst may alias src1, so narrow src1 first.
1833 __ vqmovn(NeonS16, dst.high(), src1);
1834 __ vqmovn(NeonS16, dst.low(), src0);
1835 }
1836 break;
1837 }
1789 case kArmI16x8Add: { 1838 case kArmI16x8Add: {
1790 __ vadd(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1839 __ vadd(Neon16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1791 i.InputSimd128Register(1)); 1840 i.InputSimd128Register(1));
1792 break; 1841 break;
1793 } 1842 }
1794 case kArmI16x8AddSaturateS: { 1843 case kArmI16x8AddSaturateS: {
1795 __ vqadd(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1844 __ vqadd(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1796 i.InputSimd128Register(1)); 1845 i.InputSimd128Register(1));
1797 break; 1846 break;
1798 } 1847 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1836 case kArmI16x8LtS: { 1885 case kArmI16x8LtS: {
1837 __ vcgt(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(1), 1886 __ vcgt(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(1),
1838 i.InputSimd128Register(0)); 1887 i.InputSimd128Register(0));
1839 break; 1888 break;
1840 } 1889 }
1841 case kArmI16x8LeS: { 1890 case kArmI16x8LeS: {
1842 __ vcge(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(1), 1891 __ vcge(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(1),
1843 i.InputSimd128Register(0)); 1892 i.InputSimd128Register(0));
1844 break; 1893 break;
1845 } 1894 }
1895 case kArmI16x8UConvertI8x16Low: {
1896 __ vmovl(NeonU8, i.OutputSimd128Register(),
1897 i.InputSimd128Register(0).low());
1898 break;
1899 }
1900 case kArmI16x8UConvertI8x16High: {
1901 __ vmovl(NeonU8, i.OutputSimd128Register(),
1902 i.InputSimd128Register(0).high());
1903 break;
1904 }
1846 case kArmI16x8ShrU: { 1905 case kArmI16x8ShrU: {
1847 __ vshr(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1906 __ vshr(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1848 i.InputInt4(1)); 1907 i.InputInt4(1));
1849 break; 1908 break;
1850 } 1909 }
1910 case kArmI16x8UConvertI32x4: {
1911 Simd128Register dst = i.OutputSimd128Register(),
1912 src0 = i.InputSimd128Register(0),
1913 src1 = i.InputSimd128Register(1);
1914 // Take care not to overwrite a source register before it's used.
1915 if (dst.is(src0) && dst.is(src1)) {
1916 __ vqmovn(NeonU16, dst.low(), src0);
1917 __ vmov(dst.high(), dst.low());
1918 } else if (dst.is(src0)) {
1919 // dst is src0, so narrow src0 first.
1920 __ vqmovn(NeonU16, dst.low(), src0);
1921 __ vqmovn(NeonU16, dst.high(), src1);
1922 } else {
1923 // dst may alias src1, so narrow src1 first.
1924 __ vqmovn(NeonU16, dst.high(), src1);
1925 __ vqmovn(NeonU16, dst.low(), src0);
1926 }
1927 break;
1928 }
1851 case kArmI16x8AddSaturateU: { 1929 case kArmI16x8AddSaturateU: {
1852 __ vqadd(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1930 __ vqadd(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1853 i.InputSimd128Register(1)); 1931 i.InputSimd128Register(1));
1854 break; 1932 break;
1855 } 1933 }
1856 case kArmI16x8SubSaturateU: { 1934 case kArmI16x8SubSaturateU: {
1857 __ vqsub(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1935 __ vqsub(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1858 i.InputSimd128Register(1)); 1936 i.InputSimd128Register(1));
1859 break; 1937 break;
1860 } 1938 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 case kArmI8x16Shl: { 1977 case kArmI8x16Shl: {
1900 __ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), 1978 __ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1901 i.InputInt3(1)); 1979 i.InputInt3(1));
1902 break; 1980 break;
1903 } 1981 }
1904 case kArmI8x16ShrS: { 1982 case kArmI8x16ShrS: {
1905 __ vshr(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), 1983 __ vshr(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1906 i.InputInt3(1)); 1984 i.InputInt3(1));
1907 break; 1985 break;
1908 } 1986 }
1987 case kArmI8x16SConvertI16x8: {
1988 Simd128Register dst = i.OutputSimd128Register(),
1989 src0 = i.InputSimd128Register(0),
1990 src1 = i.InputSimd128Register(1);
1991 // Take care not to overwrite a source register before it's used.
1992 if (dst.is(src0) && dst.is(src1)) {
1993 __ vqmovn(NeonS8, dst.low(), src0);
1994 __ vmov(dst.high(), dst.low());
1995 } else if (dst.is(src0)) {
1996 // dst is src0, so narrow src0 first.
1997 __ vqmovn(NeonS8, dst.low(), src0);
1998 __ vqmovn(NeonS8, dst.high(), src1);
1999 } else {
2000 // dst may alias src1, so narrow src1 first.
2001 __ vqmovn(NeonS8, dst.high(), src1);
2002 __ vqmovn(NeonS8, dst.low(), src0);
2003 }
2004 break;
2005 }
1909 case kArmI8x16Add: { 2006 case kArmI8x16Add: {
1910 __ vadd(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0), 2007 __ vadd(Neon8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1911 i.InputSimd128Register(1)); 2008 i.InputSimd128Register(1));
1912 break; 2009 break;
1913 } 2010 }
1914 case kArmI8x16AddSaturateS: { 2011 case kArmI8x16AddSaturateS: {
1915 __ vqadd(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), 2012 __ vqadd(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1916 i.InputSimd128Register(1)); 2013 i.InputSimd128Register(1));
1917 break; 2014 break;
1918 } 2015 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 case kArmI8x16LeS: { 2057 case kArmI8x16LeS: {
1961 __ vcge(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(1), 2058 __ vcge(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(1),
1962 i.InputSimd128Register(0)); 2059 i.InputSimd128Register(0));
1963 break; 2060 break;
1964 } 2061 }
1965 case kArmI8x16ShrU: { 2062 case kArmI8x16ShrU: {
1966 __ vshr(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), 2063 __ vshr(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1967 i.InputInt3(1)); 2064 i.InputInt3(1));
1968 break; 2065 break;
1969 } 2066 }
2067 case kArmI8x16UConvertI16x8: {
2068 Simd128Register dst = i.OutputSimd128Register(),
2069 src0 = i.InputSimd128Register(0),
2070 src1 = i.InputSimd128Register(1);
2071 // Take care not to overwrite a source register before it's used.
2072 if (dst.is(src0) && dst.is(src1)) {
2073 __ vqmovn(NeonU8, dst.low(), src0);
2074 __ vmov(dst.high(), dst.low());
2075 } else if (dst.is(src0)) {
2076 // dst is src0, so narrow src0 first.
2077 __ vqmovn(NeonU8, dst.low(), src0);
2078 __ vqmovn(NeonU8, dst.high(), src1);
2079 } else {
2080 // dst may alias src1, so narrow src1 first.
2081 __ vqmovn(NeonU8, dst.high(), src1);
2082 __ vqmovn(NeonU8, dst.low(), src0);
2083 }
2084 break;
2085 }
1970 case kArmI8x16AddSaturateU: { 2086 case kArmI8x16AddSaturateU: {
1971 __ vqadd(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), 2087 __ vqadd(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1972 i.InputSimd128Register(1)); 2088 i.InputSimd128Register(1));
1973 break; 2089 break;
1974 } 2090 }
1975 case kArmI8x16SubSaturateU: { 2091 case kArmI8x16SubSaturateU: {
1976 __ vqsub(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), 2092 __ vqsub(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1977 i.InputSimd128Register(1)); 2093 i.InputSimd128Register(1));
1978 break; 2094 break;
1979 } 2095 }
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 padding_size -= v8::internal::Assembler::kInstrSize; 2947 padding_size -= v8::internal::Assembler::kInstrSize;
2832 } 2948 }
2833 } 2949 }
2834 } 2950 }
2835 2951
2836 #undef __ 2952 #undef __
2837 2953
2838 } // namespace compiler 2954 } // namespace compiler
2839 } // namespace internal 2955 } // namespace internal
2840 } // namespace v8 2956 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/arm/instruction-codes-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698