| 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 3212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3223 case Token::kBIT_NOT: | 3223 case Token::kBIT_NOT: |
| 3224 __ nor(result, value, ZR); | 3224 __ nor(result, value, ZR); |
| 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 { |
| 3234 const intptr_t kNumInputs = 1; |
| 3235 const intptr_t kNumTemps = 2; |
| 3236 LocationSummary* summary = |
| 3237 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3238 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3239 summary->set_out(Location::RequiresFpuRegister()); |
| 3240 summary->set_temp(0, Location::RequiresRegister()); |
| 3241 summary->set_in(2, Location::RequiresFpuRegister()); |
| 3242 return summary; |
| 3243 } |
| 3244 |
| 3245 |
| 3246 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3247 // TODO(zra): Implement vneg. |
| 3248 Register temp = locs()->temp(0).reg(); |
| 3249 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); |
| 3250 __ LoadObject(temp, minus_one); |
| 3251 FpuRegister result = locs()->out().fpu_reg(); |
| 3252 FpuRegister value = locs()->in(0).fpu_reg(); |
| 3253 FpuRegister temp_fp = locs()->temp(1).fpu_reg(); |
| 3254 __ LoadDFromOffset(temp_fp, temp, Double::value_offset() - kHeapObjectTag); |
| 3255 __ muld(result, value, temp_fp); |
| 3256 } |
| 3257 |
| 3258 |
| 3259 |
| 3233 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const { | 3260 LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const { |
| 3234 const intptr_t kNumInputs = 1; | 3261 const intptr_t kNumInputs = 1; |
| 3235 const intptr_t kNumTemps = 0; | 3262 const intptr_t kNumTemps = 0; |
| 3236 LocationSummary* result = | 3263 LocationSummary* result = |
| 3237 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3264 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3238 result->set_in(0, Location::WritableRegister()); | 3265 result->set_in(0, Location::WritableRegister()); |
| 3239 result->set_out(Location::RequiresFpuRegister()); | 3266 result->set_out(Location::RequiresFpuRegister()); |
| 3240 return result; | 3267 return result; |
| 3241 } | 3268 } |
| 3242 | 3269 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3883 compiler->GenerateCall(token_pos(), | 3910 compiler->GenerateCall(token_pos(), |
| 3884 &label, | 3911 &label, |
| 3885 PcDescriptors::kOther, | 3912 PcDescriptors::kOther, |
| 3886 locs()); | 3913 locs()); |
| 3887 __ Drop(2); // Discard type arguments and receiver. | 3914 __ Drop(2); // Discard type arguments and receiver. |
| 3888 } | 3915 } |
| 3889 | 3916 |
| 3890 } // namespace dart | 3917 } // namespace dart |
| 3891 | 3918 |
| 3892 #endif // defined TARGET_ARCH_MIPS | 3919 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |