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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |