Assembly:

CLO rt, rs

nanoMIPS, not available in NMS

Count Leading Ones

Purpose:

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

Availability:

nanoMIPS, not available in NMS

Format:

001000

rt

rs

0100101

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] != 1: break
    i += 1
GPR[rt] = i

Exceptions:

Reserved Instruction on NMS cores.