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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/ppc/lithium-codegen-ppc.cc
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc
index 4162a6006d100df65f382f4cb77da69edef8151b..c18334c583e4fcc599d75b6e14c1029034206e29 100644
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc
@@ -1990,16 +1990,32 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
DoubleRegister result = ToDoubleRegister(instr->result());
switch (instr->op()) {
case Token::ADD:
- __ fadd(result, left, right);
+ if (CpuFeatures::IsSupported(VSX)) {
+ __ xsadddp(result, left, right);
+ } else {
+ __ fadd(result, left, right);
+ }
break;
case Token::SUB:
- __ fsub(result, left, right);
+ if (CpuFeatures::IsSupported(VSX)) {
+ __ xssubdp(result, left, right);
+ } else {
+ __ fsub(result, left, right);
+ }
break;
case Token::MUL:
- __ fmul(result, left, right);
+ if (CpuFeatures::IsSupported(VSX)) {
+ __ xsmuldp(result, left, right);
+ } else {
+ __ fmul(result, left, right);
+ }
break;
case Token::DIV:
- __ fdiv(result, left, right);
+ if (CpuFeatures::IsSupported(VSX)) {
+ __ xsdivdp(result, left, right);
+ } else {
+ __ fdiv(result, left, right);
+ }
break;
case Token::MOD: {
__ PrepareCallCFunction(0, 2, scratch0());
« 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