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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 14432004: Inline Float32x4 min,max,sqrt,reciprocal,reciprocalSqrt, and scale (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
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | tests/lib/typed_data/float32x4_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index f899f3e1fe3f5f4be5fbb799c437767cf5a45813..ac9d6f854b467f7c91ac49d1bf7ab9e1b4342d5f 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -3083,6 +3083,96 @@ void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+LocationSummary* Float32x4MinMaxInstr::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 Float32x4MinMaxInstr::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::kFloat32x4Min:
+ __ minps(left, right);
+ break;
+ case MethodRecognizer::kFloat32x4Max:
+ __ maxps(left, right);
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
+LocationSummary* Float32x4ScaleInstr::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 Float32x4ScaleInstr::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::kFloat32x4Scale:
+ __ cvtsd2ss(left, left);
+ __ shufps(left, left, Immediate(0x00));
+ __ mulps(left, right);
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
+LocationSummary* Float32x4SqrtInstr::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 Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ XmmRegister left = locs()->in(0).fpu_reg();
+
+ ASSERT(locs()->out().fpu_reg() == left);
+
+ switch (op_kind()) {
+ case MethodRecognizer::kFloat32x4Sqrt:
+ __ sqrtps(left);
+ break;
+ case MethodRecognizer::kFloat32x4Reciprocal:
+ __ reciprocalps(left);
+ break;
+ case MethodRecognizer::kFloat32x4ReciprocalSqrt:
+ __ rsqrtps(left);
+ break;
+ default: UNREACHABLE();
+ }
+}
+
+
LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | tests/lib/typed_data/float32x4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698