Assembly:

CLZ rt, rs

nanoMIPS, not available in NMS

Count Leading Zeros

Purpose:

Count Leading Zeros. Count leading zeros in 32-bit register value $rs, placing the result inregister $rt.

Availability:

nanoMIPS, not available in NMS

Format:

001000

rt

rs

0101101

100

111

111

6

5

5

7

3

3

3

Operation:

if C0.Config5.NMS == 1:
    raise exception('RI')
input = GPR[rs]
i = 0
while i < 32:
    if input[31 - i] != 0: break
    i += 1
GPR[rt] = i

Exceptions:

Reserved Instruction on NMS cores.