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

Side by Side Diff: runtime/vm/intrinsifier_ia32.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 | « no previous file | runtime/vm/intrinsifier_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) 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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 bool Intrinsifier::Int32Array_getIndexed(Assembler* assembler) { 552 bool Intrinsifier::Int32Array_getIndexed(Assembler* assembler) {
553 return false; 553 return false;
554 } 554 }
555 555
556 556
557 bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) { 557 bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) {
558 return false; 558 return false;
559 } 559 }
560 560
561 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) { 561 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) {
562 // Temporary fix until cvtss2sd is implemented on x64. 562 Label fall_through;
563 /* Label fall_through;
564 TestByteArrayIndex(assembler, &fall_through); 563 TestByteArrayIndex(assembler, &fall_through);
565 // After TestByteArrayIndex: 564 // After TestByteArrayIndex:
566 // * EAX has the base address of the byte array. 565 // * EAX has the base address of the byte array.
567 // * EBX has the index into the array. 566 // * EBX has the index into the array.
568 // EBX contains the SMI index which is shifted left by 1. 567 // EBX contains the SMI index which is shifted left by 1.
569 // This shift means we only multiply the index by 2 not 4 (sizeof float). 568 // This shift means we only multiply the index by 2 not 4 (sizeof float).
570 // Load single precision float into XMM7. 569 // Load single precision float into XMM7.
571 __ movss(XMM7, FieldAddress(EAX, EBX, TIMES_2, 570 __ movss(XMM7, FieldAddress(EAX, EBX, TIMES_2,
572 Float32Array::data_offset())); 571 Float32Array::data_offset()));
573 // Convert into a double precision float. 572 // Convert into a double precision float.
574 __ cvtss2sd(XMM7, XMM7); 573 __ cvtss2sd(XMM7, XMM7);
575 // Allocate a double instance. 574 // Allocate a double instance.
576 const Class& double_class = Class::Handle( 575 const Class& double_class = Class::Handle(
577 Isolate::Current()->object_store()->double_class()); 576 Isolate::Current()->object_store()->double_class());
578 AssemblerMacros::TryAllocate(assembler, 577 AssemblerMacros::TryAllocate(assembler,
579 double_class, 578 double_class,
580 &fall_through, 579 &fall_through,
581 Assembler::kNearJump, EAX); 580 Assembler::kNearJump, EAX);
582 // Store XMM7 into double instance. 581 // Store XMM7 into double instance.
583 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM7); 582 __ movsd(FieldAddress(EAX, Double::value_offset()), XMM7);
584 __ ret(); 583 __ ret();
585 __ Bind(&fall_through); */ 584 __ Bind(&fall_through);
586 585
587 return false; 586 return false;
588 } 587 }
589 588
590 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) { 589 bool Intrinsifier::Float32Array_setIndexed(Assembler* assembler) {
591 return false; 590 return false;
592 } 591 }
593 592
594 // Tests if two top most arguments are smis, jumps to label not_smi if not. 593 // Tests if two top most arguments are smis, jumps to label not_smi if not.
595 // Topmost argument is in EAX. 594 // Topmost argument is in EAX.
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 __ Bind(&is_true); 1461 __ Bind(&is_true);
1463 __ LoadObject(EAX, bool_true); 1462 __ LoadObject(EAX, bool_true);
1464 __ ret(); 1463 __ ret();
1465 return true; 1464 return true;
1466 } 1465 }
1467 1466
1468 #undef __ 1467 #undef __
1469 } // namespace dart 1468 } // namespace dart
1470 1469
1471 #endif // defined TARGET_ARCH_IA32 1470 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698