| 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 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2213 void Assembler::lwc1(FPURegister fd, const MemOperand& src) { | 2213 void Assembler::lwc1(FPURegister fd, const MemOperand& src) { |
| 2214 if (is_int16(src.offset_)) { | 2214 if (is_int16(src.offset_)) { |
| 2215 GenInstrImmediate(LWC1, src.rm(), fd, src.offset_); | 2215 GenInstrImmediate(LWC1, src.rm(), fd, src.offset_); |
| 2216 } else { // Offset > 16 bits, use multiple instructions to load. | 2216 } else { // Offset > 16 bits, use multiple instructions to load. |
| 2217 int32_t off16 = LoadRegPlusUpperOffsetPartToAt(src); | 2217 int32_t off16 = LoadRegPlusUpperOffsetPartToAt(src); |
| 2218 GenInstrImmediate(LWC1, at, fd, off16); | 2218 GenInstrImmediate(LWC1, at, fd, off16); |
| 2219 } | 2219 } |
| 2220 } | 2220 } |
| 2221 | 2221 |
| 2222 | 2222 |
| 2223 void Assembler::ldc1(FPURegister fd, const MemOperand& src) { | |
| 2224 // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit | |
| 2225 // load to two 32-bit loads. | |
| 2226 if (IsFp32Mode()) { // fp32 mode. | |
| 2227 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
| 2228 GenInstrImmediate(LWC1, src.rm(), fd, | |
| 2229 src.offset_ + Register::kMantissaOffset); | |
| 2230 FPURegister nextfpreg; | |
| 2231 nextfpreg.setcode(fd.code() + 1); | |
| 2232 GenInstrImmediate(LWC1, src.rm(), nextfpreg, | |
| 2233 src.offset_ + Register::kExponentOffset); | |
| 2234 } else { // Offset > 16 bits, use multiple instructions to load. | |
| 2235 int32_t off16 = LoadUpperOffsetForTwoMemoryAccesses(src); | |
| 2236 GenInstrImmediate(LWC1, at, fd, off16 + Register::kMantissaOffset); | |
| 2237 FPURegister nextfpreg; | |
| 2238 nextfpreg.setcode(fd.code() + 1); | |
| 2239 GenInstrImmediate(LWC1, at, nextfpreg, off16 + Register::kExponentOffset); | |
| 2240 } | |
| 2241 } else { | |
| 2242 DCHECK(IsFp64Mode() || IsFpxxMode()); | |
| 2243 // Currently we support FPXX and FP64 on Mips32r2 and Mips32r6 | |
| 2244 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | |
| 2245 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
| 2246 GenInstrImmediate(LWC1, src.rm(), fd, | |
| 2247 src.offset_ + Register::kMantissaOffset); | |
| 2248 GenInstrImmediate(LW, src.rm(), at, | |
| 2249 src.offset_ + Register::kExponentOffset); | |
| 2250 mthc1(at, fd); | |
| 2251 } else { // Offset > 16 bits, use multiple instructions to load. | |
| 2252 int32_t off16 = LoadUpperOffsetForTwoMemoryAccesses(src); | |
| 2253 GenInstrImmediate(LWC1, at, fd, off16 + Register::kMantissaOffset); | |
| 2254 GenInstrImmediate(LW, at, at, off16 + Register::kExponentOffset); | |
| 2255 mthc1(at, fd); | |
| 2256 } | |
| 2257 } | |
| 2258 } | |
| 2259 | |
| 2260 | |
| 2261 void Assembler::swc1(FPURegister fd, const MemOperand& src) { | 2223 void Assembler::swc1(FPURegister fd, const MemOperand& src) { |
| 2262 if (is_int16(src.offset_)) { | 2224 if (is_int16(src.offset_)) { |
| 2263 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); | 2225 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); |
| 2264 } else { // Offset > 16 bits, use multiple instructions to load. | 2226 } else { // Offset > 16 bits, use multiple instructions to load. |
| 2265 int32_t off16 = LoadRegPlusUpperOffsetPartToAt(src); | 2227 int32_t off16 = LoadRegPlusUpperOffsetPartToAt(src); |
| 2266 GenInstrImmediate(SWC1, at, fd, off16); | 2228 GenInstrImmediate(SWC1, at, fd, off16); |
| 2267 } | 2229 } |
| 2268 } | 2230 } |
| 2269 | 2231 |
| 2270 | 2232 |
| 2271 void Assembler::sdc1(FPURegister fd, const MemOperand& src) { | |
| 2272 // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit | |
| 2273 // store to two 32-bit stores. | |
| 2274 DCHECK(!src.rm().is(at)); | |
| 2275 DCHECK(!src.rm().is(t8)); | |
| 2276 if (IsFp32Mode()) { // fp32 mode. | |
| 2277 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
| 2278 GenInstrImmediate(SWC1, src.rm(), fd, | |
| 2279 src.offset_ + Register::kMantissaOffset); | |
| 2280 FPURegister nextfpreg; | |
| 2281 nextfpreg.setcode(fd.code() + 1); | |
| 2282 GenInstrImmediate(SWC1, src.rm(), nextfpreg, | |
| 2283 src.offset_ + Register::kExponentOffset); | |
| 2284 } else { // Offset > 16 bits, use multiple instructions to load. | |
| 2285 int32_t off16 = LoadUpperOffsetForTwoMemoryAccesses(src); | |
| 2286 GenInstrImmediate(SWC1, at, fd, off16 + Register::kMantissaOffset); | |
| 2287 FPURegister nextfpreg; | |
| 2288 nextfpreg.setcode(fd.code() + 1); | |
| 2289 GenInstrImmediate(SWC1, at, nextfpreg, off16 + Register::kExponentOffset); | |
| 2290 } | |
| 2291 } else { | |
| 2292 DCHECK(IsFp64Mode() || IsFpxxMode()); | |
| 2293 // Currently we support FPXX and FP64 on Mips32r2 and Mips32r6 | |
| 2294 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | |
| 2295 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
| 2296 GenInstrImmediate(SWC1, src.rm(), fd, | |
| 2297 src.offset_ + Register::kMantissaOffset); | |
| 2298 mfhc1(at, fd); | |
| 2299 GenInstrImmediate(SW, src.rm(), at, | |
| 2300 src.offset_ + Register::kExponentOffset); | |
| 2301 } else { // Offset > 16 bits, use multiple instructions to load. | |
| 2302 int32_t off16 = LoadUpperOffsetForTwoMemoryAccesses(src); | |
| 2303 GenInstrImmediate(SWC1, at, fd, off16 + Register::kMantissaOffset); | |
| 2304 mfhc1(t8, fd); | |
| 2305 GenInstrImmediate(SW, at, t8, off16 + Register::kExponentOffset); | |
| 2306 } | |
| 2307 } | |
| 2308 } | |
| 2309 | |
| 2310 | |
| 2311 void Assembler::mtc1(Register rt, FPURegister fs) { | 2233 void Assembler::mtc1(Register rt, FPURegister fs) { |
| 2312 GenInstrRegister(COP1, MTC1, rt, fs, f0); | 2234 GenInstrRegister(COP1, MTC1, rt, fs, f0); |
| 2313 } | 2235 } |
| 2314 | 2236 |
| 2315 | 2237 |
| 2316 void Assembler::mthc1(Register rt, FPURegister fs) { | 2238 void Assembler::mthc1(Register rt, FPURegister fs) { |
| 2317 GenInstrRegister(COP1, MTHC1, rt, fs, f0); | 2239 GenInstrRegister(COP1, MTHC1, rt, fs, f0); |
| 2318 } | 2240 } |
| 2319 | 2241 |
| 2320 | 2242 |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3270 | 3192 |
| 3271 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3193 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 3272 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); | 3194 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); |
| 3273 } | 3195 } |
| 3274 } | 3196 } |
| 3275 | 3197 |
| 3276 } // namespace internal | 3198 } // namespace internal |
| 3277 } // namespace v8 | 3199 } // namespace v8 |
| 3278 | 3200 |
| 3279 #endif // V8_TARGET_ARCH_MIPS | 3201 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |