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

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

Issue 2161513002: [x64] add Absps/d and Negps/d macro (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add Abspd and Negpd, and move constants to external reference Created 4 years, 5 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/macro-assembler-x64.h ('k') | test/cctest/test-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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
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 2736 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 2747
2748 void MacroAssembler::Movapd(XMMRegister dst, XMMRegister src) { 2748 void MacroAssembler::Movapd(XMMRegister dst, XMMRegister src) {
2749 if (CpuFeatures::IsSupported(AVX)) { 2749 if (CpuFeatures::IsSupported(AVX)) {
2750 CpuFeatureScope scope(this, AVX); 2750 CpuFeatureScope scope(this, AVX);
2751 vmovapd(dst, src); 2751 vmovapd(dst, src);
2752 } else { 2752 } else {
2753 movapd(dst, src); 2753 movapd(dst, src);
2754 } 2754 }
2755 } 2755 }
2756 2756
2757 void MacroAssembler::Movupd(XMMRegister dst, const Operand& src) {
2758 if (CpuFeatures::IsSupported(AVX)) {
2759 CpuFeatureScope scope(this, AVX);
2760 vmovupd(dst, src);
2761 } else {
2762 movupd(dst, src);
2763 }
2764 }
2765
2766 void MacroAssembler::Movupd(const Operand& dst, XMMRegister src) {
2767 if (CpuFeatures::IsSupported(AVX)) {
2768 CpuFeatureScope scope(this, AVX);
2769 vmovupd(dst, src);
2770 } else {
2771 movupd(dst, src);
2772 }
2773 }
2757 2774
2758 void MacroAssembler::Movsd(XMMRegister dst, XMMRegister src) { 2775 void MacroAssembler::Movsd(XMMRegister dst, XMMRegister src) {
2759 if (CpuFeatures::IsSupported(AVX)) { 2776 if (CpuFeatures::IsSupported(AVX)) {
2760 CpuFeatureScope scope(this, AVX); 2777 CpuFeatureScope scope(this, AVX);
2761 vmovsd(dst, dst, src); 2778 vmovsd(dst, dst, src);
2762 } else { 2779 } else {
2763 movsd(dst, src); 2780 movsd(dst, src);
2764 } 2781 }
2765 } 2782 }
2766 2783
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2966 2983
2967 void MacroAssembler::Ucomisd(XMMRegister src1, const Operand& src2) { 2984 void MacroAssembler::Ucomisd(XMMRegister src1, const Operand& src2) {
2968 if (CpuFeatures::IsSupported(AVX)) { 2985 if (CpuFeatures::IsSupported(AVX)) {
2969 CpuFeatureScope scope(this, AVX); 2986 CpuFeatureScope scope(this, AVX);
2970 vucomisd(src1, src2); 2987 vucomisd(src1, src2);
2971 } else { 2988 } else {
2972 ucomisd(src1, src2); 2989 ucomisd(src1, src2);
2973 } 2990 }
2974 } 2991 }
2975 2992
2993 // ----------------------------------------------------------------------------
2994
2995 void MacroAssembler::Absps(XMMRegister dst) {
2996 Andps(dst,
2997 ExternalOperand(ExternalReference::address_of_float_abs_constant()));
2998 }
2999
3000 void MacroAssembler::Negps(XMMRegister dst) {
3001 Xorps(dst,
3002 ExternalOperand(ExternalReference::address_of_float_neg_constant()));
3003 }
3004
3005 void MacroAssembler::Abspd(XMMRegister dst) {
3006 Andps(dst,
3007 ExternalOperand(ExternalReference::address_of_double_abs_constant()));
3008 }
3009
3010 void MacroAssembler::Negpd(XMMRegister dst) {
3011 Xorps(dst,
3012 ExternalOperand(ExternalReference::address_of_double_neg_constant()));
3013 }
2976 3014
2977 void MacroAssembler::Cmp(Register dst, Handle<Object> source) { 3015 void MacroAssembler::Cmp(Register dst, Handle<Object> source) {
2978 AllowDeferredHandleDereference smi_check; 3016 AllowDeferredHandleDereference smi_check;
2979 if (source->IsSmi()) { 3017 if (source->IsSmi()) {
2980 Cmp(dst, Smi::cast(*source)); 3018 Cmp(dst, Smi::cast(*source));
2981 } else { 3019 } else {
2982 MoveHeapObject(kScratchRegister, source); 3020 MoveHeapObject(kScratchRegister, source);
2983 cmpp(dst, kScratchRegister); 3021 cmpp(dst, kScratchRegister);
2984 } 3022 }
2985 } 3023 }
(...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after
5776 movl(rax, dividend); 5814 movl(rax, dividend);
5777 shrl(rax, Immediate(31)); 5815 shrl(rax, Immediate(31));
5778 addl(rdx, rax); 5816 addl(rdx, rax);
5779 } 5817 }
5780 5818
5781 5819
5782 } // namespace internal 5820 } // namespace internal
5783 } // namespace v8 5821 } // namespace v8
5784 5822
5785 #endif // V8_TARGET_ARCH_X64 5823 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698