OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2309 default: | 2309 default: |
2310 CHECK(0); | 2310 CHECK(0); |
2311 } | 2311 } |
2312 } | 2312 } |
2313 } | 2313 } |
2314 if (bd == PROTECT) { | 2314 if (bd == PROTECT) { |
2315 nop(); | 2315 nop(); |
2316 } | 2316 } |
2317 } | 2317 } |
2318 | 2318 |
| 2319 void MacroAssembler::BranchMSA(Label* target, MSABranchDF df, |
| 2320 MSABranchCondition cond, MSARegister wt, |
| 2321 BranchDelaySlot bd) { |
| 2322 { |
| 2323 BlockTrampolinePoolScope block_trampoline_pool(this); |
| 2324 |
| 2325 if (target) { |
| 2326 bool long_branch = |
| 2327 target->is_bound() ? !is_near(target) : is_trampoline_emitted(); |
| 2328 if (long_branch) { |
| 2329 Label skip; |
| 2330 MSABranchCondition neg_cond = NegateMSABranchCondition(cond); |
| 2331 BranchShortMSA(df, &skip, neg_cond, wt, bd); |
| 2332 BranchLong(target, bd); |
| 2333 bind(&skip); |
| 2334 } else { |
| 2335 BranchShortMSA(df, target, cond, wt, bd); |
| 2336 } |
| 2337 } |
| 2338 } |
| 2339 } |
| 2340 |
| 2341 void MacroAssembler::BranchShortMSA(MSABranchDF df, Label* target, |
| 2342 MSABranchCondition cond, MSARegister wt, |
| 2343 BranchDelaySlot bd) { |
| 2344 if (IsMipsArchVariant(kMips32r6)) { |
| 2345 BlockTrampolinePoolScope block_trampoline_pool(this); |
| 2346 if (target) { |
| 2347 switch (cond) { |
| 2348 case all_not_zero: |
| 2349 switch (df) { |
| 2350 case MSA_BRANCH_D: |
| 2351 bnz_d(wt, target); |
| 2352 break; |
| 2353 case MSA_BRANCH_W: |
| 2354 bnz_w(wt, target); |
| 2355 break; |
| 2356 case MSA_BRANCH_H: |
| 2357 bnz_h(wt, target); |
| 2358 break; |
| 2359 case MSA_BRANCH_B: |
| 2360 default: |
| 2361 bnz_b(wt, target); |
| 2362 } |
| 2363 break; |
| 2364 case one_elem_not_zero: |
| 2365 bnz_v(wt, target); |
| 2366 break; |
| 2367 case one_elem_zero: |
| 2368 switch (df) { |
| 2369 case MSA_BRANCH_D: |
| 2370 bz_d(wt, target); |
| 2371 break; |
| 2372 case MSA_BRANCH_W: |
| 2373 bz_w(wt, target); |
| 2374 break; |
| 2375 case MSA_BRANCH_H: |
| 2376 bz_h(wt, target); |
| 2377 break; |
| 2378 case MSA_BRANCH_B: |
| 2379 default: |
| 2380 bz_b(wt, target); |
| 2381 } |
| 2382 break; |
| 2383 case all_zero: |
| 2384 bz_v(wt, target); |
| 2385 break; |
| 2386 default: |
| 2387 UNREACHABLE(); |
| 2388 } |
| 2389 } |
| 2390 } |
| 2391 if (bd == PROTECT) { |
| 2392 nop(); |
| 2393 } |
| 2394 } |
2319 | 2395 |
2320 void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) { | 2396 void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) { |
2321 if (IsFp32Mode()) { | 2397 if (IsFp32Mode()) { |
2322 mtc1(src_low, dst); | 2398 mtc1(src_low, dst); |
2323 } else { | 2399 } else { |
2324 DCHECK(IsFp64Mode() || IsFpxxMode()); | 2400 DCHECK(IsFp64Mode() || IsFpxxMode()); |
2325 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | 2401 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); |
2326 DCHECK(!src_low.is(at)); | 2402 DCHECK(!src_low.is(at)); |
2327 mfhc1(at, dst); | 2403 mfhc1(at, dst); |
2328 mtc1(src_low, dst); | 2404 mtc1(src_low, dst); |
(...skipping 4305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6634 if (mag.shift > 0) sra(result, result, mag.shift); | 6710 if (mag.shift > 0) sra(result, result, mag.shift); |
6635 srl(at, dividend, 31); | 6711 srl(at, dividend, 31); |
6636 Addu(result, result, Operand(at)); | 6712 Addu(result, result, Operand(at)); |
6637 } | 6713 } |
6638 | 6714 |
6639 | 6715 |
6640 } // namespace internal | 6716 } // namespace internal |
6641 } // namespace v8 | 6717 } // namespace v8 |
6642 | 6718 |
6643 #endif // V8_TARGET_ARCH_MIPS | 6719 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |