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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 11573044: Inline Doubles truncate and round. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 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
Index: runtime/vm/intermediate_language_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 16607)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -2233,6 +2233,33 @@
}
+LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps =
+ (recognized_kind() == MethodRecognizer::kDoubleRound) ? 1 : 0;
+ LocationSummary* result =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ result->set_in(0, Location::RequiresXmmRegister());
+ result->set_out(Location::RequiresXmmRegister());
+ if (recognized_kind() == MethodRecognizer::kDoubleRound) {
+ result->set_temp(0, Location::RequiresXmmRegister());
+ }
+ return result;
+}
+
+
+void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister value = locs()->in(0).xmm_reg();
+ XmmRegister result = locs()->out().xmm_reg();
+ if (recognized_kind() == MethodRecognizer::kDoubleTruncate) {
+ __ roundsd(result, value, Assembler::kRoundToZero);
+ } else {
+ XmmRegister temp = locs()->temp(0).xmm_reg();
+ __ DoubleRound(result, value, temp);
+ }
+}
+
+
LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
return MakeCallSummary();
}
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698