Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 172293004: Explicit conversions for Float32 array loads/stores. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed ARM register constraints Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 (representation() == kUnboxedInt32x4)) { 1036 (representation() == kUnboxedInt32x4)) {
1037 DRegister result = locs()->out().fpu_reg(); 1037 DRegister result = locs()->out().fpu_reg();
1038 switch (class_id()) { 1038 switch (class_id()) {
1039 case kTypedDataInt32ArrayCid: 1039 case kTypedDataInt32ArrayCid:
1040 UNIMPLEMENTED(); 1040 UNIMPLEMENTED();
1041 break; 1041 break;
1042 case kTypedDataUint32ArrayCid: 1042 case kTypedDataUint32ArrayCid:
1043 UNIMPLEMENTED(); 1043 UNIMPLEMENTED();
1044 break; 1044 break;
1045 case kTypedDataFloat32ArrayCid: 1045 case kTypedDataFloat32ArrayCid:
1046 // Load single precision float and promote to double. 1046 // Load single precision float.
1047 __ lwc1(STMP1, element_address); 1047 __ lwc1(EvenFRegisterOf(result), element_address);
1048 __ cvtds(result, STMP1);
1049 break; 1048 break;
1050 case kTypedDataFloat64ArrayCid: 1049 case kTypedDataFloat64ArrayCid:
1051 __ LoadDFromOffset(result, index.reg(), 1050 __ LoadDFromOffset(result, index.reg(),
1052 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); 1051 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag);
1053 break; 1052 break;
1054 case kTypedDataInt32x4ArrayCid: 1053 case kTypedDataInt32x4ArrayCid:
1055 case kTypedDataFloat32x4ArrayCid: 1054 case kTypedDataFloat32x4ArrayCid:
1056 UNIMPLEMENTED(); 1055 UNIMPLEMENTED();
1057 break; 1056 break;
1058 } 1057 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 if (value()->IsSmiValue()) { 1300 if (value()->IsSmiValue()) {
1302 ASSERT(RequiredInputRepresentation(2) == kTagged); 1301 ASSERT(RequiredInputRepresentation(2) == kTagged);
1303 Register value = locs()->in(2).reg(); 1302 Register value = locs()->in(2).reg();
1304 __ SmiUntag(value); 1303 __ SmiUntag(value);
1305 __ sw(value, element_address); 1304 __ sw(value, element_address);
1306 } else { 1305 } else {
1307 UNIMPLEMENTED(); 1306 UNIMPLEMENTED();
1308 } 1307 }
1309 break; 1308 break;
1310 } 1309 }
1311 case kTypedDataFloat32ArrayCid: 1310 case kTypedDataFloat32ArrayCid: {
1312 // Convert to single precision. 1311 FRegister value = EvenFRegisterOf(locs()->in(2).fpu_reg());
1313 __ cvtsd(STMP1, locs()->in(2).fpu_reg()); 1312 __ swc1(value, element_address);
1314 // Store.
1315 __ swc1(STMP1, element_address);
1316 break; 1313 break;
1314 }
1317 case kTypedDataFloat64ArrayCid: 1315 case kTypedDataFloat64ArrayCid:
1318 __ StoreDToOffset(locs()->in(2).fpu_reg(), index.reg(), 1316 __ StoreDToOffset(locs()->in(2).fpu_reg(), index.reg(),
1319 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); 1317 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag);
1320 break; 1318 break;
1321 case kTypedDataInt32x4ArrayCid: 1319 case kTypedDataInt32x4ArrayCid:
1322 case kTypedDataFloat32x4ArrayCid: 1320 case kTypedDataFloat32x4ArrayCid:
1323 UNIMPLEMENTED(); 1321 UNIMPLEMENTED();
1324 break; 1322 break;
1325 default: 1323 default:
1326 UNREACHABLE(); 1324 UNREACHABLE();
(...skipping 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after
3517 UNIMPLEMENTED(); 3515 UNIMPLEMENTED();
3518 return NULL; 3516 return NULL;
3519 } 3517 }
3520 3518
3521 3519
3522 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3520 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3523 UNIMPLEMENTED(); 3521 UNIMPLEMENTED();
3524 } 3522 }
3525 3523
3526 3524
3525 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(bool opt) const {
3526 const intptr_t kNumInputs = 1;
3527 const intptr_t kNumTemps = 0;
3528 LocationSummary* result =
3529 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3530 result->set_in(0, Location::RequiresFpuRegister());
3531 result->set_out(Location::SameAsFirstInput());
3532 return result;
3533 }
3534
3535
3536 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3537 DRegister value = locs()->in(0).fpu_reg();
3538 FRegister result = EvenFRegisterOf(locs()->out().fpu_reg());
3539 __ cvtsd(result, value);
3540 }
3541
3542
3543 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(bool opt) const {
3544 const intptr_t kNumInputs = 1;
3545 const intptr_t kNumTemps = 0;
3546 LocationSummary* result =
3547 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3548 result->set_in(0, Location::RequiresFpuRegister());
3549 result->set_out(Location::SameAsFirstInput());
3550 return result;
3551 }
3552
3553
3554 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3555 FRegister value = EvenFRegisterOf(locs()->in(0).fpu_reg());
3556 DRegister result = locs()->out().fpu_reg();
3557 __ cvtds(result, value);
3558 }
3559
3560
3527 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const { 3561 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const {
3528 // Calling convetion on MIPS uses D6 and D7 to pass the first two 3562 // Calling convention on MIPS uses D6 and D7 to pass the first two
3529 // double arguments. 3563 // double arguments.
3530 ASSERT((InputCount() == 1) || (InputCount() == 2)); 3564 ASSERT((InputCount() == 1) || (InputCount() == 2));
3531 const intptr_t kNumTemps = 0; 3565 const intptr_t kNumTemps = 0;
3532 LocationSummary* result = 3566 LocationSummary* result =
3533 new LocationSummary(InputCount(), kNumTemps, LocationSummary::kCall); 3567 new LocationSummary(InputCount(), kNumTemps, LocationSummary::kCall);
3534 result->set_in(0, Location::FpuRegisterLocation(D6)); 3568 result->set_in(0, Location::FpuRegisterLocation(D6));
3535 if (InputCount() == 2) { 3569 if (InputCount() == 2) {
3536 result->set_in(1, Location::FpuRegisterLocation(D7)); 3570 result->set_in(1, Location::FpuRegisterLocation(D7));
3537 } 3571 }
3538 result->set_out(Location::FpuRegisterLocation(D0)); 3572 result->set_out(Location::FpuRegisterLocation(D0));
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
4170 compiler->GenerateCall(token_pos(), 4204 compiler->GenerateCall(token_pos(),
4171 &label, 4205 &label,
4172 PcDescriptors::kOther, 4206 PcDescriptors::kOther,
4173 locs()); 4207 locs());
4174 __ Drop(2); // Discard type arguments and receiver. 4208 __ Drop(2); // Discard type arguments and receiver.
4175 } 4209 }
4176 4210
4177 } // namespace dart 4211 } // namespace dart
4178 4212
4179 #endif // defined TARGET_ARCH_MIPS 4213 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698