2 #define LIBBENCHMARK_PRNG_MAX ( (lfds710_pal_uint_t) -1 )
4 // TRD : 32-bit SplitMix, derived from Sebastiano vigna's site, CC0 license, http://xorshift.di.unimi.it/splitmix64.c, and email with Dr. Vigna
5 #if( LFDS710_PAL_ALIGN_SINGLE_POINTER == 4 ) // TRD : any 32-bit platform
6 // TRD : struct LIBBENCHMARK_prng_state prng_state, lfds710_pal_uint_t seed
7 #define LIBBENCHMARK_PRNG_INIT( prng_state, seed ) (prng_state).entropy = (seed), (prng_state).entropy = ((prng_state).entropy ^ ((prng_state).entropy >> 16)) * 0x85ebca6bUL, (prng_state).entropy = ((prng_state).entropy ^ ((prng_state).entropy >> 13)) * 0xc2b2ae35UL, (prng_state).entropy = ((prng_state).entropy ^ ((prng_state).entropy >> 16))
9 // TRD : struct libbenchmark_prng_state prng_state, LIBBENCHMARK_pal_atom_t random_value
10 #define LIBBENCHMARK_PRNG_GENERATE( prng_state, random_value ) \
12 (random_value) = ( (prng_state).entropy += 0x9E3779B9UL ); \
13 (random_value) = ((random_value) ^ ((random_value) >> 16)) * 0x85ebca6bUL; \
14 (random_value) = ((random_value) ^ ((random_value) >> 13)) * 0xc2b2ae35UL; \
15 (random_value) = (random_value ^ (random_value >> 16)); \
18 #define LIBBENCHMARK_PRNG_MURMURHASH3_MIXING_FUNCTION( random_value ) \
20 (random_value) ^= ((random_value) >> 16); \
21 (random_value) *= 0x85ebca6b; \
22 (random_value) ^= ((random_value) >> 13); \
23 (random_value) *= 0xc2b2ae35; \
24 (random_value) ^= ((random_value) >> 16); \
28 // TRD : 64-bit SplitMix, from Sebastiano vigna's site, CC0 license, http://xorshift.di.unimi.it/splitmix64.c
29 #if( LFDS710_PAL_ALIGN_SINGLE_POINTER == 8 ) // TRD : any 64-bit platform
30 // TRD : struct LIBBENCHMARK_prng_state prng_state, LIBBENCHMARK_atom_uint_t seed
31 #define LIBBENCHMARK_PRNG_INIT( prng_state, seed ) (prng_state).entropy = (seed), (prng_state).entropy = ((prng_state).entropy ^ ((prng_state).entropy >> 33)) * 0xff51afd7ed558ccdULL, (prng_state).entropy = ((prng_state).entropy ^ ((prng_state).entropy >> 33)) * 0xc4ceb9fe1a85ec53ULL, (prng_state).entropy = ((prng_state).entropy ^ ((prng_state).entropy >> 33))
33 // TRD : struct libbenchmark_prng_state prng_state, lfds710_pal_uint_t random_value
34 #define LIBBENCHMARK_PRNG_GENERATE( prng_state, random_value ) \
36 (random_value) = ( (prng_state).entropy += 0x9E3779B97F4A7C15ULL ); \
37 (random_value) = ((random_value) ^ ((random_value) >> 30)) * 0xBF58476D1CE4E5B9ULL; \
38 (random_value) = ((random_value) ^ ((random_value) >> 27)) * 0x94D049BB133111EBULL; \
39 (random_value) = (random_value ^ (random_value >> 31)); \
42 #define LIBBENCHMARK_PRNG_MURMURHASH3_MIXING_FUNCTION( random_value ) \
44 (random_value) ^= (random_value) >> 33; \
45 (random_value) *= 0xff51afd7ed558ccdULL; \
46 (random_value) ^= (random_value) >> 33; \
47 (random_value) *= 0xc4ceb9fe1a85ec53ULL; \
48 (random_value) ^= (random_value) >> 33; \
55 struct libbenchmark_prng_state
63 /***** public prototypes *****/