OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 void Assembler::call(const Operand& op) { | 680 void Assembler::call(const Operand& op) { |
681 EnsureSpace ensure_space(this); | 681 EnsureSpace ensure_space(this); |
682 last_pc_ = pc_; | 682 last_pc_ = pc_; |
683 // Opcode: FF /2 m64 | 683 // Opcode: FF /2 m64 |
684 emit_rex_64(op); | 684 emit_rex_64(op); |
685 emit(0xFF); | 685 emit(0xFF); |
686 emit_operand(2, op); | 686 emit_operand(2, op); |
687 } | 687 } |
688 | 688 |
689 | 689 |
| 690 void Assembler::cdq() { |
| 691 EnsureSpace ensure_space(this); |
| 692 last_pc_ = pc_; |
| 693 emit(0x99); |
| 694 } |
| 695 |
| 696 |
690 void Assembler::cmovq(Condition cc, Register dst, Register src) { | 697 void Assembler::cmovq(Condition cc, Register dst, Register src) { |
691 // No need to check CpuInfo for CMOV support, it's a required part of the | 698 // No need to check CpuInfo for CMOV support, it's a required part of the |
692 // 64-bit architecture. | 699 // 64-bit architecture. |
693 ASSERT(cc >= 0); // Use mov for unconditional moves. | 700 ASSERT(cc >= 0); // Use mov for unconditional moves. |
694 EnsureSpace ensure_space(this); | 701 EnsureSpace ensure_space(this); |
695 last_pc_ = pc_; | 702 last_pc_ = pc_; |
696 // Opcode: REX.W 0f 40 + cc /r | 703 // Opcode: REX.W 0f 40 + cc /r |
697 emit_rex_64(dst, src); | 704 emit_rex_64(dst, src); |
698 emit(0x0f); | 705 emit(0x0f); |
699 emit(0x40 + cc); | 706 emit(0x40 + cc); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 } | 807 } |
801 | 808 |
802 | 809 |
803 void Assembler::hlt() { | 810 void Assembler::hlt() { |
804 EnsureSpace ensure_space(this); | 811 EnsureSpace ensure_space(this); |
805 last_pc_ = pc_; | 812 last_pc_ = pc_; |
806 emit(0xF4); | 813 emit(0xF4); |
807 } | 814 } |
808 | 815 |
809 | 816 |
810 void Assembler::idiv(Register src) { | 817 void Assembler::idivq(Register src) { |
811 EnsureSpace ensure_space(this); | 818 EnsureSpace ensure_space(this); |
812 last_pc_ = pc_; | 819 last_pc_ = pc_; |
813 emit_rex_64(src); | 820 emit_rex_64(src); |
814 emit(0xF7); | 821 emit(0xF7); |
815 emit_modrm(0x7, src); | 822 emit_modrm(0x7, src); |
816 } | 823 } |
817 | 824 |
818 | 825 |
| 826 void Assembler::idivl(Register src) { |
| 827 EnsureSpace ensure_space(this); |
| 828 last_pc_ = pc_; |
| 829 emit_optional_rex_32(src); |
| 830 emit(0xF7); |
| 831 emit_modrm(0x7, src); |
| 832 } |
| 833 |
| 834 |
819 void Assembler::imul(Register src) { | 835 void Assembler::imul(Register src) { |
820 EnsureSpace ensure_space(this); | 836 EnsureSpace ensure_space(this); |
821 last_pc_ = pc_; | 837 last_pc_ = pc_; |
822 emit_rex_64(src); | 838 emit_rex_64(src); |
823 emit(0xF7); | 839 emit(0xF7); |
824 emit_modrm(0x5, src); | 840 emit_modrm(0x5, src); |
825 } | 841 } |
826 | 842 |
827 | 843 |
828 void Assembler::imul(Register dst, Register src) { | 844 void Assembler::imul(Register dst, Register src) { |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 RecordRelocInfo(RelocInfo::POSITION, current_position_); | 2201 RecordRelocInfo(RelocInfo::POSITION, current_position_); |
2186 written_position_ = current_position_; | 2202 written_position_ = current_position_; |
2187 } | 2203 } |
2188 } | 2204 } |
2189 | 2205 |
2190 | 2206 |
2191 const int RelocInfo::kApplyMask = 1 << RelocInfo::INTERNAL_REFERENCE; | 2207 const int RelocInfo::kApplyMask = 1 << RelocInfo::INTERNAL_REFERENCE; |
2192 | 2208 |
2193 | 2209 |
2194 } } // namespace v8::internal | 2210 } } // namespace v8::internal |
OLD | NEW |