OLD | NEW |
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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 3874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3885 break; | 3885 break; |
3886 case MethodRecognizer::kFloat64x2GetSignMask: | 3886 case MethodRecognizer::kFloat64x2GetSignMask: |
3887 __ movmskpd(locs()->out().reg(), left); | 3887 __ movmskpd(locs()->out().reg(), left); |
3888 __ SmiTag(locs()->out().reg()); | 3888 __ SmiTag(locs()->out().reg()); |
3889 break; | 3889 break; |
3890 default: UNREACHABLE(); | 3890 default: UNREACHABLE(); |
3891 } | 3891 } |
3892 } | 3892 } |
3893 | 3893 |
3894 | 3894 |
| 3895 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(bool opt) const { |
| 3896 const intptr_t kNumInputs = 2; |
| 3897 const intptr_t kNumTemps = 0; |
| 3898 LocationSummary* summary = |
| 3899 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3900 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3901 summary->set_in(1, Location::RequiresFpuRegister()); |
| 3902 summary->set_out(Location::SameAsFirstInput()); |
| 3903 return summary; |
| 3904 } |
| 3905 |
| 3906 |
| 3907 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3908 XmmRegister left = locs()->in(0).fpu_reg(); |
| 3909 XmmRegister right = locs()->in(1).fpu_reg(); |
| 3910 ASSERT((locs()->out().fpu_reg() == left)); |
| 3911 |
| 3912 switch (op_kind()) { |
| 3913 case MethodRecognizer::kFloat64x2Scale: |
| 3914 __ shufpd(right, right, Immediate(0x00)); |
| 3915 __ mulpd(left, right); |
| 3916 break; |
| 3917 case MethodRecognizer::kFloat64x2WithX: |
| 3918 __ subq(RSP, Immediate(16)); |
| 3919 // Move value to stack. |
| 3920 __ movups(Address(RSP, 0), left); |
| 3921 // Write over X value. |
| 3922 __ movsd(Address(RSP, 0), right); |
| 3923 // Move updated value into output register. |
| 3924 __ movups(left, Address(RSP, 0)); |
| 3925 __ addq(RSP, Immediate(16)); |
| 3926 break; |
| 3927 case MethodRecognizer::kFloat64x2WithY: |
| 3928 __ subq(RSP, Immediate(16)); |
| 3929 // Move value to stack. |
| 3930 __ movups(Address(RSP, 0), left); |
| 3931 // Write over Y value. |
| 3932 __ movsd(Address(RSP, 8), right); |
| 3933 // Move updated value into output register. |
| 3934 __ movups(left, Address(RSP, 0)); |
| 3935 __ addq(RSP, Immediate(16)); |
| 3936 break; |
| 3937 case MethodRecognizer::kFloat64x2Min: |
| 3938 __ minpd(left, right); |
| 3939 break; |
| 3940 case MethodRecognizer::kFloat64x2Max: |
| 3941 __ maxpd(left, right); |
| 3942 break; |
| 3943 default: UNREACHABLE(); |
| 3944 } |
| 3945 } |
| 3946 |
| 3947 |
3895 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( | 3948 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( |
3896 bool opt) const { | 3949 bool opt) const { |
3897 const intptr_t kNumInputs = 4; | 3950 const intptr_t kNumInputs = 4; |
3898 const intptr_t kNumTemps = 1; | 3951 const intptr_t kNumTemps = 1; |
3899 LocationSummary* summary = | 3952 LocationSummary* summary = |
3900 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3953 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3901 summary->set_in(0, Location::RequiresRegister()); | 3954 summary->set_in(0, Location::RequiresRegister()); |
3902 summary->set_in(1, Location::RequiresRegister()); | 3955 summary->set_in(1, Location::RequiresRegister()); |
3903 summary->set_in(2, Location::RequiresRegister()); | 3956 summary->set_in(2, Location::RequiresRegister()); |
3904 summary->set_in(3, Location::RequiresRegister()); | 3957 summary->set_in(3, Location::RequiresRegister()); |
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5280 PcDescriptors::kOther, | 5333 PcDescriptors::kOther, |
5281 locs()); | 5334 locs()); |
5282 __ Drop(ArgumentCount()); // Discard arguments. | 5335 __ Drop(ArgumentCount()); // Discard arguments. |
5283 } | 5336 } |
5284 | 5337 |
5285 } // namespace dart | 5338 } // namespace dart |
5286 | 5339 |
5287 #undef __ | 5340 #undef __ |
5288 | 5341 |
5289 #endif // defined TARGET_ARCH_X64 | 5342 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |