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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 860003002: [x86] Use AVX in Crankshaft when available. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | src/ia32/lithium-ia32.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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 } 1976 }
1977 } 1977 }
1978 1978
1979 1979
1980 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { 1980 void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
1981 XMMRegister left = ToDoubleRegister(instr->left()); 1981 XMMRegister left = ToDoubleRegister(instr->left());
1982 XMMRegister right = ToDoubleRegister(instr->right()); 1982 XMMRegister right = ToDoubleRegister(instr->right());
1983 XMMRegister result = ToDoubleRegister(instr->result()); 1983 XMMRegister result = ToDoubleRegister(instr->result());
1984 switch (instr->op()) { 1984 switch (instr->op()) {
1985 case Token::ADD: 1985 case Token::ADD:
1986 __ addsd(left, right); 1986 if (CpuFeatures::IsSupported(AVX)) {
1987 CpuFeatureScope scope(masm(), AVX);
1988 __ vaddsd(result, left, right);
1989 } else {
1990 DCHECK(result.is(left));
1991 __ addsd(left, right);
1992 }
1987 break; 1993 break;
1988 case Token::SUB: 1994 case Token::SUB:
1989 __ subsd(left, right); 1995 if (CpuFeatures::IsSupported(AVX)) {
1996 CpuFeatureScope scope(masm(), AVX);
1997 __ vsubsd(result, left, right);
1998 } else {
1999 DCHECK(result.is(left));
2000 __ subsd(left, right);
2001 }
1990 break; 2002 break;
1991 case Token::MUL: 2003 case Token::MUL:
1992 __ mulsd(left, right); 2004 if (CpuFeatures::IsSupported(AVX)) {
2005 CpuFeatureScope scope(masm(), AVX);
2006 __ vmulsd(result, left, right);
2007 } else {
2008 DCHECK(result.is(left));
2009 __ mulsd(left, right);
2010 }
1993 break; 2011 break;
1994 case Token::DIV: 2012 case Token::DIV:
1995 __ divsd(left, right); 2013 if (CpuFeatures::IsSupported(AVX)) {
1996 // Don't delete this mov. It may improve performance on some CPUs, 2014 CpuFeatureScope scope(masm(), AVX);
1997 // when there is a mulsd depending on the result 2015 __ vdivsd(result, left, right);
1998 __ movaps(left, left); 2016 } else {
2017 DCHECK(result.is(left));
2018 __ divsd(left, right);
2019 // Don't delete this mov. It may improve performance on some CPUs,
2020 // when there is a mulsd depending on the result
2021 __ movaps(left, left);
2022 }
1999 break; 2023 break;
2000 case Token::MOD: { 2024 case Token::MOD: {
2001 // Pass two doubles as arguments on the stack. 2025 // Pass two doubles as arguments on the stack.
2002 __ PrepareCallCFunction(4, eax); 2026 __ PrepareCallCFunction(4, eax);
2003 __ movsd(Operand(esp, 0 * kDoubleSize), left); 2027 __ movsd(Operand(esp, 0 * kDoubleSize), left);
2004 __ movsd(Operand(esp, 1 * kDoubleSize), right); 2028 __ movsd(Operand(esp, 1 * kDoubleSize), right);
2005 __ CallCFunction( 2029 __ CallCFunction(
2006 ExternalReference::mod_two_doubles_operation(isolate()), 2030 ExternalReference::mod_two_doubles_operation(isolate()),
2007 4); 2031 4);
2008 2032
(...skipping 3727 matching lines...) Expand 10 before | Expand all | Expand 10 after
5736 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5760 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5737 RecordSafepoint(Safepoint::kNoLazyDeopt); 5761 RecordSafepoint(Safepoint::kNoLazyDeopt);
5738 } 5762 }
5739 5763
5740 5764
5741 #undef __ 5765 #undef __
5742 5766
5743 } } // namespace v8::internal 5767 } } // namespace v8::internal
5744 5768
5745 #endif // V8_TARGET_ARCH_IA32 5769 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698