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

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

Issue 2252863003: [turbofan] Add Float32(Max|Min) machine operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Type is number now. Created 4 years, 4 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 | « src/compiler/machine-operator.cc ('k') | src/compiler/mips/instruction-codes-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips/code-generator-mips.cc
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc
index dff8fd4f9509ad34d1ef176a1e5fc83fc7832504..ee9b40eb353a255e488b7c2228fa499198e160ea 100644
--- a/src/compiler/mips/code-generator-mips.cc
+++ b/src/compiler/mips/code-generator-mips.cc
@@ -1196,6 +1196,17 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
ASSEMBLE_ROUND_FLOAT_TO_FLOAT(round);
break;
}
+ case kMipsFloat32Max: {
+ Label compare_nan, done_compare;
+ __ MaxNaNCheck_s(i.OutputSingleRegister(), i.InputSingleRegister(0),
+ i.InputSingleRegister(1), &compare_nan);
+ __ Branch(&done_compare);
+ __ bind(&compare_nan);
+ __ Move(i.OutputSingleRegister(),
+ std::numeric_limits<float>::quiet_NaN());
+ __ bind(&done_compare);
+ break;
+ }
case kMipsFloat64Max: {
Label compare_nan, done_compare;
__ MaxNaNCheck_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
@@ -1207,6 +1218,17 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ bind(&done_compare);
break;
}
+ case kMipsFloat32Min: {
+ Label compare_nan, done_compare;
+ __ MinNaNCheck_s(i.OutputSingleRegister(), i.InputSingleRegister(0),
+ i.InputSingleRegister(1), &compare_nan);
+ __ Branch(&done_compare);
+ __ bind(&compare_nan);
+ __ Move(i.OutputSingleRegister(),
+ std::numeric_limits<float>::quiet_NaN());
+ __ bind(&done_compare);
+ break;
+ }
case kMipsFloat64Min: {
Label compare_nan, done_compare;
__ MinNaNCheck_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips/instruction-codes-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698