OLD | NEW |
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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 __ xorq(RAX, RCX); | 724 __ xorq(RAX, RCX); |
725 // BSR does not write the destination register if source is zero. Put a 1 in | 725 // BSR does not write the destination register if source is zero. Put a 1 in |
726 // the Smi tag bit to ensure BSR writes to destination register. | 726 // the Smi tag bit to ensure BSR writes to destination register. |
727 __ orq(RAX, Immediate(kSmiTagMask)); | 727 __ orq(RAX, Immediate(kSmiTagMask)); |
728 __ bsrq(RAX, RAX); | 728 __ bsrq(RAX, RAX); |
729 __ SmiTag(RAX); | 729 __ SmiTag(RAX); |
730 __ ret(); | 730 __ ret(); |
731 } | 731 } |
732 | 732 |
733 | 733 |
| 734 void Intrinsifier::Smi_bitAndFromSmi(Assembler* assembler) { |
| 735 Integer_bitAndFromInteger(assembler); |
| 736 } |
| 737 |
| 738 |
734 void Intrinsifier::Bigint_lsh(Assembler* assembler) { | 739 void Intrinsifier::Bigint_lsh(Assembler* assembler) { |
735 // static void _lsh(Uint32List x_digits, int x_used, int n, | 740 // static void _lsh(Uint32List x_digits, int x_used, int n, |
736 // Uint32List r_digits) | 741 // Uint32List r_digits) |
737 | 742 |
738 __ movq(RDI, Address(RSP, 4 * kWordSize)); // x_digits | 743 __ movq(RDI, Address(RSP, 4 * kWordSize)); // x_digits |
739 __ movq(R8, Address(RSP, 3 * kWordSize)); // x_used is Smi | 744 __ movq(R8, Address(RSP, 3 * kWordSize)); // x_used is Smi |
740 __ subq(R8, Immediate(2)); // x_used > 0, Smi. R8 = x_used - 1, round up. | 745 __ subq(R8, Immediate(2)); // x_used > 0, Smi. R8 = x_used - 1, round up. |
741 __ sarq(R8, Immediate(2)); // R8 + 1 = number of digit pairs to read. | 746 __ sarq(R8, Immediate(2)); // R8 + 1 = number of digit pairs to read. |
742 __ movq(RCX, Address(RSP, 2 * kWordSize)); // n is Smi | 747 __ movq(RCX, Address(RSP, 2 * kWordSize)); // n is Smi |
743 __ SmiUntag(RCX); | 748 __ SmiUntag(RCX); |
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 __ LoadIsolate(RAX); | 2122 __ LoadIsolate(RAX); |
2118 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); | 2123 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); |
2119 __ ret(); | 2124 __ ret(); |
2120 } | 2125 } |
2121 | 2126 |
2122 #undef __ | 2127 #undef __ |
2123 | 2128 |
2124 } // namespace dart | 2129 } // namespace dart |
2125 | 2130 |
2126 #endif // defined TARGET_ARCH_X64 | 2131 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |