luaur_code_gen/functions/jit_rng_random.rs
1#[inline]
2pub fn jit_rng_random(state: &mut u64) -> u32 {
3 let oldstate = *state;
4 *state = oldstate
5 .wrapping_mul(6364136223846793005)
6 .wrapping_add((105 | 1) as u64);
7 let xorshifted = (((oldstate >> 18) ^ oldstate) >> 27) as u32;
8 let rot = (oldstate >> 59) as u32;
9 let rot_neg = (-(rot as i32)) & 31;
10 (xorshifted >> rot) | (xorshifted << (rot_neg as u32))
11}