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 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 } | 705 } |
706 void Jump(Handle<Code> target, RelocInfo::Mode rmode) { jmp(target, rmode); } | 706 void Jump(Handle<Code> target, RelocInfo::Mode rmode) { jmp(target, rmode); } |
707 void Push(Register src) { push(src); } | 707 void Push(Register src) { push(src); } |
708 void Push(const Operand& src) { push(src); } | 708 void Push(const Operand& src) { push(src); } |
709 void Push(Immediate value) { push(value); } | 709 void Push(Immediate value) { push(value); } |
710 void Pop(Register dst) { pop(dst); } | 710 void Pop(Register dst) { pop(dst); } |
711 void Pop(const Operand& dst) { pop(dst); } | 711 void Pop(const Operand& dst) { pop(dst); } |
712 void PushReturnAddressFrom(Register src) { push(src); } | 712 void PushReturnAddressFrom(Register src) { push(src); } |
713 void PopReturnAddressTo(Register dst) { pop(dst); } | 713 void PopReturnAddressTo(Register dst) { pop(dst); } |
714 | 714 |
| 715 // SSE/SSE2 instructions with AVX version. |
| 716 #define AVX_OP2_WITH_TYPE(macro_name, name, dst_type, src_type) \ |
| 717 void macro_name(dst_type dst, src_type src) { \ |
| 718 if (CpuFeatures::IsSupported(AVX)) { \ |
| 719 CpuFeatureScope scope(this, AVX); \ |
| 720 v##name(dst, src); \ |
| 721 } else { \ |
| 722 name(dst, src); \ |
| 723 } \ |
| 724 } |
| 725 |
| 726 AVX_OP2_WITH_TYPE(Movd, movd, XMMRegister, Register) |
| 727 AVX_OP2_WITH_TYPE(Movd, movd, XMMRegister, const Operand&) |
| 728 AVX_OP2_WITH_TYPE(Movd, movd, Register, XMMRegister) |
| 729 AVX_OP2_WITH_TYPE(Movd, movd, const Operand&, XMMRegister) |
| 730 |
| 731 #undef AVX_OP2_WITH_TYPE |
| 732 |
| 733 void Pshufd(XMMRegister dst, XMMRegister src, uint8_t shuffle) { |
| 734 Pshufd(dst, Operand(src), shuffle); |
| 735 } |
| 736 void Pshufd(XMMRegister dst, const Operand& src, uint8_t shuffle); |
| 737 |
715 // Non-SSE2 instructions. | 738 // Non-SSE2 instructions. |
716 void Pextrd(Register dst, XMMRegister src, int8_t imm8); | 739 void Pextrd(Register dst, XMMRegister src, int8_t imm8); |
717 void Pinsrd(XMMRegister dst, Register src, int8_t imm8, | 740 void Pinsrd(XMMRegister dst, Register src, int8_t imm8, |
718 bool is_64_bits = false) { | 741 bool is_64_bits = false) { |
719 Pinsrd(dst, Operand(src), imm8, is_64_bits); | 742 Pinsrd(dst, Operand(src), imm8, is_64_bits); |
720 } | 743 } |
721 void Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8, | 744 void Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8, |
722 bool is_64_bits = false); | 745 bool is_64_bits = false); |
723 | 746 |
724 void Lzcnt(Register dst, Register src) { Lzcnt(dst, Operand(src)); } | 747 void Lzcnt(Register dst, Register src) { Lzcnt(dst, Operand(src)); } |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 inline Operand NativeContextOperand() { | 962 inline Operand NativeContextOperand() { |
940 return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); | 963 return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); |
941 } | 964 } |
942 | 965 |
943 #define ACCESS_MASM(masm) masm-> | 966 #define ACCESS_MASM(masm) masm-> |
944 | 967 |
945 } // namespace internal | 968 } // namespace internal |
946 } // namespace v8 | 969 } // namespace v8 |
947 | 970 |
948 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 971 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |