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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 1422753004: VM: Add double unary minus intrinsic. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « runtime/lib/double.dart ('k') | 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 aa5ba86cb22dc5cfe93aa6166d5421b0cba1e485..c3356b3a1942d37578e358486bb39a495cb97733 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -868,4 +868,23 @@ bool Intrinsifier::Build_GrowableArraySetLength(FlowGraph* flow_graph) {
return true;
}
+
+bool Intrinsifier::Build_DoubleFlipSignBit(FlowGraph* flow_graph) {
+ GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+ TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+ BlockBuilder builder(flow_graph, normal_entry);
+
+ Definition* receiver = builder.AddParameter(1);
+ Definition* unboxed_value =
+ builder.AddUnboxInstr(kUnboxedDouble, new Value(receiver));
+ Definition* unboxed_result = builder.AddDefinition(
+ new UnaryDoubleOpInstr(Token::kNEGATE,
+ new Value(unboxed_value),
+ Thread::kNoDeoptId));
+ Definition* result = builder.AddDefinition(
+ BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result)));
+ builder.AddIntrinsicReturn(new Value(result));
+ return true;
+}
+
} // namespace dart
« no previous file with comments | « runtime/lib/double.dart ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698