Changeset 7812a7b5 for libcfa/src/bits
- Timestamp:
- Jun 30, 2020, 1:21:39 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 398e8e9, 9f7fff4
- Parents:
- bdce852
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/random.hfa
rbdce852 r7812a7b5 4 4 5 5 //-------------------------------------------------- 6 typedef __uint128_t __lehmer64_state_t; 7 static inline uint64_t __lehmer64( __lehmer64_state_t & state ) { 8 state *= 0xda942042e4dd58b5; 9 return state >> 64; 10 } 6 #if defined(__SIZEOF_INT128__) 7 typedef __uint128_t __lehmer64_state_t; 8 static inline uint64_t __lehmer64( __lehmer64_state_t & state ) { 9 state *= 0xda942042e4dd58b5; 10 return state >> 64; 11 } 11 12 12 13 //-------------------------------------------------- 13 typedef uint64_t __wyhash64_state_t; 14 static inline uint64_t __wyhash64( __wyhash64_state_t & state ) { 15 state += 0x60bee2bee120fc15; 16 __uint128_t tmp; 17 tmp = (__uint128_t) state * 0xa3b195354a39b70d; 18 uint64_t m1 = (tmp >> 64) ^ tmp; 19 tmp = (__uint128_t)m1 * 0x1b03738712fad5c9; 20 uint64_t m2 = (tmp >> 64) ^ tmp; 21 return m2; 22 } 14 typedef uint64_t __wyhash64_state_t; 15 static inline uint64_t __wyhash64( __wyhash64_state_t & state ) { 16 state += 0x60bee2bee120fc15; 17 __uint128_t tmp; 18 tmp = (__uint128_t) state * 0xa3b195354a39b70d; 19 uint64_t m1 = (tmp >> 64) ^ tmp; 20 tmp = (__uint128_t)m1 * 0x1b03738712fad5c9; 21 uint64_t m2 = (tmp >> 64) ^ tmp; 22 return m2; 23 } 24 #endif 23 25 24 26 //--------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.