Skip to main content

patch_seq_popcount

Function patch_seq_popcount 

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

Population count (count number of 1 bits in the 63-bit Int).

Stack effect: ( n – count )

Counts bits in the 63-bit two’s-complement representation of n. Negatives have bit 63 set in the underlying i64 purely as sign extension, so we mask it off before counting. popcount(-1) = 63.

§Safety

Stack must have one Int value on top