Chromium Code Reviews| 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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 721 shld_cl(dst, src); | 721 shld_cl(dst, src); |
| 722 shl_cl(src); | 722 shl_cl(src); |
| 723 Label done; | 723 Label done; |
| 724 test(ecx, Immediate(0x20)); | 724 test(ecx, Immediate(0x20)); |
| 725 j(equal, &done, Label::kNear); | 725 j(equal, &done, Label::kNear); |
| 726 mov(dst, src); | 726 mov(dst, src); |
| 727 xor_(src, src); | 727 xor_(src, src); |
| 728 bind(&done); | 728 bind(&done); |
| 729 } | 729 } |
| 730 | 730 |
| 731 void MacroAssembler::PairShr(Register dst, Register src, uint8_t shift) { | |
|
titzer
2016/03/07 19:25:35
{dst} and {src} are misnamed. They should be {hi}
ahaas
2016/03/08 07:58:42
Done.
| |
| 732 if (shift >= 32) { | |
| 733 mov(src, dst); | |
| 734 shr(src, shift - 32); | |
| 735 xor_(dst, dst); | |
| 736 } else { | |
| 737 shrd(dst, src, shift); | |
| 738 shr(dst, shift); | |
| 739 } | |
| 740 } | |
| 741 | |
| 742 void MacroAssembler::PairShr_cl(Register dst, Register src) { | |
| 743 shrd_cl(dst, src); | |
| 744 shr_cl(dst); | |
| 745 Label done; | |
| 746 test(ecx, Immediate(0x20)); | |
| 747 j(equal, &done, Label::kNear); | |
| 748 mov(src, dst); | |
| 749 xor_(dst, dst); | |
| 750 bind(&done); | |
| 751 } | |
| 752 | |
| 753 void MacroAssembler::PairSar(Register dst, Register src, uint8_t shift) { | |
| 754 if (shift >= 32) { | |
| 755 mov(src, dst); | |
| 756 sar(src, shift - 32); | |
| 757 sar(dst, 31); | |
| 758 } else { | |
| 759 shrd(dst, src, shift); | |
| 760 sar(dst, shift); | |
| 761 } | |
| 762 } | |
| 763 | |
| 764 void MacroAssembler::PairSar_cl(Register dst, Register src) { | |
| 765 shrd_cl(dst, src); | |
| 766 sar_cl(dst); | |
| 767 Label done; | |
| 768 test(ecx, Immediate(0x20)); | |
| 769 j(equal, &done, Label::kNear); | |
| 770 mov(src, dst); | |
| 771 sar(dst, 31); | |
| 772 bind(&done); | |
| 773 } | |
| 774 | |
| 731 bool MacroAssembler::IsUnsafeImmediate(const Immediate& x) { | 775 bool MacroAssembler::IsUnsafeImmediate(const Immediate& x) { |
| 732 static const int kMaxImmediateBits = 17; | 776 static const int kMaxImmediateBits = 17; |
| 733 if (!RelocInfo::IsNone(x.rmode_)) return false; | 777 if (!RelocInfo::IsNone(x.rmode_)) return false; |
| 734 return !is_intn(x.x_, kMaxImmediateBits); | 778 return !is_intn(x.x_, kMaxImmediateBits); |
| 735 } | 779 } |
| 736 | 780 |
| 737 | 781 |
| 738 void MacroAssembler::SafeMove(Register dst, const Immediate& x) { | 782 void MacroAssembler::SafeMove(Register dst, const Immediate& x) { |
| 739 if (IsUnsafeImmediate(x) && jit_cookie() != 0) { | 783 if (IsUnsafeImmediate(x) && jit_cookie() != 0) { |
| 740 Move(dst, Immediate(x.x_ ^ jit_cookie())); | 784 Move(dst, Immediate(x.x_ ^ jit_cookie())); |
| (...skipping 2580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3321 mov(eax, dividend); | 3365 mov(eax, dividend); |
| 3322 shr(eax, 31); | 3366 shr(eax, 31); |
| 3323 add(edx, eax); | 3367 add(edx, eax); |
| 3324 } | 3368 } |
| 3325 | 3369 |
| 3326 | 3370 |
| 3327 } // namespace internal | 3371 } // namespace internal |
| 3328 } // namespace v8 | 3372 } // namespace v8 |
| 3329 | 3373 |
| 3330 #endif // V8_TARGET_ARCH_IA32 | 3374 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |