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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2728 CHECK(0); | 2728 CHECK(0); |
2729 } | 2729 } |
2730 } | 2730 } |
2731 } | 2731 } |
2732 | 2732 |
2733 if (bd == PROTECT) { | 2733 if (bd == PROTECT) { |
2734 nop(); | 2734 nop(); |
2735 } | 2735 } |
2736 } | 2736 } |
2737 | 2737 |
| 2738 void MacroAssembler::BranchMSA(Label* target, MSABranchDF df, |
| 2739 MSABranchCondition cond, MSARegister wt, |
| 2740 BranchDelaySlot bd) { |
| 2741 { |
| 2742 BlockTrampolinePoolScope block_trampoline_pool(this); |
| 2743 |
| 2744 if (target) { |
| 2745 bool long_branch = |
| 2746 target->is_bound() ? !is_near(target) : is_trampoline_emitted(); |
| 2747 if (long_branch) { |
| 2748 Label skip; |
| 2749 MSABranchCondition neg_cond = NegateMSABranchCondition(cond); |
| 2750 BranchShortMSA(df, &skip, neg_cond, wt, bd); |
| 2751 BranchLong(target, bd); |
| 2752 bind(&skip); |
| 2753 } else { |
| 2754 BranchShortMSA(df, target, cond, wt, bd); |
| 2755 } |
| 2756 } |
| 2757 } |
| 2758 } |
| 2759 |
| 2760 void MacroAssembler::BranchShortMSA(MSABranchDF df, Label* target, |
| 2761 MSABranchCondition cond, MSARegister wt, |
| 2762 BranchDelaySlot bd) { |
| 2763 if (kArchVariant == kMips64r6) { |
| 2764 BlockTrampolinePoolScope block_trampoline_pool(this); |
| 2765 if (target) { |
| 2766 switch (cond) { |
| 2767 case all_not_zero: |
| 2768 switch (df) { |
| 2769 case MSA_BRANCH_D: |
| 2770 bnz_d(wt, target); |
| 2771 break; |
| 2772 case MSA_BRANCH_W: |
| 2773 bnz_w(wt, target); |
| 2774 break; |
| 2775 case MSA_BRANCH_H: |
| 2776 bnz_h(wt, target); |
| 2777 break; |
| 2778 case MSA_BRANCH_B: |
| 2779 default: |
| 2780 bnz_b(wt, target); |
| 2781 } |
| 2782 break; |
| 2783 case one_elem_not_zero: |
| 2784 bnz_v(wt, target); |
| 2785 break; |
| 2786 case one_elem_zero: |
| 2787 switch (df) { |
| 2788 case MSA_BRANCH_D: |
| 2789 bz_d(wt, target); |
| 2790 break; |
| 2791 case MSA_BRANCH_W: |
| 2792 bz_w(wt, target); |
| 2793 break; |
| 2794 case MSA_BRANCH_H: |
| 2795 bz_h(wt, target); |
| 2796 break; |
| 2797 case MSA_BRANCH_B: |
| 2798 default: |
| 2799 bz_b(wt, target); |
| 2800 } |
| 2801 break; |
| 2802 case all_zero: |
| 2803 bz_v(wt, target); |
| 2804 break; |
| 2805 default: |
| 2806 UNREACHABLE(); |
| 2807 } |
| 2808 } |
| 2809 } |
| 2810 if (bd == PROTECT) { |
| 2811 nop(); |
| 2812 } |
| 2813 } |
2738 | 2814 |
2739 void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) { | 2815 void MacroAssembler::FmoveLow(FPURegister dst, Register src_low) { |
2740 DCHECK(!src_low.is(at)); | 2816 DCHECK(!src_low.is(at)); |
2741 mfhc1(at, dst); | 2817 mfhc1(at, dst); |
2742 mtc1(src_low, dst); | 2818 mtc1(src_low, dst); |
2743 mthc1(at, dst); | 2819 mthc1(at, dst); |
2744 } | 2820 } |
2745 | 2821 |
2746 | 2822 |
2747 void MacroAssembler::Move(FPURegister dst, float imm) { | 2823 void MacroAssembler::Move(FPURegister dst, float imm) { |
(...skipping 4332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7080 if (mag.shift > 0) sra(result, result, mag.shift); | 7156 if (mag.shift > 0) sra(result, result, mag.shift); |
7081 srl(at, dividend, 31); | 7157 srl(at, dividend, 31); |
7082 Addu(result, result, Operand(at)); | 7158 Addu(result, result, Operand(at)); |
7083 } | 7159 } |
7084 | 7160 |
7085 | 7161 |
7086 } // namespace internal | 7162 } // namespace internal |
7087 } // namespace v8 | 7163 } // namespace v8 |
7088 | 7164 |
7089 #endif // V8_TARGET_ARCH_MIPS64 | 7165 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |