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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 1832343003: Intrinsify some double operations, helps in AOT (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | runtime/vm/method_recognizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier.cc
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index 364004a2a624bb6470065b374e9e5dd30df83ef2..7e4477af3e857e95f6b3c212d1bd4559ba9c69fe 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -1068,4 +1068,65 @@ bool Intrinsifier::Build_MathAtan2(FlowGraph* flow_graph) {
/* num_parameters = */ 2);
}
+
+bool Intrinsifier::Build_DoubleMod(FlowGraph* flow_graph) {
+ if (!FlowGraphCompiler::SupportsUnboxedDoubles()) return false;
+
+ GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+ TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+ BlockBuilder builder(flow_graph, normal_entry);
+
+ return BuildInvokeMathCFunction(&builder,
+ MethodRecognizer::kDoubleMod,
+ /* num_parameters = */ 2);
+}
+
+
+bool Intrinsifier::Build_DoubleCeil(FlowGraph* flow_graph) {
+ if (!FlowGraphCompiler::SupportsUnboxedDoubles()) return false;
+
+ GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+ TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+ BlockBuilder builder(flow_graph, normal_entry);
+
+ return BuildInvokeMathCFunction(&builder,
+ MethodRecognizer::kDoubleCeil);
+}
+
+
+bool Intrinsifier::Build_DoubleFloor(FlowGraph* flow_graph) {
+ if (!FlowGraphCompiler::SupportsUnboxedDoubles()) return false;
+
+ GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+ TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+ BlockBuilder builder(flow_graph, normal_entry);
+
+ return BuildInvokeMathCFunction(&builder,
+ MethodRecognizer::kDoubleFloor);
+}
+
+
+bool Intrinsifier::Build_DoubleTruncate(FlowGraph* flow_graph) {
+ if (!FlowGraphCompiler::SupportsUnboxedDoubles()) return false;
+
+ GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+ TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+ BlockBuilder builder(flow_graph, normal_entry);
+
+ return BuildInvokeMathCFunction(&builder,
+ MethodRecognizer::kDoubleTruncate);
+}
+
+
+bool Intrinsifier::Build_DoubleRound(FlowGraph* flow_graph) {
+ if (!FlowGraphCompiler::SupportsUnboxedDoubles()) return false;
+
+ GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+ TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+ BlockBuilder builder(flow_graph, normal_entry);
+
+ return BuildInvokeMathCFunction(&builder,
+ MethodRecognizer::kDoubleRound);
+}
+
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/method_recognizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698