Encoding:

POOL32S

010110

rt

rs

DCLO

0100101100

POOL32SXf

111100

6

5

5

10

6

Format:

DCLO rd, rs

microMIPS64

Count Leading Ones in Doubleword

Purpose:

Count Leading Ones in Doubleword

To count the number of leading ones in a doubleword

Description:

 GPR[rd] = count_leading_ones GPR[rs]

The 64-bit word in GPR rs is scanned from most-significant to least-significant bit. The number of leading ones is counted and the result is written to GPR rd. If all 64 bits were set in GPR rs, the result written to GPR rd is 64.

Restrictions:

To be compliant with the MIPS32 and MIPS64 Architecture, software must place the same GPR number in both the

rt and rd fields of the instruction. The operation of the instruction is UNPREDICTABLE if the rt and rd fields of the

instruction contain different values Release 6's new instruction encoding does not contain an field; Release 6 implementations are required to signal a Reserved Instruction exception if the field is nonzero.

Operation:

temp = 64
for i in 63.. 0
   if GPR[rs]i = 0 then
      temp = 63 - i
      break
   endif
endfor
GPR[rd] = temp

Exceptions:

None