Skip to main content

patch_seq_ctz

Function patch_seq_ctz 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_ctz(stack: Stack) -> Stack
Expand description

Count trailing zeros, relative to the 63-bit Int width.

Stack effect: ( n – count )

ctz(0) = 63. Any non-zero 63-bit value has at least one set bit at position ≤ 62, so i64::trailing_zeros already produces a value in [0, 62]; only v == 0 needs the special case to avoid returning 64.

§Safety

Stack must have one Int value on top