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

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

Issue 1913663002: vm: Generate 'and' instruction for Smi values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: xxx Created 4 years, 6 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
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/jit_optimizer.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_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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 __ xorq(RAX, RCX); 734 __ xorq(RAX, RCX);
735 // BSR does not write the destination register if source is zero. Put a 1 in 735 // BSR does not write the destination register if source is zero. Put a 1 in
736 // the Smi tag bit to ensure BSR writes to destination register. 736 // the Smi tag bit to ensure BSR writes to destination register.
737 __ orq(RAX, Immediate(kSmiTagMask)); 737 __ orq(RAX, Immediate(kSmiTagMask));
738 __ bsrq(RAX, RAX); 738 __ bsrq(RAX, RAX);
739 __ SmiTag(RAX); 739 __ SmiTag(RAX);
740 __ ret(); 740 __ ret();
741 } 741 }
742 742
743 743
744 void Intrinsifier::Smi_bitAndFromSmi(Assembler* assembler) {
745 Integer_bitAndFromInteger(assembler);
746 }
747
748
744 void Intrinsifier::Bigint_lsh(Assembler* assembler) { 749 void Intrinsifier::Bigint_lsh(Assembler* assembler) {
745 // static void _lsh(Uint32List x_digits, int x_used, int n, 750 // static void _lsh(Uint32List x_digits, int x_used, int n,
746 // Uint32List r_digits) 751 // Uint32List r_digits)
747 752
748 __ movq(RDI, Address(RSP, 4 * kWordSize)); // x_digits 753 __ movq(RDI, Address(RSP, 4 * kWordSize)); // x_digits
749 __ movq(R8, Address(RSP, 3 * kWordSize)); // x_used is Smi 754 __ movq(R8, Address(RSP, 3 * kWordSize)); // x_used is Smi
750 __ subq(R8, Immediate(2)); // x_used > 0, Smi. R8 = x_used - 1, round up. 755 __ subq(R8, Immediate(2)); // x_used > 0, Smi. R8 = x_used - 1, round up.
751 __ sarq(R8, Immediate(2)); // R8 + 1 = number of digit pairs to read. 756 __ sarq(R8, Immediate(2)); // R8 + 1 = number of digit pairs to read.
752 __ movq(RCX, Address(RSP, 2 * kWordSize)); // n is Smi 757 __ movq(RCX, Address(RSP, 2 * kWordSize)); // n is Smi
753 __ SmiUntag(RCX); 758 __ SmiUntag(RCX);
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after
2119 __ Bind(&true_label); 2124 __ Bind(&true_label);
2120 __ LoadObject(RAX, Bool::True()); 2125 __ LoadObject(RAX, Bool::True());
2121 __ ret(); 2126 __ ret();
2122 } 2127 }
2123 2128
2124 #undef __ 2129 #undef __
2125 2130
2126 } // namespace dart 2131 } // namespace dart
2127 2132
2128 #endif // defined TARGET_ARCH_X64 2133 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698