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

Side by Side Diff: runtime/vm/bigint_operations.h

Issue 23645003: Esoteric bit operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 2012 Google Inc. All Rights Reserved. 1 // Copyright 2012 Google Inc. All Rights Reserved.
2 2
3 #ifndef VM_BIGINT_OPERATIONS_H_ 3 #ifndef VM_BIGINT_OPERATIONS_H_
4 #define VM_BIGINT_OPERATIONS_H_ 4 #define VM_BIGINT_OPERATIONS_H_
5 5
6 #include "platform/utils.h" 6 #include "platform/utils.h"
7 7
8 #include "vm/object.h" 8 #include "vm/object.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 static RawBigint* Divide(const Bigint& a, const Bigint& b); 85 static RawBigint* Divide(const Bigint& a, const Bigint& b);
86 static RawBigint* Modulo(const Bigint& a, const Bigint& b); 86 static RawBigint* Modulo(const Bigint& a, const Bigint& b);
87 static RawBigint* Remainder(const Bigint& a, const Bigint& b); 87 static RawBigint* Remainder(const Bigint& a, const Bigint& b);
88 88
89 static RawBigint* ShiftLeft(const Bigint& bigint, intptr_t amount); 89 static RawBigint* ShiftLeft(const Bigint& bigint, intptr_t amount);
90 static RawBigint* ShiftRight(const Bigint& bigint, intptr_t amount); 90 static RawBigint* ShiftRight(const Bigint& bigint, intptr_t amount);
91 static RawBigint* BitAnd(const Bigint& a, const Bigint& b); 91 static RawBigint* BitAnd(const Bigint& a, const Bigint& b);
92 static RawBigint* BitOr(const Bigint& a, const Bigint& b); 92 static RawBigint* BitOr(const Bigint& a, const Bigint& b);
93 static RawBigint* BitXor(const Bigint& a, const Bigint& b); 93 static RawBigint* BitXor(const Bigint& a, const Bigint& b);
94 static RawBigint* BitNot(const Bigint& bigint); 94 static RawBigint* BitNot(const Bigint& bigint);
95 static int64_t BitLength(const Bigint& bigint);
95 96
96 static int Compare(const Bigint& a, const Bigint& b); 97 static int Compare(const Bigint& a, const Bigint& b);
97 98
98 static bool IsClamped(const Bigint& bigint) { 99 static bool IsClamped(const Bigint& bigint) {
99 intptr_t length = bigint.Length(); 100 intptr_t length = bigint.Length();
100 return (length == 0) || (bigint.GetChunkAt(length - 1) != 0); 101 return (length == 0) || (bigint.GetChunkAt(length - 1) != 0);
101 } 102 }
102 103
103 private: 104 private:
104 typedef Bigint::Chunk Chunk; 105 typedef Bigint::Chunk Chunk;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 static RawBigint* Copy(const Bigint& bigint); 147 static RawBigint* Copy(const Bigint& bigint);
147 148
148 static int CountBits(Chunk digit); 149 static int CountBits(Chunk digit);
149 150
150 DISALLOW_IMPLICIT_CONSTRUCTORS(BigintOperations); 151 DISALLOW_IMPLICIT_CONSTRUCTORS(BigintOperations);
151 }; 152 };
152 153
153 } // namespace dart 154 } // namespace dart
154 155
155 #endif // VM_BIGINT_OPERATIONS_H_ 156 #endif // VM_BIGINT_OPERATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698