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

Side by Side Diff: src/arm/disasm-arm.cc

Issue 2649323012: [ARM] Add Neon saturating add and subtract instructions. (Closed)
Patch Set: Add static_asserts on Widen, Clamp. Created 3 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
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/simulator-arm.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 // A Disassembler object is used to disassemble a block of code instruction by 5 // A Disassembler object is used to disassemble a block of code instruction by
6 // instruction. The default implementation of the NameConverter object can be 6 // instruction. The default implementation of the NameConverter object can be
7 // overriden to modify register names or to do symbol lookup on addresses. 7 // overriden to modify register names or to do symbol lookup on addresses.
8 // 8 //
9 // The example below will disassemble a block of code and print it to stdout. 9 // The example below will disassemble a block of code and print it to stdout.
10 // 10 //
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 1849
1850 1850
1851 static const char* const barrier_option_names[] = { 1851 static const char* const barrier_option_names[] = {
1852 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh", 1852 "invalid", "oshld", "oshst", "osh", "invalid", "nshld", "nshst", "nsh",
1853 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy", 1853 "invalid", "ishld", "ishst", "ish", "invalid", "ld", "st", "sy",
1854 }; 1854 };
1855 1855
1856 1856
1857 void Decoder::DecodeSpecialCondition(Instruction* instr) { 1857 void Decoder::DecodeSpecialCondition(Instruction* instr) {
1858 switch (instr->SpecialValue()) { 1858 switch (instr->SpecialValue()) {
1859 case 4: 1859 case 4: {
1860 if (instr->Bits(11, 8) == 1 && instr->Bits(21, 20) == 2 && 1860 int Vd, Vm, Vn;
1861 instr->Bit(6) == 1 && instr->Bit(4) == 1) { 1861 if (instr->Bit(6) == 0) {
1862 int Vd = instr->VFPDRegValue(kSimd128Precision); 1862 Vd = instr->VFPDRegValue(kDoublePrecision);
1863 int Vm = instr->VFPMRegValue(kSimd128Precision); 1863 Vm = instr->VFPMRegValue(kDoublePrecision);
1864 int Vn = instr->VFPNRegValue(kSimd128Precision); 1864 Vn = instr->VFPNRegValue(kDoublePrecision);
1865 if (Vm == Vn) { 1865 } else {
1866 // vmov Qd, Qm 1866 Vd = instr->VFPDRegValue(kSimd128Precision);
1867 Vm = instr->VFPMRegValue(kSimd128Precision);
1868 Vn = instr->VFPNRegValue(kSimd128Precision);
1869 }
1870 switch (instr->Bits(11, 8)) {
1871 case 0x0: {
1872 if (instr->Bit(4) == 1) {
1873 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1874 // vqadd.s<size> Qd, Qm, Qn.
1875 out_buffer_pos_ +=
1876 SNPrintF(out_buffer_ + out_buffer_pos_,
1877 "vqadd.s%d q%d, q%d, q%d", size, Vd, Vn, Vm);
1878 } else {
1879 Unknown(instr);
1880 }
1881 break;
1882 }
1883 case 0x1: {
1884 if (instr->Bits(21, 20) == 2 && instr->Bit(6) == 1 &&
1885 instr->Bit(4) == 1) {
1886 if (Vm == Vn) {
1887 // vmov Qd, Qm
1888 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1889 "vmov q%d, q%d", Vd, Vm);
1890 } else {
1891 // vorr Qd, Qm, Qn.
1892 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1893 "vorr q%d, q%d, q%d", Vd, Vn, Vm);
1894 }
1895 } else if (instr->Bits(21, 20) == 0 && instr->Bit(6) == 1 &&
1896 instr->Bit(4) == 1) {
1897 // vand Qd, Qm, Qn.
1898 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1899 "vand q%d, q%d, q%d", Vd, Vn, Vm);
1900 } else {
1901 Unknown(instr);
1902 }
1903 break;
1904 }
1905 case 0x2: {
1906 if (instr->Bit(4) == 1) {
1907 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1908 // vqsub.s<size> Qd, Qm, Qn.
1909 out_buffer_pos_ +=
1910 SNPrintF(out_buffer_ + out_buffer_pos_,
1911 "vqsub.s%d q%d, q%d, q%d", size, Vd, Vn, Vm);
1912 } else {
1913 Unknown(instr);
1914 }
1915 break;
1916 }
1917 case 0x3: {
1918 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1919 const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt";
1920 // vcge/vcgt.s<size> Qd, Qm, Qn.
1867 out_buffer_pos_ += 1921 out_buffer_pos_ +=
1868 SNPrintF(out_buffer_ + out_buffer_pos_, "vmov q%d, q%d", Vd, Vm); 1922 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d",
1869 } else { 1923 op, size, Vd, Vn, Vm);
1870 // vorr Qd, Qm, Qn. 1924 break;
1871 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1872 "vorr q%d, q%d, q%d", Vd, Vn, Vm);
1873 } 1925 }
1874 } else if (instr->Bits(11, 8) == 8) { 1926 case 0x6: {
1875 const char* op = (instr->Bit(4) == 0) ? "vadd" : "vtst"; 1927 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1876 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); 1928 // vmin/vmax.s<size> Qd, Qm, Qn.
1877 int Vd = instr->VFPDRegValue(kSimd128Precision); 1929 const char* op = instr->Bit(4) == 1 ? "vmin" : "vmax";
1878 int Vm = instr->VFPMRegValue(kSimd128Precision); 1930 out_buffer_pos_ +=
1879 int Vn = instr->VFPNRegValue(kSimd128Precision); 1931 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d",
1880 // vadd/vtst.i<size> Qd, Qm, Qn. 1932 op, size, Vd, Vn, Vm);
1881 out_buffer_pos_ += 1933 break;
1882 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d", op,
1883 size, Vd, Vn, Vm);
1884 } else if (instr->Bits(11, 8) == 0xd && instr->Bit(4) == 0) {
1885 const char* op = (instr->Bits(21, 20) == 0) ? "vadd" : "vsub";
1886 int Vd = instr->VFPDRegValue(kSimd128Precision);
1887 int Vm = instr->VFPMRegValue(kSimd128Precision);
1888 int Vn = instr->VFPNRegValue(kSimd128Precision);
1889 // vadd/vsub.f32 Qd, Qm, Qn.
1890 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1891 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
1892 } else if (instr->Bits(11, 8) == 0x9 && instr->Bit(6) == 1 &&
1893 instr->Bit(4) == 1) {
1894 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1895 int Vd = instr->VFPDRegValue(kSimd128Precision);
1896 int Vm = instr->VFPMRegValue(kSimd128Precision);
1897 int Vn = instr->VFPNRegValue(kSimd128Precision);
1898 // vmul.i<size> Qd, Qm, Qn.
1899 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1900 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
1901 } else if (instr->Bits(11, 8) == 0xe && instr->Bits(21, 20) == 0 &&
1902 instr->Bit(4) == 0) {
1903 int Vd = instr->VFPDRegValue(kSimd128Precision);
1904 int Vm = instr->VFPMRegValue(kSimd128Precision);
1905 int Vn = instr->VFPNRegValue(kSimd128Precision);
1906 // vceq.f32 Qd, Qm, Qn.
1907 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1908 "vceq.f32 q%d, q%d, q%d", Vd, Vn, Vm);
1909 } else if (instr->Bits(11, 8) == 1 && instr->Bits(21, 20) == 0 &&
1910 instr->Bit(6) == 1 && instr->Bit(4) == 1) {
1911 int Vd = instr->VFPDRegValue(kSimd128Precision);
1912 int Vm = instr->VFPMRegValue(kSimd128Precision);
1913 int Vn = instr->VFPNRegValue(kSimd128Precision);
1914 // vand Qd, Qm, Qn.
1915 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1916 "vand q%d, q%d, q%d", Vd, Vn, Vm);
1917 } else if (instr->Bits(11, 8) == 0x3) {
1918 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1919 int Vd = instr->VFPDRegValue(kSimd128Precision);
1920 int Vm = instr->VFPMRegValue(kSimd128Precision);
1921 int Vn = instr->VFPNRegValue(kSimd128Precision);
1922 const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt";
1923 // vcge/vcgt.s<size> Qd, Qm, Qn.
1924 out_buffer_pos_ +=
1925 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d", op,
1926 size, Vd, Vn, Vm);
1927 } else if (instr->Bits(11, 8) == 0xf && instr->Bit(20) == 0 &&
1928 instr->Bit(6) == 1) {
1929 int Vd = instr->VFPDRegValue(kSimd128Precision);
1930 int Vm = instr->VFPMRegValue(kSimd128Precision);
1931 int Vn = instr->VFPNRegValue(kSimd128Precision);
1932 if (instr->Bit(4) == 1) {
1933 // vrecps/vrsqrts.f32 Qd, Qm, Qn.
1934 const char* op = instr->Bit(21) == 0 ? "vrecps" : "vrsqrts";
1935 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1936 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
1937 } else {
1938 // vmin/max.f32 Qd, Qm, Qn.
1939 const char* op = instr->Bit(21) == 1 ? "vmin" : "vmax";
1940 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1941 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
1942 } 1934 }
1943 } else if (instr->Bits(11, 8) == 0x6) { 1935 case 0x8: {
1944 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); 1936 const char* op = (instr->Bit(4) == 0) ? "vadd" : "vtst";
1945 int Vd = instr->VFPDRegValue(kSimd128Precision); 1937 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1946 int Vm = instr->VFPMRegValue(kSimd128Precision); 1938 // vadd/vtst.i<size> Qd, Qm, Qn.
1947 int Vn = instr->VFPNRegValue(kSimd128Precision); 1939 out_buffer_pos_ +=
1948 // vmin/vmax.s<size> Qd, Qm, Qn. 1940 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.i%d q%d, q%d, q%d",
1949 const char* op = instr->Bit(4) == 1 ? "vmin" : "vmax"; 1941 op, size, Vd, Vn, Vm);
1950 out_buffer_pos_ += 1942 break;
1951 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.s%d q%d, q%d, q%d", op, 1943 }
1952 size, Vd, Vn, Vm); 1944 case 0x9: {
1953 } else { 1945 if (instr->Bit(6) == 1 && instr->Bit(4) == 1) {
1954 Unknown(instr); 1946 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
1947 // vmul.i<size> Qd, Qm, Qn.
1948 out_buffer_pos_ +=
1949 SNPrintF(out_buffer_ + out_buffer_pos_,
1950 "vmul.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
1951 } else {
1952 Unknown(instr);
1953 }
1954 break;
1955 }
1956 case 0xd: {
1957 if (instr->Bit(4) == 0) {
1958 const char* op = (instr->Bits(21, 20) == 0) ? "vadd" : "vsub";
1959 // vadd/vsub.f32 Qd, Qm, Qn.
1960 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1961 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
1962 } else {
1963 Unknown(instr);
1964 }
1965 break;
1966 }
1967 case 0xe: {
1968 if (instr->Bits(21, 20) == 0 && instr->Bit(4) == 0) {
1969 // vceq.f32 Qd, Qm, Qn.
1970 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1971 "vceq.f32 q%d, q%d, q%d", Vd, Vn, Vm);
1972 } else {
1973 Unknown(instr);
1974 }
1975 break;
1976 }
1977 case 0xf: {
1978 if (instr->Bit(20) == 0 && instr->Bit(6) == 1) {
1979 if (instr->Bit(4) == 1) {
1980 // vrecps/vrsqrts.f32 Qd, Qm, Qn.
1981 const char* op = instr->Bit(21) == 0 ? "vrecps" : "vrsqrts";
1982 out_buffer_pos_ +=
1983 SNPrintF(out_buffer_ + out_buffer_pos_,
1984 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
1985 } else {
1986 // vmin/max.f32 Qd, Qm, Qn.
1987 const char* op = instr->Bit(21) == 1 ? "vmin" : "vmax";
1988 out_buffer_pos_ +=
1989 SNPrintF(out_buffer_ + out_buffer_pos_,
1990 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
1991 }
1992 } else {
1993 Unknown(instr);
1994 }
1995 break;
1996 }
1997 default:
1998 Unknown(instr);
1999 break;
1955 } 2000 }
1956 break; 2001 break;
2002 }
1957 case 5: 2003 case 5:
1958 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && 2004 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
1959 (instr->Bit(4) == 1)) { 2005 (instr->Bit(4) == 1)) {
1960 // vmovl signed 2006 // vmovl signed
1961 if ((instr->VdValue() & 1) != 0) Unknown(instr); 2007 if ((instr->VdValue() & 1) != 0) Unknown(instr);
1962 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); 2008 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
1963 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); 2009 int Vm = (instr->Bit(5) << 4) | instr->VmValue();
1964 int imm3 = instr->Bits(21, 19); 2010 int imm3 = instr->Bits(21, 19);
1965 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2011 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
1966 "vmovl.s%d q%d, d%d", imm3*8, Vd, Vm); 2012 "vmovl.s%d q%d, d%d", imm3 * 8, Vd, Vm);
1967 } else if (instr->Bits(21, 20) == 3 && instr->Bit(4) == 0) { 2013 } else if (instr->Bits(21, 20) == 3 && instr->Bit(4) == 0) {
1968 // vext.8 Qd, Qm, Qn, imm4 2014 // vext.8 Qd, Qm, Qn, imm4
1969 int imm4 = instr->Bits(11, 8); 2015 int imm4 = instr->Bits(11, 8);
1970 int Vd = instr->VFPDRegValue(kSimd128Precision); 2016 int Vd = instr->VFPDRegValue(kSimd128Precision);
1971 int Vm = instr->VFPMRegValue(kSimd128Precision); 2017 int Vm = instr->VFPMRegValue(kSimd128Precision);
1972 int Vn = instr->VFPNRegValue(kSimd128Precision); 2018 int Vn = instr->VFPNRegValue(kSimd128Precision);
1973 out_buffer_pos_ += 2019 out_buffer_pos_ +=
1974 SNPrintF(out_buffer_ + out_buffer_pos_, "vext.8 q%d, q%d, q%d, #%d", 2020 SNPrintF(out_buffer_ + out_buffer_pos_, "vext.8 q%d, q%d, q%d, #%d",
1975 Vd, Vn, Vm, imm4); 2021 Vd, Vn, Vm, imm4);
1976 } else if (instr->Bits(11, 7) == 0xA && instr->Bit(4) == 1) { 2022 } else if (instr->Bits(11, 7) == 0xA && instr->Bit(4) == 1) {
(...skipping 11 matching lines...) Expand all
1988 int shift = 2 * size - instr->Bits(21, 16); 2034 int shift = 2 * size - instr->Bits(21, 16);
1989 int Vd = instr->VFPDRegValue(kSimd128Precision); 2035 int Vd = instr->VFPDRegValue(kSimd128Precision);
1990 int Vm = instr->VFPMRegValue(kSimd128Precision); 2036 int Vm = instr->VFPMRegValue(kSimd128Precision);
1991 out_buffer_pos_ += 2037 out_buffer_pos_ +=
1992 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.s%d q%d, q%d, #%d", 2038 SNPrintF(out_buffer_ + out_buffer_pos_, "vshr.s%d q%d, q%d, #%d",
1993 size, Vd, Vm, shift); 2039 size, Vd, Vm, shift);
1994 } else { 2040 } else {
1995 Unknown(instr); 2041 Unknown(instr);
1996 } 2042 }
1997 break; 2043 break;
1998 case 6: 2044 case 6: {
1999 if (instr->Bits(11, 8) == 8) { 2045 int Vd, Vm, Vn;
2000 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); 2046 if (instr->Bit(6) == 0) {
2001 int Vd = instr->VFPDRegValue(kSimd128Precision); 2047 Vd = instr->VFPDRegValue(kDoublePrecision);
2002 int Vm = instr->VFPMRegValue(kSimd128Precision); 2048 Vm = instr->VFPMRegValue(kDoublePrecision);
2003 int Vn = instr->VFPNRegValue(kSimd128Precision); 2049 Vn = instr->VFPNRegValue(kDoublePrecision);
2004 if (instr->Bit(4) == 0) { 2050 } else {
2051 Vd = instr->VFPDRegValue(kSimd128Precision);
2052 Vm = instr->VFPMRegValue(kSimd128Precision);
2053 Vn = instr->VFPNRegValue(kSimd128Precision);
2054 }
2055 switch (instr->Bits(11, 8)) {
2056 case 0x0: {
2057 if (instr->Bit(4) == 1) {
2058 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
2059 // vqadd.u<size> Qd, Qm, Qn.
2060 out_buffer_pos_ +=
2061 SNPrintF(out_buffer_ + out_buffer_pos_,
2062 "vqadd.u%d q%d, q%d, q%d", size, Vd, Vn, Vm);
2063 } else {
2064 Unknown(instr);
2065 }
2066 break;
2067 }
2068 case 0x1: {
2069 if (instr->Bits(21, 20) == 1 && instr->Bit(4) == 1) {
2070 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2071 "vbsl q%d, q%d, q%d", Vd, Vn, Vm);
2072 } else if (instr->Bits(21, 20) == 0 && instr->Bit(4) == 1) {
2073 if (instr->Bit(6) == 0) {
2074 // veor Dd, Dn, Dm
2075 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2076 "veor d%d, d%d, d%d", Vd, Vn, Vm);
2077
2078 } else {
2079 // veor Qd, Qn, Qm
2080 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2081 "veor q%d, q%d, q%d", Vd, Vn, Vm);
2082 }
2083 } else {
2084 Unknown(instr);
2085 }
2086 break;
2087 }
2088 case 0x2: {
2089 if (instr->Bit(4) == 1) {
2090 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
2091 // vqsub.u<size> Qd, Qm, Qn.
2092 out_buffer_pos_ +=
2093 SNPrintF(out_buffer_ + out_buffer_pos_,
2094 "vqsub.u%d q%d, q%d, q%d", size, Vd, Vn, Vm);
2095 } else {
2096 Unknown(instr);
2097 }
2098 break;
2099 }
2100 case 0x3: {
2101 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
2102 const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt";
2103 // vcge/vcgt.u<size> Qd, Qm, Qn.
2005 out_buffer_pos_ += 2104 out_buffer_pos_ +=
2006 SNPrintF(out_buffer_ + out_buffer_pos_, "vsub.i%d q%d, q%d, q%d", 2105 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d q%d, q%d, q%d",
2007 size, Vd, Vn, Vm); 2106 op, size, Vd, Vn, Vm);
2008 } else { 2107 break;
2108 }
2109 case 0x6: {
2110 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
2111 // vmin/vmax.u<size> Qd, Qm, Qn.
2112 const char* op = instr->Bit(4) == 1 ? "vmin" : "vmax";
2009 out_buffer_pos_ += 2113 out_buffer_pos_ +=
2010 SNPrintF(out_buffer_ + out_buffer_pos_, "vceq.i%d q%d, q%d, q%d", 2114 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d q%d, q%d, q%d",
2011 size, Vd, Vn, Vm); 2115 op, size, Vd, Vn, Vm);
2116 break;
2012 } 2117 }
2013 } else if (instr->Bits(11, 8) == 1 && instr->Bits(21, 20) == 1 && 2118 case 0x8: {
2014 instr->Bit(4) == 1) { 2119 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
2015 int Vd = instr->VFPDRegValue(kSimd128Precision); 2120 if (instr->Bit(4) == 0) {
2016 int Vm = instr->VFPMRegValue(kSimd128Precision); 2121 out_buffer_pos_ +=
2017 int Vn = instr->VFPNRegValue(kSimd128Precision); 2122 SNPrintF(out_buffer_ + out_buffer_pos_,
2018 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2123 "vsub.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
2019 "vbsl q%d, q%d, q%d", Vd, Vn, Vm); 2124 } else {
2020 } else if (instr->Bits(11, 8) == 1 && instr->Bits(21, 20) == 0 && 2125 out_buffer_pos_ +=
2021 instr->Bit(4) == 1) { 2126 SNPrintF(out_buffer_ + out_buffer_pos_,
2022 if (instr->Bit(6) == 0) { 2127 "vceq.i%d q%d, q%d, q%d", size, Vd, Vn, Vm);
2023 // veor Dd, Dn, Dm 2128 }
2024 int Vd = instr->VFPDRegValue(kDoublePrecision); 2129 break;
2025 int Vn = instr->VFPNRegValue(kDoublePrecision);
2026 int Vm = instr->VFPMRegValue(kDoublePrecision);
2027 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2028 "veor d%d, d%d, d%d", Vd, Vn, Vm);
2029
2030 } else {
2031 // veor Qd, Qn, Qm
2032 int Vd = instr->VFPDRegValue(kSimd128Precision);
2033 int Vn = instr->VFPNRegValue(kSimd128Precision);
2034 int Vm = instr->VFPMRegValue(kSimd128Precision);
2035 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2036 "veor q%d, q%d, q%d", Vd, Vn, Vm);
2037 } 2130 }
2038 } else if (instr->Bits(11, 8) == 0xd && instr->Bit(21) == 0 && 2131 case 0xd: {
2039 instr->Bit(6) == 1 && instr->Bit(4) == 1) { 2132 if (instr->Bit(21) == 0 && instr->Bit(6) == 1 && instr->Bit(4) == 1) {
2040 // vmul.f32 Qd, Qn, Qm 2133 // vmul.f32 Qd, Qn, Qm
2041 int Vd = instr->VFPDRegValue(kSimd128Precision); 2134 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2042 int Vn = instr->VFPNRegValue(kSimd128Precision); 2135 "vmul.f32 q%d, q%d, q%d", Vd, Vn, Vm);
2043 int Vm = instr->VFPMRegValue(kSimd128Precision); 2136 } else {
2044 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2137 Unknown(instr);
2045 "vmul.f32 q%d, q%d, q%d", Vd, Vn, Vm); 2138 }
2046 } else if (instr->Bits(11, 8) == 0xe && instr->Bit(20) == 0 && 2139 break;
2047 instr->Bit(4) == 0) { 2140 }
2048 int Vd = instr->VFPDRegValue(kSimd128Precision); 2141 case 0xe: {
2049 int Vm = instr->VFPMRegValue(kSimd128Precision); 2142 if (instr->Bit(20) == 0 && instr->Bit(4) == 0) {
2050 int Vn = instr->VFPNRegValue(kSimd128Precision); 2143 const char* op = (instr->Bit(21) == 0) ? "vcge" : "vcgt";
2051 const char* op = (instr->Bit(21) == 0) ? "vcge" : "vcgt"; 2144 // vcge/vcgt.f32 Qd, Qm, Qn.
2052 // vcge/vcgt.f32 Qd, Qm, Qn. 2145 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2053 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2146 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm);
2054 "%s.f32 q%d, q%d, q%d", op, Vd, Vn, Vm); 2147 } else {
2055 } else if (instr->Bits(11, 8) == 0x3) { 2148 Unknown(instr);
2056 int size = kBitsPerByte * (1 << instr->Bits(21, 20)); 2149 }
2057 int Vd = instr->VFPDRegValue(kSimd128Precision); 2150 break;
2058 int Vm = instr->VFPMRegValue(kSimd128Precision); 2151 }
2059 int Vn = instr->VFPNRegValue(kSimd128Precision); 2152 default:
2060 const char* op = (instr->Bit(4) == 1) ? "vcge" : "vcgt"; 2153 Unknown(instr);
2061 // vcge/vcgt.u<size> Qd, Qm, Qn. 2154 break;
2062 out_buffer_pos_ +=
2063 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d q%d, q%d, q%d", op,
2064 size, Vd, Vn, Vm);
2065 } else if (instr->Bits(11, 8) == 0x6) {
2066 int size = kBitsPerByte * (1 << instr->Bits(21, 20));
2067 int Vd = instr->VFPDRegValue(kSimd128Precision);
2068 int Vm = instr->VFPMRegValue(kSimd128Precision);
2069 int Vn = instr->VFPNRegValue(kSimd128Precision);
2070 // vmin/vmax.u<size> Qd, Qm, Qn.
2071 const char* op = instr->Bit(4) == 1 ? "vmin" : "vmax";
2072 out_buffer_pos_ +=
2073 SNPrintF(out_buffer_ + out_buffer_pos_, "%s.u%d q%d, q%d, q%d", op,
2074 size, Vd, Vn, Vm);
2075 } else {
2076 Unknown(instr);
2077 } 2155 }
2078 break; 2156 break;
2157 }
2079 case 7: 2158 case 7:
2080 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && 2159 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) &&
2081 (instr->Bit(4) == 1)) { 2160 (instr->Bit(4) == 1)) {
2082 // vmovl unsigned 2161 // vmovl unsigned
2083 if ((instr->VdValue() & 1) != 0) Unknown(instr); 2162 if ((instr->VdValue() & 1) != 0) Unknown(instr);
2084 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); 2163 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1);
2085 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); 2164 int Vm = (instr->Bit(5) << 4) | instr->VmValue();
2086 int imm3 = instr->Bits(21, 19); 2165 int imm3 = instr->Bits(21, 19);
2087 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2166 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2088 "vmovl.u%d q%d, d%d", imm3*8, Vd, Vm); 2167 "vmovl.u%d q%d, d%d", imm3 * 8, Vd, Vm);
2089 } else if (instr->Opc1Value() == 7 && instr->Bits(21, 20) == 0x3 && 2168 } else if (instr->Opc1Value() == 7 && instr->Bits(21, 20) == 0x3 &&
2090 instr->Bit(4) == 0) { 2169 instr->Bit(4) == 0) {
2091 if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 7) == 0) { 2170 if (instr->Bits(17, 16) == 0x2 && instr->Bits(11, 7) == 0) {
2092 if (instr->Bit(6) == 0) { 2171 if (instr->Bit(6) == 0) {
2093 int Vd = instr->VFPDRegValue(kDoublePrecision); 2172 int Vd = instr->VFPDRegValue(kDoublePrecision);
2094 int Vm = instr->VFPMRegValue(kDoublePrecision); 2173 int Vm = instr->VFPMRegValue(kDoublePrecision);
2095 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2174 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2096 "vswp d%d, d%d", Vd, Vm); 2175 "vswp d%d, d%d", Vd, Vm);
2097 } else { 2176 } else {
2098 int Vd = instr->VFPDRegValue(kSimd128Precision); 2177 int Vd = instr->VFPDRegValue(kSimd128Precision);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 break; 2283 break;
2205 case 8: 2284 case 8:
2206 if (instr->Bits(21, 20) == 0) { 2285 if (instr->Bits(21, 20) == 0) {
2207 // vst1 2286 // vst1
2208 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); 2287 int Vd = (instr->Bit(22) << 4) | instr->VdValue();
2209 int Rn = instr->VnValue(); 2288 int Rn = instr->VnValue();
2210 int type = instr->Bits(11, 8); 2289 int type = instr->Bits(11, 8);
2211 int size = instr->Bits(7, 6); 2290 int size = instr->Bits(7, 6);
2212 int align = instr->Bits(5, 4); 2291 int align = instr->Bits(5, 4);
2213 int Rm = instr->VmValue(); 2292 int Rm = instr->VmValue();
2214 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2293 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "vst1.%d ",
2215 "vst1.%d ", (1 << size) << 3); 2294 (1 << size) << 3);
2216 FormatNeonList(Vd, type); 2295 FormatNeonList(Vd, type);
2217 Print(", "); 2296 Print(", ");
2218 FormatNeonMemory(Rn, align, Rm); 2297 FormatNeonMemory(Rn, align, Rm);
2219 } else if (instr->Bits(21, 20) == 2) { 2298 } else if (instr->Bits(21, 20) == 2) {
2220 // vld1 2299 // vld1
2221 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); 2300 int Vd = (instr->Bit(22) << 4) | instr->VdValue();
2222 int Rn = instr->VnValue(); 2301 int Rn = instr->VnValue();
2223 int type = instr->Bits(11, 8); 2302 int type = instr->Bits(11, 8);
2224 int size = instr->Bits(7, 6); 2303 int size = instr->Bits(7, 6);
2225 int align = instr->Bits(5, 4); 2304 int align = instr->Bits(5, 4);
2226 int Rm = instr->VmValue(); 2305 int Rm = instr->VmValue();
2227 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2306 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "vld1.%d ",
2228 "vld1.%d ", (1 << size) << 3); 2307 (1 << size) << 3);
2229 FormatNeonList(Vd, type); 2308 FormatNeonList(Vd, type);
2230 Print(", "); 2309 Print(", ");
2231 FormatNeonMemory(Rn, align, Rm); 2310 FormatNeonMemory(Rn, align, Rm);
2232 } else { 2311 } else {
2233 Unknown(instr); 2312 Unknown(instr);
2234 } 2313 }
2235 break; 2314 break;
2236 case 0xA: 2315 case 0xA:
2237 case 0xB: 2316 case 0xB:
2238 if ((instr->Bits(22, 20) == 5) && (instr->Bits(15, 12) == 0xf)) { 2317 if ((instr->Bits(22, 20) == 5) && (instr->Bits(15, 12) == 0xf)) {
2239 int Rn = instr->Bits(19, 16); 2318 int Rn = instr->Bits(19, 16);
2240 int offset = instr->Bits(11, 0); 2319 int offset = instr->Bits(11, 0);
2241 if (offset == 0) { 2320 if (offset == 0) {
2242 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2321 out_buffer_pos_ +=
2243 "pld [r%d]", Rn); 2322 SNPrintF(out_buffer_ + out_buffer_pos_, "pld [r%d]", Rn);
2244 } else if (instr->Bit(23) == 0) { 2323 } else if (instr->Bit(23) == 0) {
2245 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2324 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2246 "pld [r%d, #-%d]", Rn, offset); 2325 "pld [r%d, #-%d]", Rn, offset);
2247 } else { 2326 } else {
2248 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2327 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
2249 "pld [r%d, #+%d]", Rn, offset); 2328 "pld [r%d, #+%d]", Rn, offset);
2250 } 2329 }
2251 } else if (instr->SpecialValue() == 0xA && instr->Bits(22, 20) == 7) { 2330 } else if (instr->SpecialValue() == 0xA && instr->Bits(22, 20) == 7) {
2252 int option = instr->Bits(3, 0); 2331 int option = instr->Bits(3, 0);
2253 switch (instr->Bits(7, 4)) { 2332 switch (instr->Bits(7, 4)) {
2254 case 4: 2333 case 4:
2255 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2334 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "dsb %s",
2256 "dsb %s", barrier_option_names[option]); 2335 barrier_option_names[option]);
2257 break; 2336 break;
2258 case 5: 2337 case 5:
2259 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2338 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "dmb %s",
2260 "dmb %s", barrier_option_names[option]); 2339 barrier_option_names[option]);
2261 break; 2340 break;
2262 case 6: 2341 case 6:
2263 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, 2342 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "isb %s",
2264 "isb %s", barrier_option_names[option]); 2343 barrier_option_names[option]);
2265 break; 2344 break;
2266 default: 2345 default:
2267 Unknown(instr); 2346 Unknown(instr);
2268 } 2347 }
2269 } else { 2348 } else {
2270 Unknown(instr); 2349 Unknown(instr);
2271 } 2350 }
2272 break; 2351 break;
2273 case 0x1D: 2352 case 0x1D:
2274 if (instr->Opc1Value() == 0x7 && instr->Bits(19, 18) == 0x2 && 2353 if (instr->Opc1Value() == 0x7 && instr->Bits(19, 18) == 0x2 &&
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2536 pc += d.InstructionDecode(buffer, pc); 2615 pc += d.InstructionDecode(buffer, pc);
2537 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), 2616 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc),
2538 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 2617 *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
2539 } 2618 }
2540 } 2619 }
2541 2620
2542 2621
2543 } // namespace disasm 2622 } // namespace disasm
2544 2623
2545 #endif // V8_TARGET_ARCH_ARM 2624 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698