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

Unified Diff: src/compiler/common-operator-reducer.cc

Issue 1128133003: [turbofan] Make an OptionalOperator for MachineOperatorBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/js-intrinsic-lowering.cc » ('j') | src/compiler/machine-operator.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator-reducer.cc
diff --git a/src/compiler/common-operator-reducer.cc b/src/compiler/common-operator-reducer.cc
index 2ade817c234b1b3a564a27d080bcd8a446bdcdff..2cd23e51504cc55e6f25abd810f94a5814790d6b 100644
--- a/src/compiler/common-operator-reducer.cc
+++ b/src/compiler/common-operator-reducer.cc
@@ -59,35 +59,35 @@ Reduction CommonOperatorReducer::ReducePhi(Node* node) {
Float32BinopMatcher mcond(cond);
if (mcond.left().Is(0.0) && mcond.right().Equals(vtrue) &&
vfalse->opcode() == IrOpcode::kFloat32Sub &&
- machine()->HasFloat32Abs()) {
+ machine()->Float32Abs().supported()) {
Float32BinopMatcher mvfalse(vfalse);
if (mvfalse.left().IsZero() && mvfalse.right().Equals(vtrue)) {
- return Change(node, machine()->Float32Abs(), vtrue);
+ return Change(node, machine()->Float32Abs().op(), vtrue);
}
}
if (mcond.left().Equals(vtrue) && mcond.right().Equals(vfalse) &&
- machine()->HasFloat32Min()) {
- return Change(node, machine()->Float32Min(), vtrue, vfalse);
+ machine()->Float32Min().supported()) {
+ return Change(node, machine()->Float32Min().op(), vtrue, vfalse);
} else if (mcond.left().Equals(vfalse) && mcond.right().Equals(vtrue) &&
- machine()->HasFloat32Max()) {
- return Change(node, machine()->Float32Max(), vtrue, vfalse);
+ machine()->Float32Max().supported()) {
+ return Change(node, machine()->Float32Max().op(), vtrue, vfalse);
}
} else if (cond->opcode() == IrOpcode::kFloat64LessThan) {
Float64BinopMatcher mcond(cond);
if (mcond.left().Is(0.0) && mcond.right().Equals(vtrue) &&
vfalse->opcode() == IrOpcode::kFloat64Sub &&
- machine()->HasFloat64Abs()) {
+ machine()->Float64Abs().supported()) {
Float64BinopMatcher mvfalse(vfalse);
if (mvfalse.left().IsZero() && mvfalse.right().Equals(vtrue)) {
- return Change(node, machine()->Float64Abs(), vtrue);
+ return Change(node, machine()->Float64Abs().op(), vtrue);
}
}
if (mcond.left().Equals(vtrue) && mcond.right().Equals(vfalse) &&
- machine()->HasFloat64Min()) {
- return Change(node, machine()->Float64Min(), vtrue, vfalse);
+ machine()->Float64Min().supported()) {
+ return Change(node, machine()->Float64Min().op(), vtrue, vfalse);
} else if (mcond.left().Equals(vfalse) && mcond.right().Equals(vtrue) &&
- machine()->HasFloat64Max()) {
- return Change(node, machine()->Float64Max(), vtrue, vfalse);
+ machine()->Float64Max().supported()) {
+ return Change(node, machine()->Float64Max().op(), vtrue, vfalse);
}
}
}
@@ -118,18 +118,18 @@ Reduction CommonOperatorReducer::ReduceSelect(Node* node) {
Float32BinopMatcher mcond(cond);
if (mcond.left().Is(0.0) && mcond.right().Equals(vtrue) &&
vfalse->opcode() == IrOpcode::kFloat32Sub &&
- machine()->HasFloat32Abs()) {
+ machine()->Float32Abs().supported()) {
Float32BinopMatcher mvfalse(vfalse);
if (mvfalse.left().IsZero() && mvfalse.right().Equals(vtrue)) {
- return Change(node, machine()->Float32Abs(), vtrue);
+ return Change(node, machine()->Float32Abs().op(), vtrue);
}
}
if (mcond.left().Equals(vtrue) && mcond.right().Equals(vfalse) &&
- machine()->HasFloat32Min()) {
- return Change(node, machine()->Float32Min(), vtrue, vfalse);
+ machine()->Float32Min().supported()) {
+ return Change(node, machine()->Float32Min().op(), vtrue, vfalse);
} else if (mcond.left().Equals(vfalse) && mcond.right().Equals(vtrue) &&
- machine()->HasFloat32Max()) {
- return Change(node, machine()->Float32Max(), vtrue, vfalse);
+ machine()->Float32Max().supported()) {
+ return Change(node, machine()->Float32Max().op(), vtrue, vfalse);
}
break;
}
@@ -137,18 +137,18 @@ Reduction CommonOperatorReducer::ReduceSelect(Node* node) {
Float64BinopMatcher mcond(cond);
if (mcond.left().Is(0.0) && mcond.right().Equals(vtrue) &&
vfalse->opcode() == IrOpcode::kFloat64Sub &&
- machine()->HasFloat64Abs()) {
+ machine()->Float64Abs().supported()) {
Float64BinopMatcher mvfalse(vfalse);
if (mvfalse.left().IsZero() && mvfalse.right().Equals(vtrue)) {
- return Change(node, machine()->Float64Abs(), vtrue);
+ return Change(node, machine()->Float64Abs().op(), vtrue);
}
}
if (mcond.left().Equals(vtrue) && mcond.right().Equals(vfalse) &&
- machine()->HasFloat64Min()) {
- return Change(node, machine()->Float64Min(), vtrue, vfalse);
+ machine()->Float64Min().supported()) {
+ return Change(node, machine()->Float64Min().op(), vtrue, vfalse);
} else if (mcond.left().Equals(vfalse) && mcond.right().Equals(vtrue) &&
- machine()->HasFloat64Max()) {
- return Change(node, machine()->Float64Max(), vtrue, vfalse);
+ machine()->Float64Max().supported()) {
+ return Change(node, machine()->Float64Max().op(), vtrue, vfalse);
}
break;
}
« no previous file with comments | « no previous file | src/compiler/js-intrinsic-lowering.cc » ('j') | src/compiler/machine-operator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698