luaur-code-gen 0.1.1

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