Index: runtime/vm/intermediate_language_x64.cc |
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc |
index f987d8a715afc81d8e7c3416d774d1ea57208fed..debf5b30c64a2901f0d968a144d2c11d56f66133 100644 |
--- a/runtime/vm/intermediate_language_x64.cc |
+++ b/runtime/vm/intermediate_language_x64.cc |
@@ -3892,6 +3892,59 @@ void Float64x2ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} |
+LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(bool opt) 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 Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
+ XmmRegister left = locs()->in(0).fpu_reg(); |
+ XmmRegister right = locs()->in(1).fpu_reg(); |
+ ASSERT((locs()->out().fpu_reg() == left)); |
+ |
+ switch (op_kind()) { |
+ case MethodRecognizer::kFloat64x2Scale: |
+ __ shufpd(right, right, Immediate(0x00)); |
+ __ mulpd(left, right); |
+ break; |
+ case MethodRecognizer::kFloat64x2WithX: |
+ __ subq(RSP, Immediate(16)); |
+ // Move value to stack. |
+ __ movups(Address(RSP, 0), left); |
+ // Write over X value. |
+ __ movsd(Address(RSP, 0), right); |
+ // Move updated value into output register. |
+ __ movups(left, Address(RSP, 0)); |
+ __ addq(RSP, Immediate(16)); |
+ break; |
+ case MethodRecognizer::kFloat64x2WithY: |
+ __ subq(RSP, Immediate(16)); |
+ // Move value to stack. |
+ __ movups(Address(RSP, 0), left); |
+ // Write over Y value. |
+ __ movsd(Address(RSP, 8), right); |
+ // Move updated value into output register. |
+ __ movups(left, Address(RSP, 0)); |
+ __ addq(RSP, Immediate(16)); |
+ break; |
+ case MethodRecognizer::kFloat64x2Min: |
+ __ minpd(left, right); |
+ break; |
+ case MethodRecognizer::kFloat64x2Max: |
+ __ maxpd(left, right); |
+ break; |
+ default: UNREACHABLE(); |
+ } |
+} |
+ |
+ |
LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( |
bool opt) const { |
const intptr_t kNumInputs = 4; |