| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
| 6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 } else { | 796 } else { |
| 797 SetRoundingMode(rounding_mode); | 797 SetRoundingMode(rounding_mode); |
| 798 fctidu(double_dst, double_input); | 798 fctidu(double_dst, double_input); |
| 799 ResetRoundingMode(); | 799 ResetRoundingMode(); |
| 800 } | 800 } |
| 801 | 801 |
| 802 MovDoubleToInt64(dst, double_dst); | 802 MovDoubleToInt64(dst, double_dst); |
| 803 } | 803 } |
| 804 #endif | 804 #endif |
| 805 | 805 |
| 806 #if !V8_TARGET_ARCH_PPC64 |
| 807 void MacroAssembler::PairShiftLeft(Register dst_low, Register dst_high, |
| 808 Register src_low, Register src_high, |
| 809 Register scratch, Register shift) { |
| 810 DCHECK(!AreAliased(dst_low, src_high, shift)); |
| 811 DCHECK(!AreAliased(dst_high, src_low, shift)); |
| 812 Label less_than_32; |
| 813 Label done; |
| 814 cmpi(shift, Operand(32)); |
| 815 blt(&less_than_32); |
| 816 // If shift >= 32 |
| 817 andi(scratch, shift, Operand(0x1f)); |
| 818 slw(dst_high, src_low, scratch); |
| 819 li(dst_low, Operand::Zero()); |
| 820 b(&done); |
| 821 bind(&less_than_32); |
| 822 // If shift < 32 |
| 823 subfic(scratch, shift, Operand(32)); |
| 824 slw(dst_high, src_high, shift); |
| 825 srw(scratch, src_low, scratch); |
| 826 orx(dst_high, dst_high, scratch); |
| 827 slw(dst_low, src_low, shift); |
| 828 bind(&done); |
| 829 } |
| 830 |
| 831 void MacroAssembler::PairShiftLeft(Register dst_low, Register dst_high, |
| 832 Register src_low, Register src_high, |
| 833 uint32_t shift) { |
| 834 DCHECK(!AreAliased(dst_low, src_high)); |
| 835 DCHECK(!AreAliased(dst_high, src_low)); |
| 836 Label less_than_32; |
| 837 Label done; |
| 838 if (shift >= 32) { |
| 839 shift &= 0x1f; |
| 840 slwi(dst_high, src_low, Operand(shift)); |
| 841 li(dst_low, Operand::Zero()); |
| 842 } else if (shift == 0) { |
| 843 Move(dst_low, src_low); |
| 844 Move(dst_high, src_high); |
| 845 } else { |
| 846 slwi(dst_high, src_high, Operand(shift)); |
| 847 rlwimi(dst_high, src_low, shift, 32 - shift, 31); |
| 848 slwi(dst_low, src_low, Operand(shift)); |
| 849 } |
| 850 } |
| 851 #endif |
| 806 | 852 |
| 807 void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress( | 853 void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress( |
| 808 Register code_target_address) { | 854 Register code_target_address) { |
| 809 lwz(kConstantPoolRegister, | 855 lwz(kConstantPoolRegister, |
| 810 MemOperand(code_target_address, | 856 MemOperand(code_target_address, |
| 811 Code::kConstantPoolOffset - Code::kHeaderSize)); | 857 Code::kConstantPoolOffset - Code::kHeaderSize)); |
| 812 add(kConstantPoolRegister, kConstantPoolRegister, code_target_address); | 858 add(kConstantPoolRegister, kConstantPoolRegister, code_target_address); |
| 813 } | 859 } |
| 814 | 860 |
| 815 | 861 |
| (...skipping 3645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4461 } | 4507 } |
| 4462 if (mag.shift > 0) srawi(result, result, mag.shift); | 4508 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4463 ExtractBit(r0, dividend, 31); | 4509 ExtractBit(r0, dividend, 31); |
| 4464 add(result, result, r0); | 4510 add(result, result, r0); |
| 4465 } | 4511 } |
| 4466 | 4512 |
| 4467 } // namespace internal | 4513 } // namespace internal |
| 4468 } // namespace v8 | 4514 } // namespace v8 |
| 4469 | 4515 |
| 4470 #endif // V8_TARGET_ARCH_PPC | 4516 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |