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

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..3e48d147e610510239d16b905cdb01d719a97957 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -5,6 +5,7 @@
#include "vm/assembler.h"
#include "vm/compiler.h"
+#include "vm/cpu.h"
Florian Schneider 2016/03/28 19:42:54 Why is this include needed?
Cutch 2016/03/28 20:08:45 Removed.
#include "vm/flags.h"
#include "vm/flow_graph.h"
#include "vm/flow_graph_compiler.h"
@@ -1068,4 +1069,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