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

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

Issue 10987103: The real fix of float32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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/intrinsifier_ia32.cc ('k') | no next file » | 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) 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
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 Label fall_through; 521 // Temporary fix until cvtss2sd implemented.
522 /*Label fall_through;
522 TestByteArrayIndex(assembler, &fall_through); 523 TestByteArrayIndex(assembler, &fall_through);
523 // After TestByteArrayIndex: 524 // After TestByteArrayIndex:
524 // * RAX has the base address of the byte array. 525 // * RAX has the base address of the byte array.
525 // * RBX has the index into the array. 526 // * RBX has the index into the array.
526 // RBX contains the SMI index which is shifted left by 1. 527 // RBX contains the SMI index which is shifted left by 1.
527 // This shift means we only multiply the index by 2 not 4 (sizeof float). 528 // This shift means we only multiply the index by 2 not 4 (sizeof float).
528 // Load single precision float into XMM7. 529 // Load single precision float into XMM7.
529 __ movss(XMM7, FieldAddress(RAX, RBX, TIMES_2, 530 __ movss(XMM7, FieldAddress(RAX, RBX, TIMES_2,
530 Float32Array::data_offset())); 531 Float32Array::data_offset()));
531 // Convert into a double precision float. 532 // Convert into a double precision float.
532 __ cvtss2sd(XMM7, XMM7); 533 __ cvtss2sd(XMM7, XMM7);
533 // Allocate a double instance. 534 // Allocate a double instance.
534 const Class& double_class = Class::Handle( 535 const Class& double_class = Class::Handle(
535 Isolate::Current()->object_store()->double_class()); 536 Isolate::Current()->object_store()->double_class());
536 AssemblerMacros::TryAllocate(assembler, 537 AssemblerMacros::TryAllocate(assembler,
537 double_class, 538 double_class,
538 &fall_through, 539 &fall_through,
539 Assembler::kNearJump, RAX); 540 Assembler::kNearJump, RAX);
540 // Store XMM7 into double instance. 541 // Store XMM7 into double instance.
541 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM7); 542 __ movsd(FieldAddress(RAX, Double::value_offset()), XMM7);
542 __ ret(); 543 __ ret();
543 __ Bind(&fall_through); 544 __ Bind(&fall_through); */
544 return false; 545 return false;
545 } 546 }
546 547
547 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { 548 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) {
548 return false; 549 return false;
549 } 550 }
550 551
551 552
552 // Tests if two top most arguments are smis, jumps to label not_smi if not. 553 // Tests if two top most arguments are smis, jumps to label not_smi if not.
553 // Topmost argument is in RAX. 554 // Topmost argument is in RAX.
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 __ LoadObject(RAX, bool_true); 1417 __ LoadObject(RAX, bool_true);
1417 __ ret(); 1418 __ ret();
1418 return true; 1419 return true;
1419 } 1420 }
1420 1421
1421 #undef __ 1422 #undef __
1422 1423
1423 } // namespace dart 1424 } // namespace dart
1424 1425
1425 #endif // defined TARGET_ARCH_X64 1426 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698