clo

Count leading ones

Sets $t1 to the number of consecutive 1 bits in $t2, counted from the most-significant bit downward.

Forms

  • clo ,

Operands

$t1
Any general-purpose register, $0 to $31, using its numeric or named spelling, such as $8 or $t0 ($zero is $0; $ra is $31).
$t2
A general-purpose register. It may be the same register as $t1.

For example, if $t2 = 0b11100000..., then $t1 = 3. Returns 32 if all bits are 1.

# Apply clo to initialized pattern 0x00F0FF00. Inspect $t2: 0.
li $t0, 0x00F0FF00
clo $t2, $t0