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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 emit_modrm(subcode, dst); | 610 emit_modrm(subcode, dst); |
611 } else { | 611 } else { |
612 emit_rex(dst, size); | 612 emit_rex(dst, size); |
613 emit(0xC1); | 613 emit(0xC1); |
614 emit_modrm(subcode, dst); | 614 emit_modrm(subcode, dst); |
615 emit(shift_amount.value_); | 615 emit(shift_amount.value_); |
616 } | 616 } |
617 } | 617 } |
618 | 618 |
619 | 619 |
| 620 void Assembler::shift(Operand dst, Immediate shift_amount, int subcode, |
| 621 int size) { |
| 622 EnsureSpace ensure_space(this); |
| 623 DCHECK(size == kInt64Size ? is_uint6(shift_amount.value_) |
| 624 : is_uint5(shift_amount.value_)); |
| 625 if (shift_amount.value_ == 1) { |
| 626 emit_rex(dst, size); |
| 627 emit(0xD1); |
| 628 emit_operand(subcode, dst); |
| 629 } else { |
| 630 emit_rex(dst, size); |
| 631 emit(0xC1); |
| 632 emit_operand(subcode, dst); |
| 633 emit(shift_amount.value_); |
| 634 } |
| 635 } |
| 636 |
| 637 |
620 void Assembler::shift(Register dst, int subcode, int size) { | 638 void Assembler::shift(Register dst, int subcode, int size) { |
621 EnsureSpace ensure_space(this); | 639 EnsureSpace ensure_space(this); |
622 emit_rex(dst, size); | 640 emit_rex(dst, size); |
623 emit(0xD3); | 641 emit(0xD3); |
624 emit_modrm(subcode, dst); | 642 emit_modrm(subcode, dst); |
625 } | 643 } |
626 | 644 |
627 | 645 |
| 646 void Assembler::shift(Operand dst, int subcode, int size) { |
| 647 EnsureSpace ensure_space(this); |
| 648 emit_rex(dst, size); |
| 649 emit(0xD3); |
| 650 emit_operand(subcode, dst); |
| 651 } |
| 652 |
| 653 |
628 void Assembler::bt(const Operand& dst, Register src) { | 654 void Assembler::bt(const Operand& dst, Register src) { |
629 EnsureSpace ensure_space(this); | 655 EnsureSpace ensure_space(this); |
630 emit_rex_64(src, dst); | 656 emit_rex_64(src, dst); |
631 emit(0x0F); | 657 emit(0x0F); |
632 emit(0xA3); | 658 emit(0xA3); |
633 emit_operand(src, dst); | 659 emit_operand(src, dst); |
634 } | 660 } |
635 | 661 |
636 | 662 |
637 void Assembler::bts(const Operand& dst, Register src) { | 663 void Assembler::bts(const Operand& dst, Register src) { |
(...skipping 2397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 | 3061 |
3036 | 3062 |
3037 bool RelocInfo::IsInConstantPool() { | 3063 bool RelocInfo::IsInConstantPool() { |
3038 return false; | 3064 return false; |
3039 } | 3065 } |
3040 | 3066 |
3041 | 3067 |
3042 } } // namespace v8::internal | 3068 } } // namespace v8::internal |
3043 | 3069 |
3044 #endif // V8_TARGET_ARCH_X64 | 3070 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |