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

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 193183003: Inline Float64x2 methods that take 1 argument (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 4010 matching lines...) Expand 10 before | Expand all | Expand 10 after
4021 break; 4021 break;
4022 case MethodRecognizer::kFloat64x2GetSignMask: 4022 case MethodRecognizer::kFloat64x2GetSignMask:
4023 __ movmskpd(locs()->out().reg(), left); 4023 __ movmskpd(locs()->out().reg(), left);
4024 __ SmiTag(locs()->out().reg()); 4024 __ SmiTag(locs()->out().reg());
4025 break; 4025 break;
4026 default: UNREACHABLE(); 4026 default: UNREACHABLE();
4027 } 4027 }
4028 } 4028 }
4029 4029
4030 4030
4031 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(bool opt) const {
4032 const intptr_t kNumInputs = 2;
4033 const intptr_t kNumTemps = 0;
4034 LocationSummary* summary =
4035 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
4036 summary->set_in(0, Location::RequiresFpuRegister());
4037 summary->set_in(1, Location::RequiresFpuRegister());
4038 summary->set_out(Location::SameAsFirstInput());
4039 return summary;
4040 }
4041
4042
4043 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4044 XmmRegister left = locs()->in(0).fpu_reg();
4045 XmmRegister right = locs()->in(1).fpu_reg();
4046 ASSERT((locs()->out().fpu_reg() == left));
4047
4048 switch (op_kind()) {
4049 case MethodRecognizer::kFloat64x2Scale:
4050 __ shufpd(right, right, Immediate(0x00));
4051 __ mulpd(left, right);
4052 break;
4053 case MethodRecognizer::kFloat64x2WithX:
4054 __ subl(ESP, Immediate(16));
4055 // Move value to stack.
4056 __ movups(Address(ESP, 0), left);
4057 // Write over X value.
4058 __ movsd(Address(ESP, 0), right);
4059 // Move updated value into output register.
4060 __ movups(left, Address(ESP, 0));
4061 __ addl(ESP, Immediate(16));
4062 break;
4063 case MethodRecognizer::kFloat64x2WithY:
4064 __ subl(ESP, Immediate(16));
4065 // Move value to stack.
4066 __ movups(Address(ESP, 0), left);
4067 // Write over Y value.
4068 __ movsd(Address(ESP, 8), right);
4069 // Move updated value into output register.
4070 __ movups(left, Address(ESP, 0));
4071 __ addl(ESP, Immediate(16));
4072 break;
4073 case MethodRecognizer::kFloat64x2Min:
4074 __ minpd(left, right);
4075 break;
4076 case MethodRecognizer::kFloat64x2Max:
4077 __ maxpd(left, right);
4078 break;
4079 default: UNREACHABLE();
4080 }
4081 }
4082
4083
4031 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( 4084 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
4032 bool opt) const { 4085 bool opt) const {
4033 const intptr_t kNumInputs = 4; 4086 const intptr_t kNumInputs = 4;
4034 const intptr_t kNumTemps = 0; 4087 const intptr_t kNumTemps = 0;
4035 LocationSummary* summary = 4088 LocationSummary* summary =
4036 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4089 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
4037 summary->set_in(0, Location::RequiresRegister()); 4090 summary->set_in(0, Location::RequiresRegister());
4038 summary->set_in(1, Location::RequiresRegister()); 4091 summary->set_in(1, Location::RequiresRegister());
4039 summary->set_in(2, Location::RequiresRegister()); 4092 summary->set_in(2, Location::RequiresRegister());
4040 summary->set_in(3, Location::RequiresRegister()); 4093 summary->set_in(3, Location::RequiresRegister());
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
5680 PcDescriptors::kOther, 5733 PcDescriptors::kOther,
5681 locs()); 5734 locs());
5682 __ Drop(ArgumentCount()); // Discard arguments. 5735 __ Drop(ArgumentCount()); // Discard arguments.
5683 } 5736 }
5684 5737
5685 } // namespace dart 5738 } // namespace dart
5686 5739
5687 #undef __ 5740 #undef __
5688 5741
5689 #endif // defined TARGET_ARCH_IA32 5742 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698