| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 3214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3225 __ addiu(result, result, Immediate(-1)); // Remove inverted smi-tag. | 3225 __ addiu(result, result, Immediate(-1)); // Remove inverted smi-tag. |
| 3226 break; | 3226 break; |
| 3227 default: | 3227 default: |
| 3228 UNREACHABLE(); | 3228 UNREACHABLE(); |
| 3229 } | 3229 } |
| 3230 } | 3230 } |
| 3231 | 3231 |
| 3232 | 3232 |
| 3233 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary() const { | 3233 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary() const { |
| 3234 const intptr_t kNumInputs = 1; | 3234 const intptr_t kNumInputs = 1; |
| 3235 const intptr_t kNumTemps = 2; | 3235 const intptr_t kNumTemps = 1; |
| 3236 LocationSummary* summary = | 3236 LocationSummary* summary = |
| 3237 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3237 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3238 summary->set_in(0, Location::RequiresFpuRegister()); | 3238 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3239 summary->set_out(Location::RequiresFpuRegister()); | 3239 summary->set_out(Location::RequiresFpuRegister()); |
| 3240 summary->set_temp(0, Location::RequiresRegister()); | 3240 summary->set_temp(0, Location::RequiresFpuRegister()); |
| 3241 summary->set_in(2, Location::RequiresFpuRegister()); | |
| 3242 return summary; | 3241 return summary; |
| 3243 } | 3242 } |
| 3244 | 3243 |
| 3245 | 3244 |
| 3246 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3245 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3247 // TODO(zra): Implement vneg. | 3246 // TODO(zra): Implement vneg. |
| 3248 Register temp = locs()->temp(0).reg(); | |
| 3249 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); | 3247 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); |
| 3250 __ LoadObject(temp, minus_one); | 3248 __ LoadObject(TMP, minus_one); |
| 3251 FpuRegister result = locs()->out().fpu_reg(); | 3249 FpuRegister result = locs()->out().fpu_reg(); |
| 3252 FpuRegister value = locs()->in(0).fpu_reg(); | 3250 FpuRegister value = locs()->in(0).fpu_reg(); |
| 3253 FpuRegister temp_fp = locs()->temp(1).fpu_reg(); | 3251 FpuRegister temp_fp = locs()->temp(0).fpu_reg(); |
| 3254 __ LoadDFromOffset(temp_fp, temp, Double::value_offset() - kHeapObjectTag); | 3252 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag); |
| 3255 __ muld(result, value, temp_fp); | 3253 __ muld(result, value, temp_fp); |
| 3256 } | 3254 } |
| 3257 | 3255 |
| 3258 | 3256 |
| 3259 | 3257 |
| 3260 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const { | 3258 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const { |
| 3261 const intptr_t kNumInputs = 1; | 3259 const intptr_t kNumInputs = 1; |
| 3262 const intptr_t kNumTemps = 0; | 3260 const intptr_t kNumTemps = 0; |
| 3263 LocationSummary* result = | 3261 LocationSummary* result = |
| 3264 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3262 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3910 compiler->GenerateCall(token_pos(), | 3908 compiler->GenerateCall(token_pos(), |
| 3911 &label, | 3909 &label, |
| 3912 PcDescriptors::kOther, | 3910 PcDescriptors::kOther, |
| 3913 locs()); | 3911 locs()); |
| 3914 __ Drop(2); // Discard type arguments and receiver. | 3912 __ Drop(2); // Discard type arguments and receiver. |
| 3915 } | 3913 } |
| 3916 | 3914 |
| 3917 } // namespace dart | 3915 } // namespace dart |
| 3918 | 3916 |
| 3919 #endif // defined TARGET_ARCH_MIPS | 3917 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |