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

Side by Side Diff: crosstest/vectors.h

Issue 952953002: Subzero: Improve class definition hygiene. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix typo Created 5 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 | « no previous file | src/IceAPInt.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/crosstest/vectors.h - Common SIMD vector utilies -*- C++ -*-===// 1 //===- subzero/crosstest/vectors.h - Common SIMD vector utilies -*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file provides declarations for PNaCl portable SIMD vector types. In 10 // This file provides declarations for PNaCl portable SIMD vector types. In
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 // In some crosstests, test vectors are deterministically constructed by 95 // In some crosstests, test vectors are deterministically constructed by
96 // selecting elements from a pool of scalar values based on a 96 // selecting elements from a pool of scalar values based on a
97 // pseudorandom sequence. Testing all possible combinations of scalar 97 // pseudorandom sequence. Testing all possible combinations of scalar
98 // values from the value pool is often not tractable. 98 // values from the value pool is often not tractable.
99 // 99 //
100 // TODO: Replace with a portable PRNG from C++11. 100 // TODO: Replace with a portable PRNG from C++11.
101 class PRNG { 101 class PRNG {
102 public: 102 public:
103 PRNG(uint32_t Seed = 1) : State(Seed) {} 103 explicit PRNG(uint32_t Seed = 1) : State(Seed) {}
104 104
105 uint32_t operator()() { 105 uint32_t operator()() {
106 // Lewis, Goodman, and Miller (1969) 106 // Lewis, Goodman, and Miller (1969)
107 State = (16807 * State) % 2147483647; 107 State = (16807 * State) % 2147483647;
108 return State; 108 return State;
109 } 109 }
110 110
111 private: 111 private:
112 uint32_t State; 112 uint32_t State;
113 }; 113 };
114 114
115 } // end anonymous namespace 115 } // end anonymous namespace
116 116
117 #endif // VECTORS_H 117 #endif // VECTORS_H
OLDNEW
« no previous file with comments | « no previous file | src/IceAPInt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698