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

Side by Side Diff: runtime/vm/intrinsifier_arm64.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_arm.cc ('k') | runtime/vm/intrinsifier_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 // XOR with sign bit to complement bits if value is negative. 675 // XOR with sign bit to complement bits if value is negative.
676 __ eor(R0, R0, Operand(R0, ASR, 63)); 676 __ eor(R0, R0, Operand(R0, ASR, 63));
677 __ clz(R0, R0); 677 __ clz(R0, R0);
678 __ LoadImmediate(R1, 64); 678 __ LoadImmediate(R1, 64);
679 __ sub(R0, R1, Operand(R0)); 679 __ sub(R0, R1, Operand(R0));
680 __ SmiTag(R0); 680 __ SmiTag(R0);
681 __ ret(); 681 __ ret();
682 } 682 }
683 683
684 684
685 void Intrinsifier::Smi_bitAndFromSmi(Assembler* assembler) {
686 Integer_bitAndFromInteger(assembler);
687 }
688
689
685 void Intrinsifier::Bigint_lsh(Assembler* assembler) { 690 void Intrinsifier::Bigint_lsh(Assembler* assembler) {
686 // static void _lsh(Uint32List x_digits, int x_used, int n, 691 // static void _lsh(Uint32List x_digits, int x_used, int n,
687 // Uint32List r_digits) 692 // Uint32List r_digits)
688 693
689 // R2 = x_used, R3 = x_digits, x_used > 0, x_used is Smi. 694 // R2 = x_used, R3 = x_digits, x_used > 0, x_used is Smi.
690 __ ldp(R2, R3, Address(SP, 2 * kWordSize, Address::PairOffset)); 695 __ ldp(R2, R3, Address(SP, 2 * kWordSize, Address::PairOffset));
691 __ add(R2, R2, Operand(2)); // x_used > 0, Smi. R2 = x_used + 1, round up. 696 __ add(R2, R2, Operand(2)); // x_used > 0, Smi. R2 = x_used + 1, round up.
692 __ AsrImmediate(R2, R2, 2); // R2 = num of digit pairs to read. 697 __ AsrImmediate(R2, R2, 2); // R2 = num of digit pairs to read.
693 // R4 = r_digits, R5 = n, n is Smi, n % _DIGIT_BITS != 0. 698 // R4 = r_digits, R5 = n, n is Smi, n % _DIGIT_BITS != 0.
694 __ ldp(R4, R5, Address(SP, 0 * kWordSize, Address::PairOffset)); 699 __ ldp(R4, R5, Address(SP, 0 * kWordSize, Address::PairOffset));
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 __ cmp(R0, Operand(0)); 2212 __ cmp(R0, Operand(0));
2208 __ LoadObject(R0, Bool::False()); 2213 __ LoadObject(R0, Bool::False());
2209 __ LoadObject(TMP, Bool::True()); 2214 __ LoadObject(TMP, Bool::True());
2210 __ csel(R0, TMP, R0, NE); 2215 __ csel(R0, TMP, R0, NE);
2211 __ ret(); 2216 __ ret();
2212 } 2217 }
2213 2218
2214 } // namespace dart 2219 } // namespace dart
2215 2220
2216 #endif // defined TARGET_ARCH_ARM64 2221 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698