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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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 4008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4019 DRegister dr0 = EvenDRegisterOf(r); | 4019 DRegister dr0 = EvenDRegisterOf(r); |
4020 DRegister dr1 = OddDRegisterOf(r); | 4020 DRegister dr1 = OddDRegisterOf(r); |
4021 | 4021 |
4022 // Set X. | 4022 // Set X. |
4023 __ vcvtds(dr0, EvenSRegisterOf(dq0)); | 4023 __ vcvtds(dr0, EvenSRegisterOf(dq0)); |
4024 // Set Y. | 4024 // Set Y. |
4025 __ vcvtds(dr1, OddSRegisterOf(dq0)); | 4025 __ vcvtds(dr1, OddSRegisterOf(dq0)); |
4026 } | 4026 } |
4027 | 4027 |
4028 | 4028 |
| 4029 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(bool opt) const { |
| 4030 const intptr_t kNumInputs = 1; |
| 4031 const intptr_t kNumTemps = 0; |
| 4032 LocationSummary* summary = |
| 4033 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4034 |
| 4035 if (representation() == kTagged) { |
| 4036 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); |
| 4037 // Grabbing the S components means we need a low (< 7) Q. |
| 4038 summary->set_in(0, Location::FpuRegisterLocation(Q6)); |
| 4039 summary->set_out(Location::RequiresRegister()); |
| 4040 summary->AddTemp(Location::RequiresRegister()); |
| 4041 } else { |
| 4042 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4043 summary->set_out(Location::RequiresFpuRegister()); |
| 4044 } |
| 4045 return summary; |
| 4046 } |
| 4047 |
| 4048 |
| 4049 void Float64x2ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4050 QRegister q = locs()->in(0).fpu_reg(); |
| 4051 |
| 4052 if ((op_kind() == MethodRecognizer::kFloat64x2GetSignMask)) { |
| 4053 DRegister dvalue0 = EvenDRegisterOf(q); |
| 4054 DRegister dvalue1 = OddDRegisterOf(q); |
| 4055 |
| 4056 Register out = locs()->out().reg(); |
| 4057 Register temp = locs()->temp(0).reg(); |
| 4058 |
| 4059 // Upper 32-bits of X lane. |
| 4060 __ vmovrs(out, OddSRegisterOf(dvalue0)); |
| 4061 __ Lsr(out, out, 31); |
| 4062 // Upper 32-bits of Y lane. |
| 4063 __ vmovrs(temp, OddSRegisterOf(dvalue1)); |
| 4064 __ Lsr(temp, temp, 31); |
| 4065 __ orr(out, out, ShifterOperand(temp, LSL, 1)); |
| 4066 // Tag. |
| 4067 __ SmiTag(out); |
| 4068 return; |
| 4069 } |
| 4070 ASSERT(representation() == kUnboxedFloat64x2); |
| 4071 QRegister r = locs()->out().fpu_reg(); |
| 4072 |
| 4073 DRegister dvalue0 = EvenDRegisterOf(q); |
| 4074 DRegister dvalue1 = OddDRegisterOf(q); |
| 4075 DRegister dresult0 = EvenDRegisterOf(r); |
| 4076 DRegister dresult1 = OddDRegisterOf(r); |
| 4077 |
| 4078 switch (op_kind()) { |
| 4079 case MethodRecognizer::kFloat64x2Negate: |
| 4080 __ vnegd(dresult0, dvalue0); |
| 4081 __ vnegd(dresult1, dvalue1); |
| 4082 break; |
| 4083 case MethodRecognizer::kFloat64x2Abs: |
| 4084 __ vabsd(dresult0, dvalue0); |
| 4085 __ vabsd(dresult1, dvalue1); |
| 4086 break; |
| 4087 case MethodRecognizer::kFloat64x2Sqrt: |
| 4088 __ vsqrtd(dresult0, dvalue0); |
| 4089 __ vsqrtd(dresult1, dvalue1); |
| 4090 break; |
| 4091 default: UNREACHABLE(); |
| 4092 } |
| 4093 } |
| 4094 |
| 4095 |
4029 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( | 4096 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( |
4030 bool opt) const { | 4097 bool opt) const { |
4031 const intptr_t kNumInputs = 4; | 4098 const intptr_t kNumInputs = 4; |
4032 const intptr_t kNumTemps = 1; | 4099 const intptr_t kNumTemps = 1; |
4033 LocationSummary* summary = | 4100 LocationSummary* summary = |
4034 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4101 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4035 summary->set_in(0, Location::RequiresRegister()); | 4102 summary->set_in(0, Location::RequiresRegister()); |
4036 summary->set_in(1, Location::RequiresRegister()); | 4103 summary->set_in(1, Location::RequiresRegister()); |
4037 summary->set_in(2, Location::RequiresRegister()); | 4104 summary->set_in(2, Location::RequiresRegister()); |
4038 summary->set_in(3, Location::RequiresRegister()); | 4105 summary->set_in(3, Location::RequiresRegister()); |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5213 compiler->GenerateCall(token_pos(), | 5280 compiler->GenerateCall(token_pos(), |
5214 &label, | 5281 &label, |
5215 PcDescriptors::kOther, | 5282 PcDescriptors::kOther, |
5216 locs()); | 5283 locs()); |
5217 __ Drop(ArgumentCount()); // Discard arguments. | 5284 __ Drop(ArgumentCount()); // Discard arguments. |
5218 } | 5285 } |
5219 | 5286 |
5220 } // namespace dart | 5287 } // namespace dart |
5221 | 5288 |
5222 #endif // defined TARGET_ARCH_ARM | 5289 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |