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, base, ip); |
| 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()); |
| 1874 ASSERT(operand.am_ == Offset); |
| 1875 vldr(dst, operand.rn(), operand.offset(), cond); |
1855 } | 1876 } |
1856 | 1877 |
1857 | 1878 |
1858 void Assembler::vldr(const SwVfpRegister dst, | 1879 void Assembler::vldr(const SwVfpRegister dst, |
1859 const Register base, | 1880 const Register base, |
1860 int offset, | 1881 int offset, |
1861 const Condition cond) { | 1882 const Condition cond) { |
1862 // Sdst = MEM(Rbase + offset). | 1883 // Sdst = MEM(Rbase + offset). |
1863 // Instruction details available in ARM DDI 0406A, A8-628. | 1884 // Instruction details available in ARM DDI 0406A, A8-628. |
1864 // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) | | 1885 // cond(31-28) | 1101(27-24)| U001(23-20) | Rbase(19-16) | |
1865 // Vdst(15-12) | 1010(11-8) | offset | 1886 // Vdst(15-12) | 1010(11-8) | offset |
1866 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1887 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
1867 int u = 1; | 1888 int u = 1; |
1868 if (offset < 0) { | 1889 if (offset < 0) { |
1869 offset = -offset; | 1890 offset = -offset; |
1870 u = 0; | 1891 u = 0; |
1871 } | 1892 } |
1872 ASSERT(offset % 4 == 0); | |
1873 ASSERT((offset / 4) < 256); | |
1874 ASSERT(offset >= 0); | |
1875 int sd, d; | 1893 int sd, d; |
1876 dst.split_code(&sd, &d); | 1894 dst.split_code(&sd, &d); |
| 1895 ASSERT(offset >= 0); |
| 1896 |
| 1897 if ((offset % 4) == 0 && (offset / 4) < 256) { |
1877 emit(cond | u*B23 | d*B22 | 0xD1*B20 | base.code()*B16 | sd*B12 | | 1898 emit(cond | u*B23 | d*B22 | 0xD1*B20 | base.code()*B16 | sd*B12 | |
1878 0xA*B8 | ((offset / 4) & 255)); | 1899 0xA*B8 | ((offset / 4) & 255)); |
| 1900 } else { |
| 1901 // Larger offsets must be handled by computing the correct address |
| 1902 // in the ip register. |
| 1903 ASSERT(!base.is(ip)); |
| 1904 mov(ip, Operand(offset)); |
| 1905 if (u == 1) { |
| 1906 add(ip, ip, base); |
| 1907 } else { |
| 1908 sub(ip, base, ip); |
| 1909 } |
| 1910 emit(cond | d*B22 | 0xD1*B20 | ip.code()*B16 | sd*B12 | 0xA*B8); |
| 1911 } |
| 1912 } |
| 1913 |
| 1914 |
| 1915 void Assembler::vldr(const SwVfpRegister dst, |
| 1916 const MemOperand& operand, |
| 1917 const Condition cond) { |
| 1918 ASSERT(!operand.rm().is_valid()); |
| 1919 ASSERT(operand.am_ == Offset); |
| 1920 vldr(dst, operand.rn(), operand.offset(), cond); |
1879 } | 1921 } |
1880 | 1922 |
1881 | 1923 |
1882 void Assembler::vstr(const DwVfpRegister src, | 1924 void Assembler::vstr(const DwVfpRegister src, |
1883 const Register base, | 1925 const Register base, |
1884 int offset, | 1926 int offset, |
1885 const Condition cond) { | 1927 const Condition cond) { |
1886 // MEM(Rbase + offset) = Dsrc. | 1928 // MEM(Rbase + offset) = Dsrc. |
1887 // Instruction details available in ARM DDI 0406A, A8-786. | 1929 // Instruction details available in ARM DDI 0406A, A8-786. |
1888 // cond(31-28) | 1101(27-24)| U000(23-20) | | Rbase(19-16) | | 1930 // cond(31-28) | 1101(27-24)| U000(23-20) | | Rbase(19-16) | |
1889 // Vsrc(15-12) | 1011(11-8) | (offset/4) | 1931 // Vsrc(15-12) | 1011(11-8) | (offset/4) |
1890 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1932 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
1891 int u = 1; | 1933 int u = 1; |
1892 if (offset < 0) { | 1934 if (offset < 0) { |
1893 offset = -offset; | 1935 offset = -offset; |
1894 u = 0; | 1936 u = 0; |
1895 } | 1937 } |
1896 ASSERT(offset % 4 == 0); | |
1897 ASSERT((offset / 4) < 256); | |
1898 ASSERT(offset >= 0); | 1938 ASSERT(offset >= 0); |
1899 emit(cond | u*B23 | 0xD0*B20 | base.code()*B16 | src.code()*B12 | | 1939 if ((offset % 4) == 0 && (offset / 4) < 256) { |
1900 0xB*B8 | ((offset / 4) & 255)); | 1940 emit(cond | u*B23 | 0xD0*B20 | base.code()*B16 | src.code()*B12 | |
| 1941 0xB*B8 | ((offset / 4) & 255)); |
| 1942 } else { |
| 1943 // Larger offsets must be handled by computing the correct address |
| 1944 // in the ip register. |
| 1945 ASSERT(!base.is(ip)); |
| 1946 mov(ip, Operand(offset)); |
| 1947 if (u == 1) { |
| 1948 add(ip, ip, base); |
| 1949 } else { |
| 1950 sub(ip, base, ip); |
| 1951 } |
| 1952 emit(cond | 0xD0*B20 | ip.code()*B16 | src.code()*B12 | 0xB*B8); |
| 1953 } |
| 1954 } |
| 1955 |
| 1956 |
| 1957 void Assembler::vstr(const DwVfpRegister src, |
| 1958 const MemOperand& operand, |
| 1959 const Condition cond) { |
| 1960 ASSERT(!operand.rm().is_valid()); |
| 1961 ASSERT(operand.am_ == Offset); |
| 1962 vldr(src, operand.rn(), operand.offset(), cond); |
1901 } | 1963 } |
1902 | 1964 |
1903 | 1965 |
1904 void Assembler::vstr(const SwVfpRegister src, | 1966 void Assembler::vstr(const SwVfpRegister src, |
1905 const Register base, | 1967 const Register base, |
1906 int offset, | 1968 int offset, |
1907 const Condition cond) { | 1969 const Condition cond) { |
1908 // MEM(Rbase + offset) = SSrc. | 1970 // MEM(Rbase + offset) = SSrc. |
1909 // Instruction details available in ARM DDI 0406A, A8-786. | 1971 // Instruction details available in ARM DDI 0406A, A8-786. |
1910 // cond(31-28) | 1101(27-24)| U000(23-20) | Rbase(19-16) | | 1972 // cond(31-28) | 1101(27-24)| U000(23-20) | Rbase(19-16) | |
1911 // Vdst(15-12) | 1010(11-8) | (offset/4) | 1973 // Vdst(15-12) | 1010(11-8) | (offset/4) |
1912 ASSERT(CpuFeatures::IsEnabled(VFP3)); | 1974 ASSERT(CpuFeatures::IsEnabled(VFP3)); |
1913 int u = 1; | 1975 int u = 1; |
1914 if (offset < 0) { | 1976 if (offset < 0) { |
1915 offset = -offset; | 1977 offset = -offset; |
1916 u = 0; | 1978 u = 0; |
1917 } | 1979 } |
1918 ASSERT(offset % 4 == 0); | |
1919 ASSERT((offset / 4) < 256); | |
1920 ASSERT(offset >= 0); | |
1921 int sd, d; | 1980 int sd, d; |
1922 src.split_code(&sd, &d); | 1981 src.split_code(&sd, &d); |
1923 emit(cond | u*B23 | d*B22 | 0xD0*B20 | base.code()*B16 | sd*B12 | | 1982 ASSERT(offset >= 0); |
1924 0xA*B8 | ((offset / 4) & 255)); | 1983 if ((offset % 4) == 0 && (offset / 4) < 256) { |
| 1984 emit(cond | u*B23 | d*B22 | 0xD0*B20 | base.code()*B16 | sd*B12 | |
| 1985 0xA*B8 | ((offset / 4) & 255)); |
| 1986 } else { |
| 1987 // Larger offsets must be handled by computing the correct address |
| 1988 // in the ip register. |
| 1989 ASSERT(!base.is(ip)); |
| 1990 mov(ip, Operand(offset)); |
| 1991 if (u == 1) { |
| 1992 add(ip, ip, base); |
| 1993 } else { |
| 1994 sub(ip, base, ip); |
| 1995 } |
| 1996 emit(cond | d*B22 | 0xD0*B20 | ip.code()*B16 | sd*B12 | 0xA*B8); |
| 1997 } |
| 1998 } |
| 1999 |
| 2000 |
| 2001 void Assembler::vstr(const SwVfpRegister src, |
| 2002 const MemOperand& operand, |
| 2003 const Condition cond) { |
| 2004 ASSERT(!operand.rm().is_valid()); |
| 2005 ASSERT(operand.am_ == Offset); |
| 2006 vldr(src, operand.rn(), operand.offset(), cond); |
1925 } | 2007 } |
1926 | 2008 |
1927 | 2009 |
1928 static void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { | 2010 static void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { |
1929 uint64_t i; | 2011 uint64_t i; |
1930 memcpy(&i, &d, 8); | 2012 memcpy(&i, &d, 8); |
1931 | 2013 |
1932 *lo = i & 0xffffffff; | 2014 *lo = i & 0xffffffff; |
1933 *hi = i >> 32; | 2015 *hi = i >> 32; |
1934 } | 2016 } |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 | 2742 |
2661 // Since a constant pool was just emitted, move the check offset forward by | 2743 // Since a constant pool was just emitted, move the check offset forward by |
2662 // the standard interval. | 2744 // the standard interval. |
2663 next_buffer_check_ = pc_offset() + kCheckConstInterval; | 2745 next_buffer_check_ = pc_offset() + kCheckConstInterval; |
2664 } | 2746 } |
2665 | 2747 |
2666 | 2748 |
2667 } } // namespace v8::internal | 2749 } } // namespace v8::internal |
2668 | 2750 |
2669 #endif // V8_TARGET_ARCH_ARM | 2751 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |