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

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

Issue 1044503002: Refactor bigint shifting code in preparation of shifting intrinsics. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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
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_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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 __ xorq(RAX, RCX); 718 __ xorq(RAX, RCX);
719 // BSR does not write the destination register if source is zero. Put a 1 in 719 // BSR does not write the destination register if source is zero. Put a 1 in
720 // the Smi tag bit to ensure BSR writes to destination register. 720 // the Smi tag bit to ensure BSR writes to destination register.
721 __ orq(RAX, Immediate(kSmiTagMask)); 721 __ orq(RAX, Immediate(kSmiTagMask));
722 __ bsrq(RAX, RAX); 722 __ bsrq(RAX, RAX);
723 __ SmiTag(RAX); 723 __ SmiTag(RAX);
724 __ ret(); 724 __ ret();
725 } 725 }
726 726
727 727
728 void Intrinsifier::Bigint_lsh(Assembler* assembler) {
729 // TODO(regis): Implement.
730 }
731
732
733 void Intrinsifier::Bigint_rsh(Assembler* assembler) {
734 // TODO(regis): Implement.
735 }
736
737
728 void Intrinsifier::Bigint_absAdd(Assembler* assembler) { 738 void Intrinsifier::Bigint_absAdd(Assembler* assembler) {
729 // static void _absAdd(Uint32List digits, int used, 739 // static void _absAdd(Uint32List digits, int used,
730 // Uint32List a_digits, int a_used, 740 // Uint32List a_digits, int a_used,
731 // Uint32List r_digits) 741 // Uint32List r_digits)
732 742
733 __ movq(RDI, Address(RSP, 5 * kWordSize)); // digits 743 __ movq(RDI, Address(RSP, 5 * kWordSize)); // digits
734 __ movq(R8, Address(RSP, 4 * kWordSize)); // used is Smi 744 __ movq(R8, Address(RSP, 4 * kWordSize)); // used is Smi
735 __ addq(R8, Immediate(2)); // used > 0, Smi. R8 = used + 1, round up. 745 __ addq(R8, Immediate(2)); // used > 0, Smi. R8 = used + 1, round up.
736 __ sarq(R8, Immediate(2)); // R8 = number of digit pairs to process. 746 __ sarq(R8, Immediate(2)); // R8 = number of digit pairs to process.
737 __ movq(RSI, Address(RSP, 3 * kWordSize)); // a_digits 747 __ movq(RSI, Address(RSP, 3 * kWordSize)); // a_digits
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 // Set return value to Isolate::current_tag_. 1923 // Set return value to Isolate::current_tag_.
1914 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); 1924 __ movq(RAX, Address(RBX, Isolate::current_tag_offset()));
1915 __ ret(); 1925 __ ret();
1916 } 1926 }
1917 1927
1918 #undef __ 1928 #undef __
1919 1929
1920 } // namespace dart 1930 } // namespace dart
1921 1931
1922 #endif // defined TARGET_ARCH_X64 1932 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698