clz

Operands

reg, reg

Count leading zeros : Set t1 to the number of 0 bits above the most significant 1 bit of t2, which is the full register width when t2 is zero

Variants

  • Count leading zeros : Set t1 to the number of 0 bits above the most significant 1 bit of t2, which is the full register width when t2 is zero clz t1,t2
.text
li t0, 13
# t0=13; clz writes 28 to t2.
clz t2, t0