| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 RBX, | 511 RBX, |
| 512 TIMES_2, | 512 TIMES_2, |
| 513 Uint32Array::data_offset())); | 513 Uint32Array::data_offset())); |
| 514 __ SmiTag(RAX); | 514 __ SmiTag(RAX); |
| 515 __ ret(); | 515 __ ret(); |
| 516 __ Bind(&fall_through); | 516 __ Bind(&fall_through); |
| 517 return false; | 517 return false; |
| 518 } | 518 } |
| 519 | 519 |
| 520 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) { | 520 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) { |
| 521 // Temporary fix until cvtss2sd implemented. | 521 Label fall_through; |
| 522 /*Label fall_through; | |
| 523 TestByteArrayIndex(assembler, &fall_through); | 522 TestByteArrayIndex(assembler, &fall_through); |
| 524 // After TestByteArrayIndex: | 523 // After TestByteArrayIndex: |
| 525 // * RAX has the base address of the byte array. | 524 // * RAX has the base address of the byte array. |
| 526 // * RBX has the index into the array. | 525 // * RBX has the index into the array. |
| 527 // RBX contains the SMI index which is shifted left by 1. | 526 // RBX contains the SMI index which is shifted left by 1. |
| 528 // This shift means we only multiply the index by 2 not 4 (sizeof float). | 527 // This shift means we only multiply the index by 2 not 4 (sizeof float). |
| 529 // Load single precision float into XMM7. | 528 // Load single precision float into XMM7. |
| 530 __ movss(XMM7, FieldAddress(RAX, RBX, TIMES_2, | 529 __ movss(XMM7, FieldAddress(RAX, RBX, TIMES_2, |
| 531 Float32Array::data_offset())); | 530 Float32Array::data_offset())); |
| 532 // Convert into a double precision float. | 531 // Convert into a double precision float. |
| 533 __ cvtss2sd(XMM7, XMM7); | 532 __ cvtss2sd(XMM7, XMM7); |
| 534 // Allocate a double instance. | 533 // Allocate a double instance. |
| 535 const Class& double_class = Class::Handle( | 534 const Class& double_class = Class::Handle( |
| 536 Isolate::Current()->object_store()->double_class()); | 535 Isolate::Current()->object_store()->double_class()); |
| 537 AssemblerMacros::TryAllocate(assembler, | 536 AssemblerMacros::TryAllocate(assembler, |
| 538 double_class, | 537 double_class, |
| 539 &fall_through, | 538 &fall_through, |
| 540 Assembler::kNearJump, RAX); | 539 Assembler::kNearJump, RAX); |
| 541 // Store XMM7 into double instance. | 540 // Store XMM7 into double instance. |
| 542 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM7); | 541 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM7); |
| 543 __ ret(); | 542 __ ret(); |
| 544 __ Bind(&fall_through); */ | 543 __ Bind(&fall_through); |
| 545 return false; | 544 return false; |
| 546 } | 545 } |
| 547 | 546 |
| 548 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { | 547 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { |
| 549 return false; | 548 return false; |
| 550 } | 549 } |
| 551 | 550 |
| 552 | 551 |
| 553 // Tests if two top most arguments are smis, jumps to label not_smi if not. | 552 // Tests if two top most arguments are smis, jumps to label not_smi if not. |
| 554 // Topmost argument is in RAX. | 553 // Topmost argument is in RAX. |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 __ LoadObject(RAX, bool_true); | 1416 __ LoadObject(RAX, bool_true); |
| 1418 __ ret(); | 1417 __ ret(); |
| 1419 return true; | 1418 return true; |
| 1420 } | 1419 } |
| 1421 | 1420 |
| 1422 #undef __ | 1421 #undef __ |
| 1423 | 1422 |
| 1424 } // namespace dart | 1423 } // namespace dart |
| 1425 | 1424 |
| 1426 #endif // defined TARGET_ARCH_X64 | 1425 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |