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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 14432004: Inline Float32x4 min,max,sqrt,reciprocal,reciprocalSqrt, and scale (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index c7fabe76861bde0fedafbabeb1e11db26c4df99e..555b8598e51571e389ed344f8a44353ab0e6b69b 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -1761,6 +1761,57 @@ bool FlowGraphOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) {
ReplaceCall(call, cmp);
return true;
}
+ case MethodRecognizer::kFloat32x4Min:
+ case MethodRecognizer::kFloat32x4Max: {
+ Definition* left = call->ArgumentAt(0);
+ Definition* right = call->ArgumentAt(1);
+ // Type check left.
+ AddCheckClass(left,
+ ICData::ZoneHandle(
+ call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+ call->deopt_id(),
+ call->env(),
+ call);
+ Float32x4MinMaxInstr* minmax =
+ new Float32x4MinMaxInstr(recognized_kind, new Value(left),
+ new Value(right), call);
+ ReplaceCall(call, minmax);
+ return true;
+ }
+ case MethodRecognizer::kFloat32x4Scale: {
+ Definition* left = call->ArgumentAt(0);
+ Definition* right = call->ArgumentAt(1);
+ // Type check left.
+ AddCheckClass(left,
+ ICData::ZoneHandle(
+ call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+ call->deopt_id(),
+ call->env(),
+ call);
+ // Left and right values are swapped when handed to the instruction,
+ // this is done so that the double value is loaded into the output
+ // register and can be destroyed.
+ Float32x4ScaleInstr* scale =
+ new Float32x4ScaleInstr(recognized_kind, new Value(right),
+ new Value(left), call);
+ ReplaceCall(call, scale);
+ return true;
+ }
+ case MethodRecognizer::kFloat32x4Sqrt:
+ case MethodRecognizer::kFloat32x4ReciprocalSqrt:
+ case MethodRecognizer::kFloat32x4Reciprocal: {
+ Definition* left = call->ArgumentAt(0);
+ AddCheckClass(left,
+ ICData::ZoneHandle(
+ call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+ call->deopt_id(),
+ call->env(),
+ call);
+ Float32x4SqrtInstr* sqrt =
+ new Float32x4SqrtInstr(recognized_kind, new Value(left), call);
+ ReplaceCall(call, sqrt);
+ return true;
+ }
default:
return false;
}
@@ -4871,6 +4922,21 @@ void ConstantPropagator::VisitFloat32x4Comparison(
}
+void ConstantPropagator::VisitFloat32x4MinMax(Float32x4MinMaxInstr* instr) {
+ SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4Scale(Float32x4ScaleInstr* instr) {
+ SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4Sqrt(Float32x4SqrtInstr* instr) {
+ SetValue(instr, non_constant_);
+}
+
+
void ConstantPropagator::VisitMathSqrt(MathSqrtInstr* instr) {
const Object& value = instr->value()->definition()->constant_value();
if (IsNonConstant(value)) {
« no previous file with comments | « no previous file | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698