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

Unified Diff: runtime/vm/intermediate_language_x64.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_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index ac9d6f854b467f7c91ac49d1bf7ab9e1b4342d5f..989c41b4b2e3cf525eb39418bd153503aa0200bf 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -3173,6 +3173,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);
+ __ subq(RSP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(RSP, -16), value);
+ // Write over X value.
+ __ movss(Address(RSP, -16), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(RSP, -16));
+ __ addq(RSP, Immediate(16));
+ break;
+ case MethodRecognizer::kFloat32x4WithY:
+ __ cvtsd2ss(replacement, replacement);
+ __ subq(RSP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(RSP, -16), value);
+ // Write over Y value.
+ __ movss(Address(RSP, -12), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(RSP, -16));
+ __ addq(RSP, Immediate(16));
+ break;
+ case MethodRecognizer::kFloat32x4WithZ:
+ __ cvtsd2ss(replacement, replacement);
+ __ subq(RSP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(RSP, -16), value);
+ // Write over Z value.
+ __ movss(Address(RSP, -8), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(RSP, -16));
+ __ addq(RSP, Immediate(16));
+ break;
+ case MethodRecognizer::kFloat32x4WithW:
+ __ cvtsd2ss(replacement, replacement);
+ __ subq(RSP, Immediate(16));
+ // Move value to stack.
+ __ movups(Address(RSP, -16), value);
+ // Write over W value.
+ __ movss(Address(RSP, -4), replacement);
+ // Move updated value into output register.
+ __ movups(replacement, Address(RSP, -16));
+ __ addq(RSP, 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;
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698