| 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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 } | 803 } |
| 804 | 804 |
| 805 MovDoubleToInt64(dst, double_dst); | 805 MovDoubleToInt64(dst, double_dst); |
| 806 } | 806 } |
| 807 #endif | 807 #endif |
| 808 | 808 |
| 809 #if !V8_TARGET_ARCH_PPC64 | 809 #if !V8_TARGET_ARCH_PPC64 |
| 810 void MacroAssembler::ShiftLeftPair(Register dst_low, Register dst_high, | 810 void MacroAssembler::ShiftLeftPair(Register dst_low, Register dst_high, |
| 811 Register src_low, Register src_high, | 811 Register src_low, Register src_high, |
| 812 Register scratch, Register shift) { | 812 Register scratch, Register shift) { |
| 813 DCHECK(!AreAliased(dst_low, src_high, shift)); | 813 DCHECK(!AreAliased(dst_low, src_high)); |
| 814 DCHECK(!AreAliased(dst_high, src_low, shift)); | 814 DCHECK(!AreAliased(dst_high, src_low)); |
| 815 DCHECK(!AreAliased(dst_low, dst_high, shift)); |
| 815 Label less_than_32; | 816 Label less_than_32; |
| 816 Label done; | 817 Label done; |
| 817 cmpi(shift, Operand(32)); | 818 cmpi(shift, Operand(32)); |
| 818 blt(&less_than_32); | 819 blt(&less_than_32); |
| 819 // If shift >= 32 | 820 // If shift >= 32 |
| 820 andi(scratch, shift, Operand(0x1f)); | 821 andi(scratch, shift, Operand(0x1f)); |
| 821 slw(dst_high, src_low, scratch); | 822 slw(dst_high, src_low, scratch); |
| 822 li(dst_low, Operand::Zero()); | 823 li(dst_low, Operand::Zero()); |
| 823 b(&done); | 824 b(&done); |
| 824 bind(&less_than_32); | 825 bind(&less_than_32); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 849 } else { | 850 } else { |
| 850 slwi(dst_high, src_high, Operand(shift)); | 851 slwi(dst_high, src_high, Operand(shift)); |
| 851 rlwimi(dst_high, src_low, shift, 32 - shift, 31); | 852 rlwimi(dst_high, src_low, shift, 32 - shift, 31); |
| 852 slwi(dst_low, src_low, Operand(shift)); | 853 slwi(dst_low, src_low, Operand(shift)); |
| 853 } | 854 } |
| 854 } | 855 } |
| 855 | 856 |
| 856 void MacroAssembler::ShiftRightPair(Register dst_low, Register dst_high, | 857 void MacroAssembler::ShiftRightPair(Register dst_low, Register dst_high, |
| 857 Register src_low, Register src_high, | 858 Register src_low, Register src_high, |
| 858 Register scratch, Register shift) { | 859 Register scratch, Register shift) { |
| 859 DCHECK(!AreAliased(dst_low, src_high, shift)); | 860 DCHECK(!AreAliased(dst_low, src_high)); |
| 860 DCHECK(!AreAliased(dst_high, src_low, shift)); | 861 DCHECK(!AreAliased(dst_high, src_low)); |
| 862 DCHECK(!AreAliased(dst_low, dst_high, shift)); |
| 861 Label less_than_32; | 863 Label less_than_32; |
| 862 Label done; | 864 Label done; |
| 863 cmpi(shift, Operand(32)); | 865 cmpi(shift, Operand(32)); |
| 864 blt(&less_than_32); | 866 blt(&less_than_32); |
| 865 // If shift >= 32 | 867 // If shift >= 32 |
| 866 andi(scratch, shift, Operand(0x1f)); | 868 andi(scratch, shift, Operand(0x1f)); |
| 867 srw(dst_low, src_high, scratch); | 869 srw(dst_low, src_high, scratch); |
| 868 li(dst_high, Operand::Zero()); | 870 li(dst_high, Operand::Zero()); |
| 869 b(&done); | 871 b(&done); |
| 870 bind(&less_than_32); | 872 bind(&less_than_32); |
| (...skipping 3385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4256 } | 4258 } |
| 4257 if (mag.shift > 0) srawi(result, result, mag.shift); | 4259 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4258 ExtractBit(r0, dividend, 31); | 4260 ExtractBit(r0, dividend, 31); |
| 4259 add(result, result, r0); | 4261 add(result, result, r0); |
| 4260 } | 4262 } |
| 4261 | 4263 |
| 4262 } // namespace internal | 4264 } // namespace internal |
| 4263 } // namespace v8 | 4265 } // namespace v8 |
| 4264 | 4266 |
| 4265 #endif // V8_TARGET_ARCH_PPC | 4267 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |