clzw

Operands

reg, reg

Count leading zeros (32 bit) : Set t1 to the number of 0 bits above the most significant 1 bit of the low 32 bits of t2, which is 32 when they are zero (64bit)

Variants

  • Count leading zeros (32 bit) : Set t1 to the number of 0 bits above the most significant 1 bit of the low 32 bits of t2, which is 32 when they are zero (64bit) clzw t1,t2

This example runs on RV64.

.text
li t0, 13
# t0=13; clzw writes 28 to t2.
clzw t2, t0