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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 14781002: Inline remaining Float32x4 operations. (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 b085eed1ae17e8bcad95bc3a5199f42d51a7fc60..20095edb23c05cfa7b25b7fa9c5d64308b89804d 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -3166,6 +3166,139 @@ void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+LocationSummary* Float32x4ZeroArgInstr::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 Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister left = locs()->in(0).fpu_reg();
+
+ ASSERT(locs()->out().fpu_reg() == left);
+ switch (op_kind()) {
+ case MethodRecognizer::kFloat32x4Negate:
+ __ negateps(left);
+ break;
+ case MethodRecognizer::kFloat32x4Absolute:
+ __ absps(left);
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
+LocationSummary* Float32x4ClampInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 3;
+ 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_out(Location::SameAsFirstInput());
+ return summary;
+}
+
+
+void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister left = locs()->in(0).fpu_reg();
+ XmmRegister lower = locs()->in(1).fpu_reg();
+ XmmRegister upper = locs()->in(2).fpu_reg();
+ ASSERT(locs()->out().fpu_reg() == left);
+ __ minps(left, upper);
+ __ maxps(left, lower);
+}
+
+
+LocationSummary* Float32x4WithInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 2;
+ 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_out(Location::SameAsFirstInput());
+ return summary;
+}
+
+void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister replacement = locs()->in(0).fpu_reg();
+ XmmRegister value = locs()->in(1).fpu_reg();
+
+ ASSERT(locs()->out().fpu_reg() == replacement);
+
+ switch (op_kind()) {
+ case MethodRecognizer::kFloat32x4WithX:
+ __ cvtsd2ss(replacement, replacement);
+ __ subl(ESP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(ESP, -16), value);
+ // Write over X value.
+ __ movss(Address(ESP, -16), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(ESP, -16));
+ __ addl(ESP, Immediate(16));
+ break;
+ case MethodRecognizer::kFloat32x4WithY:
+ __ cvtsd2ss(replacement, replacement);
+ __ subl(ESP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(ESP, -16), value);
+ // Write over Y value.
+ __ movss(Address(ESP, -12), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(ESP, -16));
+ __ addl(ESP, Immediate(16));
+ break;
+ case MethodRecognizer::kFloat32x4WithZ:
+ __ cvtsd2ss(replacement, replacement);
+ __ subl(ESP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(ESP, -16), value);
+ // Write over Z value.
+ __ movss(Address(ESP, -8), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(ESP, -16));
+ __ addl(ESP, Immediate(16));
+ break;
+ case MethodRecognizer::kFloat32x4WithW:
+ __ cvtsd2ss(replacement, replacement);
+ __ subl(ESP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(ESP, -16), value);
+ // Write over W value.
+ __ movss(Address(ESP, -4), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(ESP, -16));
+ __ addl(ESP, Immediate(16));
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
+LocationSummary* Float32x4ToUint32x4Instr::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 Float32x4ToUint32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ // NOP.
+}
+
+
LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;

Powered by Google App Engine
This is Rietveld 408576698