Operations:

Format

Syntax:

Operation:

Operands:

Architecture revision

Opcode

1

clz Rd, Rs

temp = 32;
for (i = 31; i >= 0; i--)
      if (Rs[i] == 1) then
            temp  =  31 - i;
            break;
Rd = temp;
{d, s} ∈ {0, 1, …, 15}

Rev1+

111

Rs

00000

Rd

0001001000000000

3

4

5

4

16

Description

Counts the number of binary zero bits before the first binary one bit in a register value. The value returned from the operation can be used for doing normalize operations. If the operand is zero, the value 32 is returned.

Status Flags

Q:

Not affected

V:

Not affected

N:

Not affected

Z:

Z = (RES[31:0] == 0)

C:

C = (RES[31:0] == 32)