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

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2619763003: PPC: Implement VSX instructions (Closed)
Patch Set: Fixed native assembler code Created 3 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/globals.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/crankshaft/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/builtins/builtins-constructor.h" 8 #include "src/builtins/builtins-constructor.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1983 } 1983 }
1984 } 1984 }
1985 1985
1986 1986
1987 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { 1987 void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
1988 DoubleRegister left = ToDoubleRegister(instr->left()); 1988 DoubleRegister left = ToDoubleRegister(instr->left());
1989 DoubleRegister right = ToDoubleRegister(instr->right()); 1989 DoubleRegister right = ToDoubleRegister(instr->right());
1990 DoubleRegister result = ToDoubleRegister(instr->result()); 1990 DoubleRegister result = ToDoubleRegister(instr->result());
1991 switch (instr->op()) { 1991 switch (instr->op()) {
1992 case Token::ADD: 1992 case Token::ADD:
1993 __ fadd(result, left, right); 1993 if (CpuFeatures::IsSupported(VSX)) {
1994 __ xsadddp(result, left, right);
1995 } else {
1996 __ fadd(result, left, right);
1997 }
1994 break; 1998 break;
1995 case Token::SUB: 1999 case Token::SUB:
1996 __ fsub(result, left, right); 2000 if (CpuFeatures::IsSupported(VSX)) {
2001 __ xssubdp(result, left, right);
2002 } else {
2003 __ fsub(result, left, right);
2004 }
1997 break; 2005 break;
1998 case Token::MUL: 2006 case Token::MUL:
1999 __ fmul(result, left, right); 2007 if (CpuFeatures::IsSupported(VSX)) {
2008 __ xsmuldp(result, left, right);
2009 } else {
2010 __ fmul(result, left, right);
2011 }
2000 break; 2012 break;
2001 case Token::DIV: 2013 case Token::DIV:
2002 __ fdiv(result, left, right); 2014 if (CpuFeatures::IsSupported(VSX)) {
2015 __ xsdivdp(result, left, right);
2016 } else {
2017 __ fdiv(result, left, right);
2018 }
2003 break; 2019 break;
2004 case Token::MOD: { 2020 case Token::MOD: {
2005 __ PrepareCallCFunction(0, 2, scratch0()); 2021 __ PrepareCallCFunction(0, 2, scratch0());
2006 __ MovToFloatParameters(left, right); 2022 __ MovToFloatParameters(left, right);
2007 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), 2023 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()),
2008 0, 2); 2024 0, 2);
2009 // Move the result in the double result register. 2025 // Move the result in the double result register.
2010 __ MovFromFloatResult(result); 2026 __ MovFromFloatResult(result);
2011 break; 2027 break;
2012 } 2028 }
(...skipping 3643 matching lines...) Expand 10 before | Expand all | Expand 10 after
5656 __ LoadP(result, 5672 __ LoadP(result,
5657 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5673 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5658 __ bind(deferred->exit()); 5674 __ bind(deferred->exit());
5659 __ bind(&done); 5675 __ bind(&done);
5660 } 5676 }
5661 5677
5662 #undef __ 5678 #undef __
5663 5679
5664 } // namespace internal 5680 } // namespace internal
5665 } // namespace v8 5681 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698