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

Unified Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 1006913002: PPC: Implement turbofan Float64Min and Float64Max machine operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/compiler/ppc/instruction-codes-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ppc/code-generator-ppc.cc
diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
index 8ac9c6114b598a9631f848066462c34a1d3773e7..92562f0e64963636b4260002bf41e8f8ad37ded5 100644
--- a/src/compiler/ppc/code-generator-ppc.cc
+++ b/src/compiler/ppc/code-generator-ppc.cc
@@ -339,6 +339,22 @@ Condition FlagsConditionToCondition(FlagsCondition condition) {
} while (0)
+#define ASSEMBLE_FLOAT_MAX(scratch_reg) \
+ do { \
+ __ fsub(scratch_reg, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
+ __ fsel(i.OutputDoubleRegister(), scratch_reg, i.InputDoubleRegister(0), \
+ i.InputDoubleRegister(1)); \
+ } while (0)
+
+
+#define ASSEMBLE_FLOAT_MIN(scratch_reg) \
+ do { \
+ __ fsub(scratch_reg, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
+ __ fsel(i.OutputDoubleRegister(), scratch_reg, i.InputDoubleRegister(1), \
+ i.InputDoubleRegister(0)); \
+ } while (0)
+
+
#define ASSEMBLE_LOAD_FLOAT(asm_instr, asm_instrx) \
do { \
DoubleRegister result = i.OutputDoubleRegister(); \
@@ -799,6 +815,12 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kPPC_Neg64:
__ neg(i.OutputRegister(), i.InputRegister(0), LeaveOE, i.OutputRCBit());
break;
+ case kPPC_MaxFloat64:
+ ASSEMBLE_FLOAT_MAX(kScratchDoubleReg);
+ break;
+ case kPPC_MinFloat64:
+ ASSEMBLE_FLOAT_MIN(kScratchDoubleReg);
+ break;
case kPPC_SqrtFloat64:
ASSEMBLE_FLOAT_UNOP_RC(fsqrt);
break;
« no previous file with comments | « no previous file | src/compiler/ppc/instruction-codes-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698