Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1840 // Ddst = MEM(Rbase + offset). | 1840 // Ddst = MEM(Rbase + offset). |
| 1841 // Instruction details available in ARM DDI 0406A, A8-628. | 1841 // Instruction details available in ARM DDI 0406A, A8-628. |
| 1842 // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) | | 1842 // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) | |
| 1843 // Vdst(15-12) | 1011(11-8) | offset | 1843 // Vdst(15-12) | 1011(11-8) | offset |
| 1844 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1844 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
| 1845 int u = 1; | 1845 int u = 1; |
| 1846 if (offset < 0) { | 1846 if (offset < 0) { |
| 1847 offset = -offset; | 1847 offset = -offset; |
| 1848 u = 0; | 1848 u = 0; |
| 1849 } | 1849 } |
| 1850 ASSERT(offset % 4 == 0); | 1850 |
| 1851 ASSERT((offset / 4) < 256); | |
| 1852 ASSERT(offset >= 0); | 1851 ASSERT(offset >= 0); |
| 1853 emit(cond | u*B23 | 0xD1*B20 | base.code()*B16 | dst.code()*B12 | | 1852 if ((offset % 4) == 0 && (offset / 4) < 256) { |
| 1854 0xB*B8 | ((offset / 4) & 255)); | 1853 emit(cond | u*B23 | 0xD1*B20 | base.code()*B16 | dst.code()*B12 | |
| 1854 0xB*B8 | ((offset / 4) & 255)); | |
| 1855 } else { | |
| 1856 // Larger offsets must be handled by computing the correct address | |
| 1857 // in the ip register. | |
| 1858 ASSERT(!base.is(ip)); | |
| 1859 mov(ip, Operand(offset)); | |
| 1860 if (u == 1) { | |
| 1861 add(ip, ip, base); | |
|
Søren Thygesen Gjesse
2011/01/25 08:33:20
add(ip, base, ip) to have same order as the sub be
William Hesse
2011/01/25 17:25:13
Done.
| |
| 1862 } else { | |
| 1863 sub(ip, base, ip); | |
| 1864 } | |
| 1865 emit(cond | 0xD1*B20 | ip.code()*B16 | dst.code()*B12 | 0xB*B8); | |
| 1866 } | |
| 1867 } | |
| 1868 | |
| 1869 | |
| 1870 void Assembler::vldr(const DwVfpRegister dst, | |
| 1871 const MemOperand& operand, | |
| 1872 const Condition cond) { | |
| 1873 ASSERT(!operand.rm().is_valid()); | |
|
Søren Thygesen Gjesse
2011/01/25 08:33:20
Assert for the supported addressing mode.
William Hesse
2011/01/25 17:25:13
Done.
| |
| 1874 vldr(dst, operand.rn(), operand.offset(), cond); | |
| 1855 } | 1875 } |
| 1856 | 1876 |
| 1857 | 1877 |
| 1858 void Assembler::vldr(const SwVfpRegister dst, | 1878 void Assembler::vldr(const SwVfpRegister dst, |
| 1859 const Register base, | 1879 const Register base, |
| 1860 int offset, | 1880 int offset, |
| 1861 const Condition cond) { | 1881 const Condition cond) { |
| 1862 // Sdst = MEM(Rbase + offset). | 1882 // Sdst = MEM(Rbase + offset). |
| 1863 // Instruction details available in ARM DDI 0406A, A8-628. | 1883 // Instruction details available in ARM DDI 0406A, A8-628. |
| 1864 // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) | | 1884 // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) | |
| 1865 // Vdst(15-12) | 1010(11-8) | offset | 1885 // Vdst(15-12) | 1010(11-8) | offset |
| 1866 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1886 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
| 1867 int u = 1; | 1887 int u = 1; |
| 1868 if (offset < 0) { | 1888 if (offset < 0) { |
| 1869 offset = -offset; | 1889 offset = -offset; |
| 1870 u = 0; | 1890 u = 0; |
| 1871 } | 1891 } |
| 1872 ASSERT(offset % 4 == 0); | |
| 1873 ASSERT((offset / 4) < 256); | |
| 1874 ASSERT(offset >= 0); | |
| 1875 int sd, d; | 1892 int sd, d; |
| 1876 dst.split_code(&sd, &d); | 1893 dst.split_code(&sd, &d); |
| 1894 ASSERT(offset >= 0); | |
| 1895 | |
| 1896 if ((offset % 4) == 0 && (offset / 4) < 256) { | |
| 1877 emit(cond | u*B23 | d*B22 | 0xD1*B20 | base.code()*B16 | sd*B12 | | 1897 emit(cond | u*B23 | d*B22 | 0xD1*B20 | base.code()*B16 | sd*B12 | |
| 1878 0xA*B8 | ((offset / 4) & 255)); | 1898 0xA*B8 | ((offset / 4) & 255)); |
| 1899 } else { | |
| 1900 // Larger offsets must be handled by computing the correct address | |
| 1901 // in the ip register. | |
| 1902 ASSERT(!base.is(ip)); | |
| 1903 mov(ip, Operand(offset)); | |
| 1904 if (u == 1) { | |
| 1905 add(ip, ip, base); | |
| 1906 } else { | |
| 1907 sub(ip, base, ip); | |
| 1908 } | |
| 1909 emit(cond | d*B22 | 0xD1*B20 | ip.code()*B16 | sd*B12 | 0xA*B8); | |
| 1910 } | |
| 1911 } | |
| 1912 | |
| 1913 | |
| 1914 void Assembler::vldr(const SwVfpRegister dst, | |
| 1915 const MemOperand& operand, | |
| 1916 const Condition cond) { | |
| 1917 ASSERT(!operand.rm().is_valid()); | |
| 1918 vldr(dst, operand.rn(), operand.offset(), cond); | |
| 1879 } | 1919 } |
| 1880 | 1920 |
| 1881 | 1921 |
| 1882 void Assembler::vstr(const DwVfpRegister src, | 1922 void Assembler::vstr(const DwVfpRegister src, |
| 1883 const Register base, | 1923 const Register base, |
| 1884 int offset, | 1924 int offset, |
| 1885 const Condition cond) { | 1925 const Condition cond) { |
| 1886 // MEM(Rbase + offset) = Dsrc. | 1926 // MEM(Rbase + offset) = Dsrc. |
| 1887 // Instruction details available in ARM DDI 0406A, A8-786. | 1927 // Instruction details available in ARM DDI 0406A, A8-786. |
| 1888 // cond(31-28) | 1101(27-24)| U000(23-20) | | Rbase(19-16) | | 1928 // cond(31-28) | 1101(27-24)| U000(23-20) | | Rbase(19-16) | |
| 1889 // Vsrc(15-12) | 1011(11-8) | (offset/4) | 1929 // Vsrc(15-12) | 1011(11-8) | (offset/4) |
| 1890 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1930 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
| 1891 int u = 1; | 1931 int u = 1; |
| 1892 if (offset < 0) { | 1932 if (offset < 0) { |
| 1893 offset = -offset; | 1933 offset = -offset; |
| 1894 u = 0; | 1934 u = 0; |
| 1895 } | 1935 } |
| 1896 ASSERT(offset % 4 == 0); | |
| 1897 ASSERT((offset / 4) < 256); | |
| 1898 ASSERT(offset >= 0); | 1936 ASSERT(offset >= 0); |
| 1899 emit(cond | u*B23 | 0xD0*B20 | base.code()*B16 | src.code()*B12 | | 1937 if ((offset % 4) == 0 && (offset / 4) < 256) { |
| 1900 0xB*B8 | ((offset / 4) & 255)); | 1938 emit(cond | u*B23 | 0xD0*B20 | base.code()*B16 | src.code()*B12 | |
| 1939 0xB*B8 | ((offset / 4) & 255)); | |
| 1940 } else { | |
| 1941 // Larger offsets must be handled by computing the correct address | |
| 1942 // in the ip register. | |
| 1943 ASSERT(!base.is(ip)); | |
| 1944 mov(ip, Operand(offset)); | |
| 1945 if (u == 1) { | |
| 1946 add(ip, ip, base); | |
| 1947 } else { | |
| 1948 sub(ip, base, ip); | |
| 1949 } | |
| 1950 emit(cond | 0xD0*B20 | ip.code()*B16 | src.code()*B12 | 0xB*B8); | |
| 1951 } | |
| 1952 } | |
| 1953 | |
| 1954 | |
| 1955 void Assembler::vstr(const DwVfpRegister src, | |
| 1956 const MemOperand& operand, | |
| 1957 const Condition cond) { | |
| 1958 ASSERT(!operand.rm().is_valid()); | |
|
Søren Thygesen Gjesse
2011/01/25 08:33:20
Assert for the supported addressing mode.
William Hesse
2011/01/25 17:25:13
Done.
| |
| 1959 vldr(src, operand.rn(), operand.offset(), cond); | |
| 1901 } | 1960 } |
| 1902 | 1961 |
| 1903 | 1962 |
| 1904 void Assembler::vstr(const SwVfpRegister src, | 1963 void Assembler::vstr(const SwVfpRegister src, |
| 1905 const Register base, | 1964 const Register base, |
| 1906 int offset, | 1965 int offset, |
| 1907 const Condition cond) { | 1966 const Condition cond) { |
| 1908 // MEM(Rbase + offset) = SSrc. | 1967 // MEM(Rbase + offset) = SSrc. |
| 1909 // Instruction details available in ARM DDI 0406A, A8-786. | 1968 // Instruction details available in ARM DDI 0406A, A8-786. |
| 1910 // cond(31-28) | 1101(27-24)| U000(23-20) | Rbase(19-16) | | 1969 // cond(31-28) | 1101(27-24)| U000(23-20) | Rbase(19-16) | |
| 1911 // Vdst(15-12) | 1010(11-8) | (offset/4) | 1970 // Vdst(15-12) | 1010(11-8) | (offset/4) |
| 1912 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1971 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
| 1913 int u = 1; | 1972 int u = 1; |
| 1914 if (offset < 0) { | 1973 if (offset < 0) { |
| 1915 offset = -offset; | 1974 offset = -offset; |
| 1916 u = 0; | 1975 u = 0; |
| 1917 } | 1976 } |
| 1918 ASSERT(offset % 4 == 0); | |
| 1919 ASSERT((offset / 4) < 256); | |
| 1920 ASSERT(offset >= 0); | |
| 1921 int sd, d; | 1977 int sd, d; |
| 1922 src.split_code(&sd, &d); | 1978 src.split_code(&sd, &d); |
| 1923 emit(cond | u*B23 | d*B22 | 0xD0*B20 | base.code()*B16 | sd*B12 | | 1979 ASSERT(offset >= 0); |
| 1924 0xA*B8 | ((offset / 4) & 255)); | 1980 if ((offset % 4) == 0 && (offset / 4) < 256) { |
| 1981 emit(cond | u*B23 | d*B22 | 0xD0*B20 | base.code()*B16 | sd*B12 | | |
| 1982 0xA*B8 | ((offset / 4) & 255)); | |
| 1983 } else { | |
| 1984 // Larger offsets must be handled by computing the correct address | |
| 1985 // in the ip register. | |
| 1986 ASSERT(!base.is(ip)); | |
| 1987 mov(ip, Operand(offset)); | |
| 1988 if (u == 1) { | |
| 1989 add(ip, ip, base); | |
| 1990 } else { | |
| 1991 sub(ip, base, ip); | |
| 1992 } | |
| 1993 emit(cond | d*B22 | 0xD0*B20 | ip.code()*B16 | sd*B12 | 0xA*B8); | |
| 1994 } | |
| 1995 } | |
| 1996 | |
| 1997 | |
| 1998 void Assembler::vstr(const SwVfpRegister src, | |
| 1999 const MemOperand& operand, | |
| 2000 const Condition cond) { | |
| 2001 ASSERT(!operand.rm().is_valid()); | |
| 2002 vldr(src, operand.rn(), operand.offset(), cond); | |
| 1925 } | 2003 } |
| 1926 | 2004 |
| 1927 | 2005 |
| 1928 static void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { | 2006 static void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { |
| 1929 uint64_t i; | 2007 uint64_t i; |
| 1930 memcpy(&i, &d, 8); | 2008 memcpy(&i, &d, 8); |
| 1931 | 2009 |
| 1932 *lo = i & 0xffffffff; | 2010 *lo = i & 0xffffffff; |
| 1933 *hi = i >> 32; | 2011 *hi = i >> 32; |
| 1934 } | 2012 } |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2660 | 2738 |
| 2661 // Since a constant pool was just emitted, move the check offset forward by | 2739 // Since a constant pool was just emitted, move the check offset forward by |
| 2662 // the standard interval. | 2740 // the standard interval. |
| 2663 next_buffer_check_ = pc_offset() + kCheckConstInterval; | 2741 next_buffer_check_ = pc_offset() + kCheckConstInterval; |
| 2664 } | 2742 } |
| 2665 | 2743 |
| 2666 | 2744 |
| 2667 } } // namespace v8::internal | 2745 } } // namespace v8::internal |
| 2668 | 2746 |
| 2669 #endif // V8_TARGET_ARCH_ARM | 2747 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |