
cntlzw
Count Leading Zeros Word
PPC440x5 CPU Core User’s Manual Preliminary
Page 286 of 589 instrset.fm.
September 12, 2002
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] if Rc contains 1
Invalid Instruction Forms
• Reserved fields
cntlzw RA, RS Rc=0
cntlzw. RA, RS Rc=1
31 RS RA 26 Rc
0 6 11 16 21 31