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

Side by Side Diff: src/shared/random.h

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 | « src/shared/platform_windows.cc ('k') | src/shared/random_test.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) 2015, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dartino 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #ifndef SRC_SHARED_RANDOM_H_ 5 #ifndef SRC_SHARED_RANDOM_H_
6 #define SRC_SHARED_RANDOM_H_ 6 #define SRC_SHARED_RANDOM_H_
7 7
8 #include "src/shared/globals.h" 8 #include "src/shared/globals.h"
9 9
10 namespace fletch { 10 namespace dartino {
11 11
12 // This class implements Xorshift+ 12 // This class implements Xorshift+
13 // 13 //
14 // It has the following properties: 14 // It has the following properties:
15 // - it has 128-bit state 15 // - it has 128-bit state
16 // - it is guaranteed to cycle through every possible 128-bit state (except 0). 16 // - it is guaranteed to cycle through every possible 128-bit state (except 0).
17 // - it doesn't systematically fail the BigCrush tests. 17 // - it doesn't systematically fail the BigCrush tests.
18 // - on Intel hardware it is slightly faster than Xorshift* and LCG generators. 18 // - on Intel hardware it is slightly faster than Xorshift* and LCG generators.
19 // - it doesn't need multiply instructions. Note that the Cortex M0/M1 has 19 // - it doesn't need multiply instructions. Note that the Cortex M0/M1 has
20 // only 32x32->32 bit multiply, no 32x32->64 bit mul instruction. 20 // only 32x32->32 bit multiply, no 32x32->64 bit mul instruction.
(...skipping 15 matching lines...) Expand all
36 x ^= y ^ (y >> 26); 36 x ^= y ^ (y >> 26);
37 s1_ = x; 37 s1_ = x;
38 return x + y; 38 return x + y;
39 } 39 }
40 40
41 private: 41 private:
42 uint64 s0_; 42 uint64 s0_;
43 uint64 s1_; 43 uint64 s1_;
44 }; 44 };
45 45
46 } // namespace fletch 46 } // namespace dartino
47 47
48 #endif // SRC_SHARED_RANDOM_H_ 48 #endif // SRC_SHARED_RANDOM_H_
OLDNEW
« no previous file with comments | « src/shared/platform_windows.cc ('k') | src/shared/random_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698