luaur-vm 0.1.1

The Luau register virtual machine and standard library (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::functions::mul_128::mul_128;

#[inline]
pub fn mul_192_hi(xhi: u64, xlo: u64, y: u64, hi: &mut u64) -> u64 {
    let mut z2: u64 = 0;
    let mut z1 = mul_128(xhi, y, &mut z2);

    let mut z1c: u64 = 0;
    let _z0 = mul_128(xlo, y, &mut z1c);

    z1 = z1.wrapping_add(z1c);
    z2 = z2.wrapping_add(if z1 < z1c { 1 } else { 0 });

    *hi = z2;
    z1
}