9-38 PPC405 Core User’s Manual
cntlzw
Count Leading Zeros Word
cntlzw
Count Leading Zeros Word
n ← 0
do while n < 32
if (RS)
n
= 1 then leave
n
← n+1
(RA)
← n
The consecutive leading 0 bits in register RS are counted; the count is placed into register RA.
The count ranges from 0 through 32, inclusive.
Registers Altered
•RA
• CR[CR0]
LT, GT, EQ, SO
if Rc contains 1
Invalid Instruction Forms
• Reserved fields
Architecture Note
This instruction is part of the PowerPC User Instruction Set Architecture.
cntlzw RA, RS Rc=0
cntlzw. RA, RS Rc=1
31 RS RA 26 Rc
0 6 11 16 21 31