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

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

Issue 509153003: New bigint implementation in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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) 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 __ andi(R0, R0, ~kSmiTagMask); // Remove inverted smi-tag. 946 __ andi(R0, R0, ~kSmiTagMask); // Remove inverted smi-tag.
947 __ ret(); 947 __ ret();
948 } 948 }
949 949
950 950
951 void Intrinsifier::Smi_bitLength(Assembler* assembler) { 951 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
952 // TODO(sra): Implement as word-length - CLZ. 952 // TODO(sra): Implement as word-length - CLZ.
953 } 953 }
954 954
955 955
956 void Intrinsifier::Bigint_getNeg(Assembler* assembler) {
957 __ ldr(R0, Address(SP, 0 * kWordSize));
958 __ ldr(R0, FieldAddress(R0, Bigint::neg_offset()));
959 __ ret();
960 }
961
962
963 void Intrinsifier::Bigint_setNeg(Assembler* assembler) {
964 __ ldr(R0, Address(SP, 0 * kWordSize));
965 __ ldr(R1, Address(SP, 1 * kWordSize));
966 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false);
967 __ ret();
968 }
969
970
971 void Intrinsifier::Bigint_getUsed(Assembler* assembler) {
972 __ ldr(R0, Address(SP, 0 * kWordSize));
973 __ ldr(R0, FieldAddress(R0, Bigint::used_offset()));
974 __ ret();
975 }
976
977
978 void Intrinsifier::Bigint_setUsed(Assembler* assembler) {
979 __ ldr(R0, Address(SP, 0 * kWordSize));
980 __ ldr(R1, Address(SP, 1 * kWordSize));
981 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0);
982 __ ret();
983 }
984
985
986 void Intrinsifier::Bigint_getDigits(Assembler* assembler) {
987 __ ldr(R0, Address(SP, 0 * kWordSize));
988 __ ldr(R0, FieldAddress(R0, Bigint::digits_offset()));
989 __ ret();
990 }
991
992
993 void Intrinsifier::Bigint_setDigits(Assembler* assembler) {
994 __ ldr(R0, Address(SP, 0 * kWordSize));
995 __ ldr(R1, Address(SP, 1 * kWordSize));
996 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false);
997 __ ret();
998 }
999
1000
956 // Check if the last argument is a double, jump to label 'is_smi' if smi 1001 // Check if the last argument is a double, jump to label 'is_smi' if smi
957 // (easy to convert to double), otherwise jump to label 'not_double_smi', 1002 // (easy to convert to double), otherwise jump to label 'not_double_smi',
958 // Returns the last argument in R0. 1003 // Returns the last argument in R0.
959 static void TestLastArgumentIsDouble(Assembler* assembler, 1004 static void TestLastArgumentIsDouble(Assembler* assembler,
960 Label* is_smi, 1005 Label* is_smi,
961 Label* not_double_smi) { 1006 Label* not_double_smi) {
962 __ ldr(R0, Address(SP, 0 * kWordSize)); 1007 __ ldr(R0, Address(SP, 0 * kWordSize));
963 __ tsti(R0, kSmiTagMask); 1008 __ tsti(R0, kSmiTagMask);
964 __ b(is_smi, EQ); 1009 __ b(is_smi, EQ);
965 __ CompareClassId(R0, kDoubleCid, kNoPP); 1010 __ CompareClassId(R0, kDoubleCid, kNoPP);
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 Isolate* isolate = Isolate::Current(); 1727 Isolate* isolate = Isolate::Current();
1683 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); 1728 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP);
1684 // Set return value to Isolate::current_tag_. 1729 // Set return value to Isolate::current_tag_.
1685 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 1730 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1686 __ ret(); 1731 __ ret();
1687 } 1732 }
1688 1733
1689 } // namespace dart 1734 } // namespace dart
1690 1735
1691 #endif // defined TARGET_ARCH_ARM64 1736 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698