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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 } | 1896 } |
1897 | 1897 |
1898 | 1898 |
1899 void Assembler::movf(Register rd, Register rs, uint16_t cc) { | 1899 void Assembler::movf(Register rd, Register rs, uint16_t cc) { |
1900 Register rt; | 1900 Register rt; |
1901 rt.code_ = (cc & 0x0007) << 2 | 0; | 1901 rt.code_ = (cc & 0x0007) << 2 | 0; |
1902 GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVCI); | 1902 GenInstrRegister(SPECIAL, rs, rt, rd, 0, MOVCI); |
1903 } | 1903 } |
1904 | 1904 |
1905 | 1905 |
| 1906 void Assembler::sel(SecondaryField fmt, FPURegister fd, FPURegister fs, |
| 1907 FPURegister ft) { |
| 1908 DCHECK(IsMipsArchVariant(kMips32r6)); |
| 1909 DCHECK((fmt == D) || (fmt == S)); |
| 1910 |
| 1911 Instr instr = COP1 | fmt << kRsShift | ft.code() << kFtShift | |
| 1912 fs.code() << kFsShift | fd.code() << kFdShift | SEL; |
| 1913 emit(instr); |
| 1914 } |
| 1915 |
| 1916 |
1906 void Assembler::seleqz(Register rd, Register rs, Register rt) { | 1917 void Assembler::seleqz(Register rd, Register rs, Register rt) { |
1907 DCHECK(IsMipsArchVariant(kMips32r6)); | 1918 DCHECK(IsMipsArchVariant(kMips32r6)); |
1908 GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELEQZ_S); | 1919 GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELEQZ_S); |
1909 } | 1920 } |
1910 | 1921 |
1911 | 1922 |
| 1923 void Assembler::seleqz(SecondaryField fmt, FPURegister fd, FPURegister fs, |
| 1924 FPURegister ft) { |
| 1925 DCHECK(IsMipsArchVariant(kMips32r6)); |
| 1926 DCHECK((fmt == D) || (fmt == S)); |
| 1927 GenInstrRegister(COP1, fmt, ft, fs, fd, SELEQZ_C); |
| 1928 } |
| 1929 |
| 1930 |
| 1931 void Assembler::selnez(Register rd, Register rs, Register rt) { |
| 1932 DCHECK(IsMipsArchVariant(kMips32r6)); |
| 1933 GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELNEZ_S); |
| 1934 } |
| 1935 |
| 1936 |
| 1937 void Assembler::selnez(SecondaryField fmt, FPURegister fd, FPURegister fs, |
| 1938 FPURegister ft) { |
| 1939 DCHECK(IsMipsArchVariant(kMips32r6)); |
| 1940 DCHECK((fmt == D) || (fmt == S)); |
| 1941 GenInstrRegister(COP1, fmt, ft, fs, fd, SELNEZ_C); |
| 1942 } |
| 1943 |
| 1944 |
1912 // Bit twiddling. | 1945 // Bit twiddling. |
1913 void Assembler::clz(Register rd, Register rs) { | 1946 void Assembler::clz(Register rd, Register rs) { |
1914 if (!IsMipsArchVariant(kMips32r6)) { | 1947 if (!IsMipsArchVariant(kMips32r6)) { |
1915 // Clz instr requires same GPR number in 'rd' and 'rt' fields. | 1948 // Clz instr requires same GPR number in 'rd' and 'rt' fields. |
1916 GenInstrRegister(SPECIAL2, rs, rd, rd, 0, CLZ); | 1949 GenInstrRegister(SPECIAL2, rs, rd, rd, 0, CLZ); |
1917 } else { | 1950 } else { |
1918 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, CLZ_R6); | 1951 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, CLZ_R6); |
1919 } | 1952 } |
1920 } | 1953 } |
1921 | 1954 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 | 2103 |
2071 void Assembler::DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { | 2104 void Assembler::DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { |
2072 uint64_t i; | 2105 uint64_t i; |
2073 memcpy(&i, &d, 8); | 2106 memcpy(&i, &d, 8); |
2074 | 2107 |
2075 *lo = i & 0xffffffff; | 2108 *lo = i & 0xffffffff; |
2076 *hi = i >> 32; | 2109 *hi = i >> 32; |
2077 } | 2110 } |
2078 | 2111 |
2079 | 2112 |
2080 void Assembler::movn_s(FPURegister fd, FPURegister fs, Register rt) { | |
2081 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2082 GenInstrRegister(COP1, S, rt, fs, fd, MOVN_C); | |
2083 } | |
2084 | |
2085 | |
2086 void Assembler::movn_d(FPURegister fd, FPURegister fs, Register rt) { | |
2087 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2088 GenInstrRegister(COP1, D, rt, fs, fd, MOVN_C); | |
2089 } | |
2090 | |
2091 | |
2092 void Assembler::sel(SecondaryField fmt, FPURegister fd, FPURegister fs, | |
2093 FPURegister ft) { | |
2094 DCHECK(IsMipsArchVariant(kMips32r6)); | |
2095 DCHECK((fmt == D) || (fmt == S)); | |
2096 | |
2097 GenInstrRegister(COP1, fmt, ft, fs, fd, SEL); | |
2098 } | |
2099 | |
2100 | |
2101 void Assembler::sel_s(FPURegister fd, FPURegister fs, FPURegister ft) { | |
2102 sel(S, fd, fs, ft); | |
2103 } | |
2104 | |
2105 | |
2106 void Assembler::sel_d(FPURegister fd, FPURegister fs, FPURegister ft) { | |
2107 sel(D, fd, fs, ft); | |
2108 } | |
2109 | |
2110 | |
2111 void Assembler::seleqz(SecondaryField fmt, FPURegister fd, FPURegister fs, | |
2112 FPURegister ft) { | |
2113 DCHECK(IsMipsArchVariant(kMips32r6)); | |
2114 DCHECK((fmt == D) || (fmt == S)); | |
2115 GenInstrRegister(COP1, fmt, ft, fs, fd, SELEQZ_C); | |
2116 } | |
2117 | |
2118 | |
2119 void Assembler::selnez(Register rd, Register rs, Register rt) { | |
2120 DCHECK(IsMipsArchVariant(kMips32r6)); | |
2121 GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELNEZ_S); | |
2122 } | |
2123 | |
2124 | |
2125 void Assembler::selnez(SecondaryField fmt, FPURegister fd, FPURegister fs, | |
2126 FPURegister ft) { | |
2127 DCHECK(IsMipsArchVariant(kMips32r6)); | |
2128 DCHECK((fmt == D) || (fmt == S)); | |
2129 GenInstrRegister(COP1, fmt, ft, fs, fd, SELNEZ_C); | |
2130 } | |
2131 | |
2132 | |
2133 void Assembler::seleqz_d(FPURegister fd, FPURegister fs, FPURegister ft) { | |
2134 seleqz(D, fd, fs, ft); | |
2135 } | |
2136 | |
2137 | |
2138 void Assembler::seleqz_s(FPURegister fd, FPURegister fs, FPURegister ft) { | |
2139 seleqz(S, fd, fs, ft); | |
2140 } | |
2141 | |
2142 | |
2143 void Assembler::selnez_d(FPURegister fd, FPURegister fs, FPURegister ft) { | |
2144 selnez(D, fd, fs, ft); | |
2145 } | |
2146 | |
2147 | |
2148 void Assembler::selnez_s(FPURegister fd, FPURegister fs, FPURegister ft) { | |
2149 selnez(S, fd, fs, ft); | |
2150 } | |
2151 | |
2152 | |
2153 void Assembler::movz_s(FPURegister fd, FPURegister fs, Register rt) { | |
2154 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2155 GenInstrRegister(COP1, S, rt, fs, fd, MOVZ_C); | |
2156 } | |
2157 | |
2158 | |
2159 void Assembler::movz_d(FPURegister fd, FPURegister fs, Register rt) { | |
2160 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2161 GenInstrRegister(COP1, D, rt, fs, fd, MOVZ_C); | |
2162 } | |
2163 | |
2164 | |
2165 void Assembler::movt_s(FPURegister fd, FPURegister fs, uint16_t cc) { | |
2166 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2167 FPURegister ft; | |
2168 ft.code_ = (cc & 0x0007) << 2 | 1; | |
2169 GenInstrRegister(COP1, S, ft, fs, fd, MOVF); | |
2170 } | |
2171 | |
2172 | |
2173 void Assembler::movt_d(FPURegister fd, FPURegister fs, uint16_t cc) { | |
2174 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2175 FPURegister ft; | |
2176 ft.code_ = (cc & 0x0007) << 2 | 1; | |
2177 GenInstrRegister(COP1, D, ft, fs, fd, MOVF); | |
2178 } | |
2179 | |
2180 | |
2181 void Assembler::movf_s(FPURegister fd, FPURegister fs, uint16_t cc) { | |
2182 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2183 FPURegister ft; | |
2184 ft.code_ = (cc & 0x0007) << 2 | 0; | |
2185 GenInstrRegister(COP1, S, ft, fs, fd, MOVF); | |
2186 } | |
2187 | |
2188 | |
2189 void Assembler::movf_d(FPURegister fd, FPURegister fs, uint16_t cc) { | |
2190 DCHECK(IsMipsArchVariant(kMips32r2)); | |
2191 FPURegister ft; | |
2192 ft.code_ = (cc & 0x0007) << 2 | 0; | |
2193 GenInstrRegister(COP1, D, ft, fs, fd, MOVF); | |
2194 } | |
2195 | |
2196 | |
2197 // Arithmetic. | 2113 // Arithmetic. |
2198 | 2114 |
2199 void Assembler::add_s(FPURegister fd, FPURegister fs, FPURegister ft) { | 2115 void Assembler::add_s(FPURegister fd, FPURegister fs, FPURegister ft) { |
2200 GenInstrRegister(COP1, S, ft, fs, fd, ADD_S); | 2116 GenInstrRegister(COP1, S, ft, fs, fd, ADD_D); |
2201 } | 2117 } |
2202 | 2118 |
2203 | 2119 |
2204 void Assembler::add_d(FPURegister fd, FPURegister fs, FPURegister ft) { | 2120 void Assembler::add_d(FPURegister fd, FPURegister fs, FPURegister ft) { |
2205 GenInstrRegister(COP1, D, ft, fs, fd, ADD_D); | 2121 GenInstrRegister(COP1, D, ft, fs, fd, ADD_D); |
2206 } | 2122 } |
2207 | 2123 |
2208 | 2124 |
2209 void Assembler::sub_s(FPURegister fd, FPURegister fs, FPURegister ft) { | 2125 void Assembler::sub_s(FPURegister fd, FPURegister fs, FPURegister ft) { |
2210 GenInstrRegister(COP1, S, ft, fs, fd, SUB_S); | 2126 GenInstrRegister(COP1, S, ft, fs, fd, SUB_D); |
2211 } | 2127 } |
2212 | 2128 |
2213 | 2129 |
2214 void Assembler::sub_d(FPURegister fd, FPURegister fs, FPURegister ft) { | 2130 void Assembler::sub_d(FPURegister fd, FPURegister fs, FPURegister ft) { |
2215 GenInstrRegister(COP1, D, ft, fs, fd, SUB_D); | 2131 GenInstrRegister(COP1, D, ft, fs, fd, SUB_D); |
2216 } | 2132 } |
2217 | 2133 |
2218 | 2134 |
2219 void Assembler::mul_s(FPURegister fd, FPURegister fs, FPURegister ft) { | 2135 void Assembler::mul_s(FPURegister fd, FPURegister fs, FPURegister ft) { |
2220 GenInstrRegister(COP1, S, ft, fs, fd, MUL_S); | 2136 GenInstrRegister(COP1, S, ft, fs, fd, MUL_D); |
2221 } | 2137 } |
2222 | 2138 |
2223 | 2139 |
2224 void Assembler::mul_d(FPURegister fd, FPURegister fs, FPURegister ft) { | 2140 void Assembler::mul_d(FPURegister fd, FPURegister fs, FPURegister ft) { |
2225 GenInstrRegister(COP1, D, ft, fs, fd, MUL_D); | 2141 GenInstrRegister(COP1, D, ft, fs, fd, MUL_D); |
2226 } | 2142 } |
2227 | 2143 |
2228 | 2144 |
2229 void Assembler::madd_d(FPURegister fd, FPURegister fr, FPURegister fs, | 2145 void Assembler::madd_d(FPURegister fd, FPURegister fr, FPURegister fs, |
2230 FPURegister ft) { | 2146 FPURegister ft) { |
2231 DCHECK(IsMipsArchVariant(kMips32r2)); | 2147 DCHECK(IsMipsArchVariant(kMips32r2)); |
2232 GenInstrRegister(COP1X, fr, ft, fs, fd, MADD_D); | 2148 GenInstrRegister(COP1X, fr, ft, fs, fd, MADD_D); |
2233 } | 2149 } |
2234 | 2150 |
2235 | 2151 |
2236 void Assembler::div_s(FPURegister fd, FPURegister fs, FPURegister ft) { | 2152 void Assembler::div_s(FPURegister fd, FPURegister fs, FPURegister ft) { |
2237 GenInstrRegister(COP1, S, ft, fs, fd, DIV_S); | 2153 GenInstrRegister(COP1, S, ft, fs, fd, DIV_D); |
2238 } | 2154 } |
2239 | 2155 |
2240 | 2156 |
2241 void Assembler::div_d(FPURegister fd, FPURegister fs, FPURegister ft) { | 2157 void Assembler::div_d(FPURegister fd, FPURegister fs, FPURegister ft) { |
2242 GenInstrRegister(COP1, D, ft, fs, fd, DIV_D); | 2158 GenInstrRegister(COP1, D, ft, fs, fd, DIV_D); |
2243 } | 2159 } |
2244 | 2160 |
2245 | 2161 |
2246 void Assembler::abs_s(FPURegister fd, FPURegister fs) { | 2162 void Assembler::abs_s(FPURegister fd, FPURegister fs) { |
2247 GenInstrRegister(COP1, S, f0, fs, fd, ABS_S); | 2163 GenInstrRegister(COP1, S, f0, fs, fd, ABS_D); |
2248 } | 2164 } |
2249 | 2165 |
2250 | 2166 |
2251 void Assembler::abs_d(FPURegister fd, FPURegister fs) { | 2167 void Assembler::abs_d(FPURegister fd, FPURegister fs) { |
2252 GenInstrRegister(COP1, D, f0, fs, fd, ABS_D); | 2168 GenInstrRegister(COP1, D, f0, fs, fd, ABS_D); |
2253 } | 2169 } |
2254 | 2170 |
2255 | 2171 |
2256 void Assembler::mov_d(FPURegister fd, FPURegister fs) { | 2172 void Assembler::mov_d(FPURegister fd, FPURegister fs) { |
2257 GenInstrRegister(COP1, D, f0, fs, fd, MOV_S); | 2173 GenInstrRegister(COP1, D, f0, fs, fd, MOV_D); |
2258 } | |
2259 | |
2260 | |
2261 void Assembler::mov_s(FPURegister fd, FPURegister fs) { | |
2262 GenInstrRegister(COP1, S, f0, fs, fd, MOV_D); | |
2263 } | 2174 } |
2264 | 2175 |
2265 | 2176 |
2266 void Assembler::neg_s(FPURegister fd, FPURegister fs) { | 2177 void Assembler::neg_s(FPURegister fd, FPURegister fs) { |
2267 GenInstrRegister(COP1, S, f0, fs, fd, NEG_S); | 2178 GenInstrRegister(COP1, S, f0, fs, fd, NEG_D); |
2268 } | 2179 } |
2269 | 2180 |
2270 | 2181 |
2271 void Assembler::neg_d(FPURegister fd, FPURegister fs) { | 2182 void Assembler::neg_d(FPURegister fd, FPURegister fs) { |
2272 GenInstrRegister(COP1, D, f0, fs, fd, NEG_D); | 2183 GenInstrRegister(COP1, D, f0, fs, fd, NEG_D); |
2273 } | 2184 } |
2274 | 2185 |
2275 | 2186 |
2276 void Assembler::sqrt_s(FPURegister fd, FPURegister fs) { | 2187 void Assembler::sqrt_s(FPURegister fd, FPURegister fs) { |
2277 GenInstrRegister(COP1, S, f0, fs, fd, SQRT_S); | 2188 GenInstrRegister(COP1, S, f0, fs, fd, SQRT_D); |
2278 } | 2189 } |
2279 | 2190 |
2280 | 2191 |
2281 void Assembler::sqrt_d(FPURegister fd, FPURegister fs) { | 2192 void Assembler::sqrt_d(FPURegister fd, FPURegister fs) { |
2282 GenInstrRegister(COP1, D, f0, fs, fd, SQRT_D); | 2193 GenInstrRegister(COP1, D, f0, fs, fd, SQRT_D); |
2283 } | 2194 } |
2284 | 2195 |
2285 | 2196 |
2286 void Assembler::rsqrt_s(FPURegister fd, FPURegister fs) { | |
2287 GenInstrRegister(COP1, S, f0, fs, fd, RSQRT_S); | |
2288 } | |
2289 | |
2290 | |
2291 void Assembler::rsqrt_d(FPURegister fd, FPURegister fs) { | |
2292 GenInstrRegister(COP1, D, f0, fs, fd, RSQRT_D); | |
2293 } | |
2294 | |
2295 | |
2296 void Assembler::recip_d(FPURegister fd, FPURegister fs) { | |
2297 GenInstrRegister(COP1, D, f0, fs, fd, RECIP_D); | |
2298 } | |
2299 | |
2300 | |
2301 void Assembler::recip_s(FPURegister fd, FPURegister fs) { | |
2302 GenInstrRegister(COP1, S, f0, fs, fd, RECIP_S); | |
2303 } | |
2304 | |
2305 | |
2306 // Conversions. | 2197 // Conversions. |
2307 | 2198 |
2308 void Assembler::cvt_w_s(FPURegister fd, FPURegister fs) { | 2199 void Assembler::cvt_w_s(FPURegister fd, FPURegister fs) { |
2309 GenInstrRegister(COP1, S, f0, fs, fd, CVT_W_S); | 2200 GenInstrRegister(COP1, S, f0, fs, fd, CVT_W_S); |
2310 } | 2201 } |
2311 | 2202 |
2312 | 2203 |
2313 void Assembler::cvt_w_d(FPURegister fd, FPURegister fs) { | 2204 void Assembler::cvt_w_d(FPURegister fd, FPURegister fs) { |
2314 GenInstrRegister(COP1, D, f0, fs, fd, CVT_W_D); | 2205 GenInstrRegister(COP1, D, f0, fs, fd, CVT_W_D); |
2315 } | 2206 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 void Assembler::ceil_w_d(FPURegister fd, FPURegister fs) { | 2244 void Assembler::ceil_w_d(FPURegister fd, FPURegister fs) { |
2354 GenInstrRegister(COP1, D, f0, fs, fd, CEIL_W_D); | 2245 GenInstrRegister(COP1, D, f0, fs, fd, CEIL_W_D); |
2355 } | 2246 } |
2356 | 2247 |
2357 | 2248 |
2358 void Assembler::rint_s(FPURegister fd, FPURegister fs) { rint(S, fd, fs); } | 2249 void Assembler::rint_s(FPURegister fd, FPURegister fs) { rint(S, fd, fs); } |
2359 | 2250 |
2360 | 2251 |
2361 void Assembler::rint(SecondaryField fmt, FPURegister fd, FPURegister fs) { | 2252 void Assembler::rint(SecondaryField fmt, FPURegister fd, FPURegister fs) { |
2362 DCHECK(IsMipsArchVariant(kMips32r6)); | 2253 DCHECK(IsMipsArchVariant(kMips32r6)); |
2363 DCHECK((fmt == D) || (fmt == S)); | |
2364 GenInstrRegister(COP1, fmt, f0, fs, fd, RINT); | 2254 GenInstrRegister(COP1, fmt, f0, fs, fd, RINT); |
2365 } | 2255 } |
2366 | 2256 |
2367 | 2257 |
2368 void Assembler::rint_d(FPURegister fd, FPURegister fs) { rint(D, fd, fs); } | 2258 void Assembler::rint_d(FPURegister fd, FPURegister fs) { rint(D, fd, fs); } |
2369 | 2259 |
2370 | 2260 |
2371 void Assembler::cvt_l_s(FPURegister fd, FPURegister fs) { | 2261 void Assembler::cvt_l_s(FPURegister fd, FPURegister fs) { |
2372 DCHECK(IsMipsArchVariant(kMips32r2)); | 2262 DCHECK(IsMipsArchVariant(kMips32r2)); |
2373 GenInstrRegister(COP1, S, f0, fs, fd, CVT_L_S); | 2263 GenInstrRegister(COP1, S, f0, fs, fd, CVT_L_S); |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2993 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { | 2883 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { |
2994 // No out-of-line constant pool support. | 2884 // No out-of-line constant pool support. |
2995 DCHECK(!FLAG_enable_ool_constant_pool); | 2885 DCHECK(!FLAG_enable_ool_constant_pool); |
2996 return; | 2886 return; |
2997 } | 2887 } |
2998 | 2888 |
2999 | 2889 |
3000 } } // namespace v8::internal | 2890 } } // namespace v8::internal |
3001 | 2891 |
3002 #endif // V8_TARGET_ARCH_MIPS | 2892 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |