Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: src/x64/assembler-x64.cc

Issue 1416663004: [x64] Replace movaps with appropriate vmov* instructions when AVX is enabled. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/x64/assembler-x64.h" 5 #include "src/x64/assembler-x64.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #if V8_TARGET_ARCH_X64 9 #if V8_TARGET_ARCH_X64
10 10
(...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 EnsureSpace ensure_space(this); 2737 EnsureSpace ensure_space(this);
2738 emit(0xF2); // double 2738 emit(0xF2); // double
2739 emit_optional_rex_32(dst, src); 2739 emit_optional_rex_32(dst, src);
2740 emit(0x0F); 2740 emit(0x0F);
2741 emit(0x10); // load 2741 emit(0x10); // load
2742 emit_sse_operand(dst, src); 2742 emit_sse_operand(dst, src);
2743 } 2743 }
2744 2744
2745 2745
2746 void Assembler::movaps(XMMRegister dst, XMMRegister src) { 2746 void Assembler::movaps(XMMRegister dst, XMMRegister src) {
2747 DCHECK(!IsEnabled(AVX));
2747 EnsureSpace ensure_space(this); 2748 EnsureSpace ensure_space(this);
2748 if (src.low_bits() == 4) { 2749 if (src.low_bits() == 4) {
2749 // Try to avoid an unnecessary SIB byte. 2750 // Try to avoid an unnecessary SIB byte.
2750 emit_optional_rex_32(src, dst); 2751 emit_optional_rex_32(src, dst);
2751 emit(0x0F); 2752 emit(0x0F);
2752 emit(0x29); 2753 emit(0x29);
2753 emit_sse_operand(src, dst); 2754 emit_sse_operand(src, dst);
2754 } else { 2755 } else {
2755 emit_optional_rex_32(dst, src); 2756 emit_optional_rex_32(dst, src);
2756 emit(0x0F); 2757 emit(0x0F);
2757 emit(0x28); 2758 emit(0x28);
2758 emit_sse_operand(dst, src); 2759 emit_sse_operand(dst, src);
2759 } 2760 }
2760 } 2761 }
2761 2762
2762 2763
2763 void Assembler::shufps(XMMRegister dst, XMMRegister src, byte imm8) { 2764 void Assembler::shufps(XMMRegister dst, XMMRegister src, byte imm8) {
2764 DCHECK(is_uint8(imm8)); 2765 DCHECK(is_uint8(imm8));
2765 EnsureSpace ensure_space(this); 2766 EnsureSpace ensure_space(this);
2766 emit_optional_rex_32(src, dst); 2767 emit_optional_rex_32(src, dst);
2767 emit(0x0F); 2768 emit(0x0F);
2768 emit(0xC6); 2769 emit(0xC6);
2769 emit_sse_operand(dst, src); 2770 emit_sse_operand(dst, src);
2770 emit(imm8); 2771 emit(imm8);
2771 } 2772 }
2772 2773
2773 2774
2774 void Assembler::movapd(XMMRegister dst, XMMRegister src) { 2775 void Assembler::movapd(XMMRegister dst, XMMRegister src) {
2776 DCHECK(!IsEnabled(AVX));
2775 EnsureSpace ensure_space(this); 2777 EnsureSpace ensure_space(this);
2776 if (src.low_bits() == 4) { 2778 if (src.low_bits() == 4) {
2777 // Try to avoid an unnecessary SIB byte. 2779 // Try to avoid an unnecessary SIB byte.
2778 emit(0x66); 2780 emit(0x66);
2779 emit_optional_rex_32(src, dst); 2781 emit_optional_rex_32(src, dst);
2780 emit(0x0F); 2782 emit(0x0F);
2781 emit(0x29); 2783 emit(0x29);
2782 emit_sse_operand(src, dst); 2784 emit_sse_operand(src, dst);
2783 } else { 2785 } else {
2784 emit(0x66); 2786 emit(0x66);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 void Assembler::ucomiss(XMMRegister dst, const Operand& src) { 2945 void Assembler::ucomiss(XMMRegister dst, const Operand& src) {
2944 DCHECK(!IsEnabled(AVX)); 2946 DCHECK(!IsEnabled(AVX));
2945 EnsureSpace ensure_space(this); 2947 EnsureSpace ensure_space(this);
2946 emit_optional_rex_32(dst, src); 2948 emit_optional_rex_32(dst, src);
2947 emit(0x0f); 2949 emit(0x0f);
2948 emit(0x2e); 2950 emit(0x2e);
2949 emit_sse_operand(dst, src); 2951 emit_sse_operand(dst, src);
2950 } 2952 }
2951 2953
2952 2954
2955 void Assembler::movss(XMMRegister dst, XMMRegister src) {
2956 DCHECK(!IsEnabled(AVX));
2957 EnsureSpace ensure_space(this);
2958 emit(0xF3); // single
2959 emit_optional_rex_32(dst, src);
2960 emit(0x0F);
2961 emit(0x10); // load
2962 emit_sse_operand(dst, src);
2963 }
2964
2965
2953 void Assembler::movss(XMMRegister dst, const Operand& src) { 2966 void Assembler::movss(XMMRegister dst, const Operand& src) {
2954 DCHECK(!IsEnabled(AVX)); 2967 DCHECK(!IsEnabled(AVX));
2955 EnsureSpace ensure_space(this); 2968 EnsureSpace ensure_space(this);
2956 emit(0xF3); // single 2969 emit(0xF3); // single
2957 emit_optional_rex_32(dst, src); 2970 emit_optional_rex_32(dst, src);
2958 emit(0x0F); 2971 emit(0x0F);
2959 emit(0x10); // load 2972 emit(0x10); // load
2960 emit_sse_operand(dst, src); 2973 emit_sse_operand(dst, src);
2961 } 2974 }
2962 2975
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
4018 4031
4019 bool RelocInfo::IsInConstantPool() { 4032 bool RelocInfo::IsInConstantPool() {
4020 return false; 4033 return false;
4021 } 4034 }
4022 4035
4023 4036
4024 } // namespace internal 4037 } // namespace internal
4025 } // namespace v8 4038 } // namespace v8
4026 4039
4027 #endif // V8_TARGET_ARCH_X64 4040 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698