• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/llvmCore-3425.0.34/include/llvm/ADT/

Lines Matching defs:seed

128 /// \brief Override the execution seed with a fixed value.
130 /// This hashing library uses a per-execution seed designed to change on each
137 /// which will forcibly set the seed to a fixed value. This must be done at the
196 inline uint64_t hash_1to3_bytes(const char *s, size_t len, uint64_t seed) {
202 return shift_mix(y * k2 ^ z * k3 ^ seed) * k2;
205 inline uint64_t hash_4to8_bytes(const char *s, size_t len, uint64_t seed) {
207 return hash_16_bytes(len + (a << 3), seed ^ fetch32(s + len - 4));
210 inline uint64_t hash_9to16_bytes(const char *s, size_t len, uint64_t seed) {
213 return hash_16_bytes(seed ^ a, rotate(b + len, len)) ^ b;
216 inline uint64_t hash_17to32_bytes(const char *s, size_t len, uint64_t seed) {
221 return hash_16_bytes(rotate(a - b, 43) + rotate(c ^ seed, 30) + d,
222 a + rotate(b ^ k3, 20) - c + len + seed);
225 inline uint64_t hash_33to64_bytes(const char *s, size_t len, uint64_t seed) {
245 return shift_mix((seed ^ (r * k0)) + vs) * k2;
248 inline uint64_t hash_short(const char *s, size_t length, uint64_t seed) {
250 return hash_4to8_bytes(s, length, seed);
252 return hash_9to16_bytes(s, length, seed);
254 return hash_17to32_bytes(s, length, seed);
256 return hash_33to64_bytes(s, length, seed);
258 return hash_1to3_bytes(s, length, seed);
260 return k2 ^ seed;
268 uint64_t seed;
271 /// seed and the first 64-byte chunk.
273 static hash_state create(const char *s, uint64_t seed) {
275 0, seed, hash_16_bytes(seed, k1), rotate(seed ^ k1, 49),
276 seed * k1, shift_mix(seed), 0, seed };
321 /// \brief A global, fixed seed-override variable.
329 // FIXME: This needs to be a per-execution seed. This is just a placeholder
330 // implementation. Switching to a per-execution seed is likely to flush out
333 // However, if there is a fixed seed override set the first time this is
334 // called, return that instead of the per-execution seed.
336 static size_t seed = fixed_seed_override ? fixed_seed_override
338 return seed;
412 const size_t seed = get_execution_seed();
419 return hash_short(buffer, buffer_ptr - buffer, seed);
422 hash_state state = state.create(buffer, seed);
456 const size_t seed = get_execution_seed();
461 return hash_short(s_begin, length, seed);
464 hash_state state = state.create(s_begin, seed);
506 const size_t seed;
512 /// the seed and buffer setup.
514 : seed(get_execution_seed()) {}
537 state = state.create(buffer, seed);
628 return hash_short(buffer, buffer_ptr - buffer, seed);
724 // Similar to hash_4to8_bytes but using a seed instead of length.
725 const uint64_t seed = get_execution_seed();
728 return hash_16_bytes(seed + (a << 3), fetch32(s + 4));