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/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 4124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4135 switch (op_kind()) { | 4135 switch (op_kind()) { |
4136 case Token::kADD: __ vaddd(result, left, right); break; | 4136 case Token::kADD: __ vaddd(result, left, right); break; |
4137 case Token::kSUB: __ vsubd(result, left, right); break; | 4137 case Token::kSUB: __ vsubd(result, left, right); break; |
4138 case Token::kMUL: __ vmuld(result, left, right); break; | 4138 case Token::kMUL: __ vmuld(result, left, right); break; |
4139 case Token::kDIV: __ vdivd(result, left, right); break; | 4139 case Token::kDIV: __ vdivd(result, left, right); break; |
4140 default: UNREACHABLE(); | 4140 default: UNREACHABLE(); |
4141 } | 4141 } |
4142 } | 4142 } |
4143 | 4143 |
4144 | 4144 |
| 4145 LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone, |
| 4146 bool opt) const { |
| 4147 const intptr_t kNumInputs = 1; |
| 4148 const intptr_t kNumTemps = 0; |
| 4149 LocationSummary* summary = new(zone) LocationSummary( |
| 4150 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4151 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4152 summary->set_out(0, Location::RequiresRegister()); |
| 4153 return summary; |
| 4154 } |
| 4155 |
| 4156 |
| 4157 void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4158 ASSERT(compiler->is_optimizing()); |
| 4159 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
| 4160 const Register result = locs()->out(0).reg(); |
| 4161 if (op_kind() == MethodRecognizer::kDouble_getIsNaN) { |
| 4162 __ LoadObject(result, Bool::False()); |
| 4163 __ vcmpd(value, value); |
| 4164 __ vmstat(); |
| 4165 __ LoadObject(result, Bool::True(), VS); |
| 4166 } else { |
| 4167 ASSERT(op_kind() == MethodRecognizer::kDouble_getIsInfinite); |
| 4168 Label done; |
| 4169 // TMP <- value[0:31], result <- value[32:63] |
| 4170 __ vmovrrd(TMP, result, value); |
| 4171 __ cmp(TMP, Operand(0)); |
| 4172 __ LoadObject(result, Bool::False(), NE); |
| 4173 __ b(&done, NE); |
| 4174 |
| 4175 // Mask off the sign bit. |
| 4176 __ AndImmediate(result, result, 0x7FFFFFFF); |
| 4177 // Compare with +infinity. |
| 4178 __ CompareImmediate(result, 0x7FF00000); |
| 4179 __ LoadObject(result, Bool::False(), NE); |
| 4180 __ b(&done, NE); |
| 4181 |
| 4182 __ LoadObject(result, Bool::True()); |
| 4183 __ Bind(&done); |
| 4184 } |
| 4185 } |
| 4186 |
| 4187 |
4145 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone, | 4188 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone, |
4146 bool opt) const { | 4189 bool opt) const { |
4147 const intptr_t kNumInputs = 2; | 4190 const intptr_t kNumInputs = 2; |
4148 const intptr_t kNumTemps = 0; | 4191 const intptr_t kNumTemps = 0; |
4149 LocationSummary* summary = new(zone) LocationSummary( | 4192 LocationSummary* summary = new(zone) LocationSummary( |
4150 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4193 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4151 summary->set_in(0, Location::RequiresFpuRegister()); | 4194 summary->set_in(0, Location::RequiresFpuRegister()); |
4152 summary->set_in(1, Location::RequiresFpuRegister()); | 4195 summary->set_in(1, Location::RequiresFpuRegister()); |
4153 summary->set_out(0, Location::RequiresFpuRegister()); | 4196 summary->set_out(0, Location::RequiresFpuRegister()); |
4154 return summary; | 4197 return summary; |
(...skipping 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7013 1, | 7056 1, |
7014 locs()); | 7057 locs()); |
7015 __ Drop(1); | 7058 __ Drop(1); |
7016 __ Pop(result); | 7059 __ Pop(result); |
7017 } | 7060 } |
7018 | 7061 |
7019 | 7062 |
7020 } // namespace dart | 7063 } // namespace dart |
7021 | 7064 |
7022 #endif // defined TARGET_ARCH_ARM | 7065 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |