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 "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3030 return NULL; | 3030 return NULL; |
3031 } | 3031 } |
3032 | 3032 |
3033 | 3033 |
3034 void BinaryUint32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3034 void BinaryUint32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3035 UNIMPLEMENTED(); | 3035 UNIMPLEMENTED(); |
3036 } | 3036 } |
3037 | 3037 |
3038 | 3038 |
3039 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { | 3039 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { |
3040 UNIMPLEMENTED(); | 3040 const intptr_t kNumInputs = 1; |
3041 return NULL; | 3041 const intptr_t kNumTemps = 0; |
| 3042 LocationSummary* summary = |
| 3043 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3044 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3045 summary->set_out(Location::RequiresFpuRegister()); |
| 3046 return summary; |
3042 } | 3047 } |
3043 | 3048 |
3044 | 3049 |
3045 void MathSqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3050 void MathSqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3046 UNIMPLEMENTED(); | 3051 __ sqrtd(locs()->out().fpu_reg(), locs()->in(0).fpu_reg()); |
3047 } | 3052 } |
3048 | 3053 |
3049 | 3054 |
3050 LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const { | 3055 LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const { |
3051 const intptr_t kNumInputs = 1; | 3056 const intptr_t kNumInputs = 1; |
3052 const intptr_t kNumTemps = 0; | 3057 const intptr_t kNumTemps = 0; |
3053 LocationSummary* summary = | 3058 LocationSummary* summary = |
3054 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3059 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3055 summary->set_in(0, Location::RequiresRegister()); | 3060 summary->set_in(0, Location::RequiresRegister()); |
3056 // We make use of 3-operand instructions by not requiring result register | 3061 // We make use of 3-operand instructions by not requiring result register |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3106 return NULL; | 3111 return NULL; |
3107 } | 3112 } |
3108 | 3113 |
3109 | 3114 |
3110 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3115 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3111 UNIMPLEMENTED(); | 3116 UNIMPLEMENTED(); |
3112 } | 3117 } |
3113 | 3118 |
3114 | 3119 |
3115 LocationSummary* DoubleToSmiInstr::MakeLocationSummary() const { | 3120 LocationSummary* DoubleToSmiInstr::MakeLocationSummary() const { |
3116 UNIMPLEMENTED(); | 3121 const intptr_t kNumInputs = 1; |
3117 return NULL; | 3122 const intptr_t kNumTemps = 0; |
| 3123 LocationSummary* result = new LocationSummary( |
| 3124 kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3125 result->set_in(0, Location::RequiresFpuRegister()); |
| 3126 result->set_out(Location::RequiresRegister()); |
| 3127 return result; |
3118 } | 3128 } |
3119 | 3129 |
3120 | 3130 |
3121 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3131 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3122 UNIMPLEMENTED(); | 3132 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptDoubleToSmi); |
| 3133 Register result = locs()->out().reg(); |
| 3134 DRegister value = locs()->in(0).fpu_reg(); |
| 3135 __ cvtwd(STMP1, value); |
| 3136 __ mfc1(result, STMP1); |
| 3137 |
| 3138 // Check for overflow and that it fits into Smi. |
| 3139 __ LoadImmediate(TMP, 0xC0000000); |
| 3140 __ subu(CMPRES, result, TMP); |
| 3141 __ bltz(CMPRES, deopt); |
| 3142 __ SmiTag(result); |
3123 } | 3143 } |
3124 | 3144 |
3125 | 3145 |
3126 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const { | 3146 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const { |
3127 UNIMPLEMENTED(); | 3147 UNIMPLEMENTED(); |
3128 return NULL; | 3148 return NULL; |
3129 } | 3149 } |
3130 | 3150 |
3131 | 3151 |
3132 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3152 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3704 compiler->GenerateCall(token_pos(), | 3724 compiler->GenerateCall(token_pos(), |
3705 &label, | 3725 &label, |
3706 PcDescriptors::kOther, | 3726 PcDescriptors::kOther, |
3707 locs()); | 3727 locs()); |
3708 __ Drop(2); // Discard type arguments and receiver. | 3728 __ Drop(2); // Discard type arguments and receiver. |
3709 } | 3729 } |
3710 | 3730 |
3711 } // namespace dart | 3731 } // namespace dart |
3712 | 3732 |
3713 #endif // defined TARGET_ARCH_MIPS | 3733 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |