| 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 4100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4111 break; | 4111 break; |
| 4112 default: | 4112 default: |
| 4113 UNREACHABLE(); | 4113 UNREACHABLE(); |
| 4114 } | 4114 } |
| 4115 } | 4115 } |
| 4116 | 4116 |
| 4117 | 4117 |
| 4118 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone, | 4118 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone, |
| 4119 bool opt) const { | 4119 bool opt) const { |
| 4120 const intptr_t kNumInputs = 1; | 4120 const intptr_t kNumInputs = 1; |
| 4121 const intptr_t kNumTemps = 1; | 4121 const intptr_t kNumTemps = 0; |
| 4122 LocationSummary* summary = new(zone) LocationSummary( | 4122 LocationSummary* summary = new(zone) LocationSummary( |
| 4123 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4123 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4124 summary->set_in(0, Location::RequiresFpuRegister()); | 4124 summary->set_in(0, Location::RequiresFpuRegister()); |
| 4125 summary->set_out(0, Location::RequiresFpuRegister()); | 4125 summary->set_out(0, Location::RequiresFpuRegister()); |
| 4126 summary->set_temp(0, Location::RequiresFpuRegister()); | |
| 4127 return summary; | 4126 return summary; |
| 4128 } | 4127 } |
| 4129 | 4128 |
| 4130 | 4129 |
| 4131 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4130 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4132 // TODO(zra): Implement vneg. | |
| 4133 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); | |
| 4134 __ LoadObject(TMP, minus_one); | |
| 4135 FpuRegister result = locs()->out(0).fpu_reg(); | 4131 FpuRegister result = locs()->out(0).fpu_reg(); |
| 4136 FpuRegister value = locs()->in(0).fpu_reg(); | 4132 FpuRegister value = locs()->in(0).fpu_reg(); |
| 4137 FpuRegister temp_fp = locs()->temp(0).fpu_reg(); | 4133 __ negd(result, value); |
| 4138 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag); | |
| 4139 __ muld(result, value, temp_fp); | |
| 4140 } | 4134 } |
| 4141 | 4135 |
| 4142 | 4136 |
| 4143 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone, | 4137 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone, |
| 4144 bool opt) const { | 4138 bool opt) const { |
| 4145 const intptr_t kNumInputs = 1; | 4139 const intptr_t kNumInputs = 1; |
| 4146 const intptr_t kNumTemps = 0; | 4140 const intptr_t kNumTemps = 0; |
| 4147 LocationSummary* result = new(zone) LocationSummary( | 4141 LocationSummary* result = new(zone) LocationSummary( |
| 4148 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4142 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 4149 result->set_in(0, Location::RequiresRegister()); | 4143 result->set_in(0, Location::RequiresRegister()); |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5603 1, | 5597 1, |
| 5604 locs()); | 5598 locs()); |
| 5605 __ lw(result, Address(SP, 1 * kWordSize)); | 5599 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5606 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5600 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5607 } | 5601 } |
| 5608 | 5602 |
| 5609 | 5603 |
| 5610 } // namespace dart | 5604 } // namespace dart |
| 5611 | 5605 |
| 5612 #endif // defined TARGET_ARCH_MIPS | 5606 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |