i32.clz
Pops an i32 value off the stack, counts the number of leading zero bits on the left, and then pushes the result back on to the stack. This is the number of 0 bits at the higher end of the binary number (0b00000110 has 5 leading zeros, plus the other zero bits for the remaining 3 bytes that make up the 32 bit integer).

Syntax

i32.clz

Stack In

i32 The value to workout the leading 0 bits for.

Stack Out

i32 The number of leading 0 bits the value has.

Example

;; Push the i32 value 0x0F12AB44 onto the stack
i32.const 0x0F12AB44

;; Pop the i32 value off the stack, count the number of leading zeros
;; and push the result back onto the stack
i32.clz

;; The stack contains an i32 value of 4