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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 13936009: Inline Float32x4 constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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_ia32.cc
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index cd7e24812b5c42232eb1cc7135fdea9ab760e8da..ebbd07f7978acac3c57c4ece55a8bc54e7beea22 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -2895,6 +2895,94 @@ void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 4;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RequiresFpuRegister());
+ summary->set_in(1, Location::RequiresFpuRegister());
+ summary->set_in(2, Location::RequiresFpuRegister());
+ summary->set_in(3, Location::RequiresFpuRegister());
+ summary->set_out(Location::SameAsFirstInput());
+ return summary;
+}
+
+
+void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister v0 = locs()->in(0).fpu_reg();
+ XmmRegister v1 = locs()->in(1).fpu_reg();
+ XmmRegister v2 = locs()->in(2).fpu_reg();
+ XmmRegister v3 = locs()->in(3).fpu_reg();
+ ASSERT(v0 == locs()->out().fpu_reg());
+ switch (op_kind()) {
+ case MethodRecognizer::kFloat32x4Constructor:
+ __ subl(ESP, Immediate(16));
+ __ cvtsd2ss(v0, v0);
+ __ movss(Address(ESP, -16), v0);
+ __ movsd(v0, v1);
+ __ cvtsd2ss(v0, v0);
+ __ movss(Address(ESP, -12), v0);
+ __ movsd(v0, v2);
+ __ cvtsd2ss(v0, v0);
+ __ movss(Address(ESP, -8), v0);
+ __ movsd(v0, v3);
+ __ cvtsd2ss(v0, v0);
+ __ movss(Address(ESP, -4), v0);
+ __ movups(v0, Address(ESP, -16));
+ __ addl(ESP, Immediate(16));
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
+LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 0;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_out(Location::RequiresFpuRegister());
+ return summary;
+}
+
+
+void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister value = locs()->out().fpu_reg();
+ switch (op_kind()) {
+ case MethodRecognizer::kFloat32x4Zero:
+ __ xorps(value, value);
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
+LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RequiresFpuRegister());
+ summary->set_out(Location::SameAsFirstInput());
+ return summary;
+}
+
+
+void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister value = locs()->out().fpu_reg();
+ switch (op_kind()) {
+ case MethodRecognizer::kFloat32x4Splat:
+ // Convert to Float32.
+ __ cvtsd2ss(value, value);
+ // Splat across all lanes.
+ __ shufps(value, value, Immediate(0x00));
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;

Powered by Google App Engine
This is Rietveld 408576698