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

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

Issue 2711863002: Implement remaining Boolean SIMD operations on ARM. (Closed)
Patch Set: Fix macro assembler test. Created 3 years, 9 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 | « src/arm/simulator-arm.cc ('k') | 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 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 i.InputSimd128Register(1)); 1629 i.InputSimd128Register(1));
1630 __ vmvn(dst, dst); 1630 __ vmvn(dst, dst);
1631 break; 1631 break;
1632 } 1632 }
1633 case kArmInt32x4GreaterThan: { 1633 case kArmInt32x4GreaterThan: {
1634 __ vcgt(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1634 __ vcgt(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1635 i.InputSimd128Register(1)); 1635 i.InputSimd128Register(1));
1636 break; 1636 break;
1637 } 1637 }
1638 case kArmInt32x4GreaterThanOrEqual: { 1638 case kArmInt32x4GreaterThanOrEqual: {
1639 Simd128Register dst = i.OutputSimd128Register(); 1639 __ vcge(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1640 __ vcge(NeonS32, dst, i.InputSimd128Register(0),
1641 i.InputSimd128Register(1)); 1640 i.InputSimd128Register(1));
1642 break; 1641 break;
1643 } 1642 }
1644 case kArmUint32x4ShiftRightByScalar: { 1643 case kArmUint32x4ShiftRightByScalar: {
1645 __ vshr(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1644 __ vshr(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1646 i.InputInt5(1)); 1645 i.InputInt5(1));
1647 break; 1646 break;
1648 } 1647 }
1649 case kArmUint32x4Min: { 1648 case kArmUint32x4Min: {
1650 __ vmin(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1649 __ vmin(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1651 i.InputSimd128Register(1)); 1650 i.InputSimd128Register(1));
1652 break; 1651 break;
1653 } 1652 }
1654 case kArmUint32x4Max: { 1653 case kArmUint32x4Max: {
1655 __ vmax(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1654 __ vmax(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1656 i.InputSimd128Register(1)); 1655 i.InputSimd128Register(1));
1657 break; 1656 break;
1658 } 1657 }
1659 case kArmUint32x4GreaterThan: { 1658 case kArmUint32x4GreaterThan: {
1660 __ vcgt(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), 1659 __ vcgt(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1661 i.InputSimd128Register(1)); 1660 i.InputSimd128Register(1));
1662 break; 1661 break;
1663 } 1662 }
1664 case kArmUint32x4GreaterThanOrEqual: { 1663 case kArmUint32x4GreaterThanOrEqual: {
1665 Simd128Register dst = i.OutputSimd128Register(); 1664 __ vcge(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
1666 __ vcge(NeonU32, dst, i.InputSimd128Register(0),
1667 i.InputSimd128Register(1)); 1665 i.InputSimd128Register(1));
1668 break; 1666 break;
1669 } 1667 }
1670 case kArmInt16x8Splat: { 1668 case kArmInt16x8Splat: {
1671 __ vdup(Neon16, i.OutputSimd128Register(), i.InputRegister(0)); 1669 __ vdup(Neon16, i.OutputSimd128Register(), i.InputRegister(0));
1672 break; 1670 break;
1673 } 1671 }
1674 case kArmInt16x8ExtractLane: { 1672 case kArmInt16x8ExtractLane: {
1675 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS16, 1673 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS16,
1676 i.InputInt8(1)); 1674 i.InputInt8(1));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 i.InputSimd128Register(1)); 1739 i.InputSimd128Register(1));
1742 __ vmvn(dst, dst); 1740 __ vmvn(dst, dst);
1743 break; 1741 break;
1744 } 1742 }
1745 case kArmInt16x8GreaterThan: { 1743 case kArmInt16x8GreaterThan: {
1746 __ vcgt(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1744 __ vcgt(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1747 i.InputSimd128Register(1)); 1745 i.InputSimd128Register(1));
1748 break; 1746 break;
1749 } 1747 }
1750 case kArmInt16x8GreaterThanOrEqual: { 1748 case kArmInt16x8GreaterThanOrEqual: {
1751 Simd128Register dst = i.OutputSimd128Register(); 1749 __ vcge(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1752 __ vcge(NeonS16, dst, i.InputSimd128Register(0),
1753 i.InputSimd128Register(1)); 1750 i.InputSimd128Register(1));
1754 break; 1751 break;
1755 } 1752 }
1756 case kArmUint16x8ShiftRightByScalar: { 1753 case kArmUint16x8ShiftRightByScalar: {
1757 __ vshr(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1754 __ vshr(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1758 i.InputInt4(1)); 1755 i.InputInt4(1));
1759 break; 1756 break;
1760 } 1757 }
1761 case kArmUint16x8AddSaturate: { 1758 case kArmUint16x8AddSaturate: {
1762 __ vqadd(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1759 __ vqadd(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
(...skipping 14 matching lines...) Expand all
1777 __ vmax(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1774 __ vmax(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1778 i.InputSimd128Register(1)); 1775 i.InputSimd128Register(1));
1779 break; 1776 break;
1780 } 1777 }
1781 case kArmUint16x8GreaterThan: { 1778 case kArmUint16x8GreaterThan: {
1782 __ vcgt(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), 1779 __ vcgt(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1783 i.InputSimd128Register(1)); 1780 i.InputSimd128Register(1));
1784 break; 1781 break;
1785 } 1782 }
1786 case kArmUint16x8GreaterThanOrEqual: { 1783 case kArmUint16x8GreaterThanOrEqual: {
1787 Simd128Register dst = i.OutputSimd128Register(); 1784 __ vcge(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
1788 __ vcge(NeonU16, dst, i.InputSimd128Register(0),
1789 i.InputSimd128Register(1)); 1785 i.InputSimd128Register(1));
1790 break; 1786 break;
1791 } 1787 }
1792 case kArmInt8x16Splat: { 1788 case kArmInt8x16Splat: {
1793 __ vdup(Neon8, i.OutputSimd128Register(), i.InputRegister(0)); 1789 __ vdup(Neon8, i.OutputSimd128Register(), i.InputRegister(0));
1794 break; 1790 break;
1795 } 1791 }
1796 case kArmInt8x16ExtractLane: { 1792 case kArmInt8x16ExtractLane: {
1797 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS8, 1793 __ ExtractLane(i.OutputRegister(), i.InputSimd128Register(0), NeonS8,
1798 i.InputInt8(1)); 1794 i.InputInt8(1));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 __ vceq(Neon8, dst, i.InputSimd128Register(0), i.InputSimd128Register(1)); 1858 __ vceq(Neon8, dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
1863 __ vmvn(dst, dst); 1859 __ vmvn(dst, dst);
1864 break; 1860 break;
1865 } 1861 }
1866 case kArmInt8x16GreaterThan: { 1862 case kArmInt8x16GreaterThan: {
1867 __ vcgt(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), 1863 __ vcgt(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1868 i.InputSimd128Register(1)); 1864 i.InputSimd128Register(1));
1869 break; 1865 break;
1870 } 1866 }
1871 case kArmInt8x16GreaterThanOrEqual: { 1867 case kArmInt8x16GreaterThanOrEqual: {
1872 Simd128Register dst = i.OutputSimd128Register(); 1868 __ vcge(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1873 __ vcge(NeonS8, dst, i.InputSimd128Register(0),
1874 i.InputSimd128Register(1)); 1869 i.InputSimd128Register(1));
1875 break; 1870 break;
1876 } 1871 }
1877 case kArmUint8x16ShiftRightByScalar: { 1872 case kArmUint8x16ShiftRightByScalar: {
1878 __ vshr(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), 1873 __ vshr(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1879 i.InputInt3(1)); 1874 i.InputInt3(1));
1880 break; 1875 break;
1881 } 1876 }
1882 case kArmUint8x16AddSaturate: { 1877 case kArmUint8x16AddSaturate: {
1883 __ vqadd(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), 1878 __ vqadd(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
(...skipping 14 matching lines...) Expand all
1898 __ vmax(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), 1893 __ vmax(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1899 i.InputSimd128Register(1)); 1894 i.InputSimd128Register(1));
1900 break; 1895 break;
1901 } 1896 }
1902 case kArmUint8x16GreaterThan: { 1897 case kArmUint8x16GreaterThan: {
1903 __ vcgt(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), 1898 __ vcgt(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1904 i.InputSimd128Register(1)); 1899 i.InputSimd128Register(1));
1905 break; 1900 break;
1906 } 1901 }
1907 case kArmUint8x16GreaterThanOrEqual: { 1902 case kArmUint8x16GreaterThanOrEqual: {
1908 Simd128Register dst = i.OutputSimd128Register(); 1903 __ vcge(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
1909 __ vcge(NeonU8, dst, i.InputSimd128Register(0),
1910 i.InputSimd128Register(1)); 1904 i.InputSimd128Register(1));
1911 break; 1905 break;
1912 } 1906 }
1913 case kArmSimd128Zero: { 1907 case kArmSimd128Zero: {
1914 __ veor(i.OutputSimd128Register(), i.OutputSimd128Register(), 1908 __ veor(i.OutputSimd128Register(), i.OutputSimd128Register(),
1915 i.OutputSimd128Register()); 1909 i.OutputSimd128Register());
1916 break; 1910 break;
1917 } 1911 }
1918 case kArmSimd128And: { 1912 case kArmSimd128And: {
1919 __ vand(i.OutputSimd128Register(), i.InputSimd128Register(0), 1913 __ vand(i.OutputSimd128Register(), i.InputSimd128Register(0),
1920 i.InputSimd128Register(1)); 1914 i.InputSimd128Register(1));
1921 break; 1915 break;
1922 } 1916 }
1923 case kArmSimd128Or: { 1917 case kArmSimd128Or: {
1924 __ vorr(i.OutputSimd128Register(), i.InputSimd128Register(0), 1918 __ vorr(i.OutputSimd128Register(), i.InputSimd128Register(0),
1925 i.InputSimd128Register(1)); 1919 i.InputSimd128Register(1));
1926 break; 1920 break;
1927 } 1921 }
1928 case kArmSimd128Xor: { 1922 case kArmSimd128Xor: {
1929 __ veor(i.OutputSimd128Register(), i.InputSimd128Register(0), 1923 __ veor(i.OutputSimd128Register(), i.InputSimd128Register(0),
1930 i.InputSimd128Register(1)); 1924 i.InputSimd128Register(1));
1931 break; 1925 break;
1932 } 1926 }
1933 case kArmSimd128Not: { 1927 case kArmSimd128Not: {
1934 __ vmvn(i.OutputSimd128Register(), i.InputSimd128Register(0)); 1928 __ vmvn(i.OutputSimd128Register(), i.InputSimd128Register(0));
1935 break; 1929 break;
1936 } 1930 }
1937 case kArmSimd32x4Select: 1931 case kArmSimd128Select: {
1938 case kArmSimd16x8Select:
1939 case kArmSimd8x16Select: {
1940 // vbsl clobbers the mask input so make sure it was DefineSameAsFirst. 1932 // vbsl clobbers the mask input so make sure it was DefineSameAsFirst.
1941 DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0))); 1933 DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0)));
1942 __ vbsl(i.OutputSimd128Register(), i.InputSimd128Register(1), 1934 __ vbsl(i.OutputSimd128Register(), i.InputSimd128Register(1),
1943 i.InputSimd128Register(2)); 1935 i.InputSimd128Register(2));
1944 break; 1936 break;
1945 } 1937 }
1938 case kArmSimd1x4AnyTrue: {
1939 const QwNeonRegister& src = i.InputSimd128Register(0);
1940 __ vpmax(NeonU32, kScratchDoubleReg, src.low(), src.high());
1941 __ vpmax(NeonU32, kScratchDoubleReg, kScratchDoubleReg,
1942 kScratchDoubleReg);
1943 __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS32, 0);
1944 break;
1945 }
1946 case kArmSimd1x4AllTrue: {
1947 const QwNeonRegister& src = i.InputSimd128Register(0);
1948 __ vpmin(NeonU32, kScratchDoubleReg, src.low(), src.high());
1949 __ vpmin(NeonU32, kScratchDoubleReg, kScratchDoubleReg,
1950 kScratchDoubleReg);
1951 __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS32, 0);
1952 break;
1953 }
1954 case kArmSimd1x8AnyTrue: {
1955 const QwNeonRegister& src = i.InputSimd128Register(0);
1956 __ vpmax(NeonU16, kScratchDoubleReg, src.low(), src.high());
1957 __ vpmax(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
1958 kScratchDoubleReg);
1959 __ vpmax(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
1960 kScratchDoubleReg);
1961 __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS16, 0);
1962 break;
1963 }
1964 case kArmSimd1x8AllTrue: {
1965 const QwNeonRegister& src = i.InputSimd128Register(0);
1966 __ vpmin(NeonU16, kScratchDoubleReg, src.low(), src.high());
1967 __ vpmin(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
1968 kScratchDoubleReg);
1969 __ vpmin(NeonU16, kScratchDoubleReg, kScratchDoubleReg,
1970 kScratchDoubleReg);
1971 __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS16, 0);
1972 break;
1973 }
1974 case kArmSimd1x16AnyTrue: {
1975 const QwNeonRegister& src = i.InputSimd128Register(0);
1976 __ vpmax(NeonU8, kScratchDoubleReg, src.low(), src.high());
1977 __ vpmax(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
1978 // vtst to detect any bits in the bottom 32 bits of kScratchDoubleReg.
1979 // This saves an instruction vs. the naive sequence of vpmax.
1980 // kDoubleRegZero is not changed, since it is 0.
1981 __ vtst(Neon32, kScratchQuadReg, kScratchQuadReg, kScratchQuadReg);
1982 __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS32, 0);
1983 break;
1984 }
1985 case kArmSimd1x16AllTrue: {
1986 const QwNeonRegister& src = i.InputSimd128Register(0);
1987 __ vpmin(NeonU8, kScratchDoubleReg, src.low(), src.high());
1988 __ vpmin(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
1989 __ vpmin(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
1990 __ vpmin(NeonU8, kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
1991 __ ExtractLane(i.OutputRegister(), kScratchDoubleReg, NeonS8, 0);
1992 break;
1993 }
1946 case kCheckedLoadInt8: 1994 case kCheckedLoadInt8:
1947 ASSEMBLE_CHECKED_LOAD_INTEGER(ldrsb); 1995 ASSEMBLE_CHECKED_LOAD_INTEGER(ldrsb);
1948 break; 1996 break;
1949 case kCheckedLoadUint8: 1997 case kCheckedLoadUint8:
1950 ASSEMBLE_CHECKED_LOAD_INTEGER(ldrb); 1998 ASSEMBLE_CHECKED_LOAD_INTEGER(ldrb);
1951 break; 1999 break;
1952 case kCheckedLoadInt16: 2000 case kCheckedLoadInt16:
1953 ASSEMBLE_CHECKED_LOAD_INTEGER(ldrsh); 2001 ASSEMBLE_CHECKED_LOAD_INTEGER(ldrsh);
1954 break; 2002 break;
1955 case kCheckedLoadUint16: 2003 case kCheckedLoadUint16:
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 padding_size -= v8::internal::Assembler::kInstrSize; 2654 padding_size -= v8::internal::Assembler::kInstrSize;
2607 } 2655 }
2608 } 2656 }
2609 } 2657 }
2610 2658
2611 #undef __ 2659 #undef __
2612 2660
2613 } // namespace compiler 2661 } // namespace compiler
2614 } // namespace internal 2662 } // namespace internal
2615 } // namespace v8 2663 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/compiler/arm/instruction-codes-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698