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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 172293004: Explicit conversions for Float32 array loads/stores. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed ARM register constraints Created 6 years, 10 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/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 32847)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -960,9 +960,7 @@
__ movss(result, element_address);
break;
case kTypedDataFloat32ArrayCid:
- // Load single precision float and promote to double.
__ movss(result, element_address);
- __ cvtss2sd(result, locs()->out().fpu_reg());
break;
case kTypedDataFloat64ArrayCid:
__ movsd(result, element_address);
@@ -1109,9 +1107,6 @@
: Location::RequiresFpuRegister());
break;
case kTypedDataFloat32ArrayCid:
- // Need temp register for float-to-double conversion.
- locs->AddTemp(Location::RequiresFpuRegister());
- // Fall through.
case kTypedDataFloat64ArrayCid:
// TODO(srdjan): Support Float64 constants.
locs->set_in(2, Location::RequiresFpuRegister());
@@ -1229,10 +1224,7 @@
}
break;
case kTypedDataFloat32ArrayCid:
- // Convert to single precision.
- __ cvtsd2ss(locs()->temp(0).fpu_reg(), locs()->in(2).fpu_reg());
- // Store.
- __ movss(element_address, locs()->temp(0).fpu_reg());
+ __ movss(element_address, locs()->in(2).fpu_reg());
break;
case kTypedDataFloat64ArrayCid:
__ movsd(element_address, locs()->in(2).fpu_reg());
@@ -4166,6 +4158,38 @@
}
+LocationSummary* DoubleToFloatInstr::MakeLocationSummary(bool opt) const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* result =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ result->set_in(0, Location::RequiresFpuRegister());
+ result->set_out(Location::SameAsFirstInput());
+ return result;
+}
+
+
+void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ cvtsd2ss(locs()->out().fpu_reg(), locs()->in(0).fpu_reg());
+}
+
+
+LocationSummary* FloatToDoubleInstr::MakeLocationSummary(bool opt) const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* result =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ result->set_in(0, Location::RequiresFpuRegister());
+ result->set_out(Location::SameAsFirstInput());
+ return result;
+}
+
+
+void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ cvtss2sd(locs()->out().fpu_reg(), locs()->in(0).fpu_reg());
+}
+
+
LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const {
ASSERT((InputCount() == 1) || (InputCount() == 2));
const intptr_t kNumTemps = 0;
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698