ctzw

Counts the number of 0's before the first 1, starting at the least-significant bit (i.e., 0) and progressing to the most-significant bit of the least-significant word (i.e., 31). Accordingly, if the least-significant word is 0, the output is 32, and if the least-significant bit of the input is a 1, the output is 0.

Synopsis

ctzw xd, xs1

Encoding

Type:

067111214151920310011011xd001xs1011000000001
funct7: 0110000
funct3: 001
opcode: 0011011

RISC-V Instruction Encoder/Decoder

open ctzw in rvcodecjs

Availability