A SERVICE OF

logo

dlmzb
Determine Leftmost Zero Byte
Preliminary PPC440x5 CPU Core User’s Manual
instrset.fm.
September 12, 2002 Page 309 of 589
dlmzb
determine left most zero byte
d (RS) || (RB)
i, x, y
0
do while (x < 8)
(y = 0)
x
x + 1
if d
i:i + 7
= 0 then
y
1
else
i
i + 8
(RA)
x
XER[TBC]
x
if Rc = 1 then
CR[CR0]
3
XER[SO]
if y = 1 then
if x < 5 then
CR[CR0]
0:2
0b010
else
CR[CR0]
0:2
0b100
else
CR[CR0]
0:2
0b001
The contents of registers RS and RB are concatenated to form an 8-byte operand. The operand is searched
for the leftmost byte in which each bit is 0 (a 0-byte).
Bytes in the operand are numbered from left to right starting with 1. If a 0-byte is found, its byte number is
placed into XER[TBC] and register RA. Otherwise, the number 8 is placed into XER[TBC] and register RA.
If the Rc field contains 1, XER[SO] is copied to CR[CR0]
3
and CR[CR0]
0:2
are updated as follows:
If no 0-byte is found, CR[CR0]
0:2
is set to 0b001.
If the leftmost 0-byte is in the first 4 bytes (in the RS register), CR[CR0]
0:2
is set to 0b010.
If the leftmost 0-byte is in the last 4 bytes (in the RB register), CR[CR0]
0:2
is set to 0b100.
Registers Altered
XER[TBC]
•RA
CR[CR0] if Rc contains 1
Architecture Note
This instruction is implementation-specific and programs which use this instruction may not be portable to
other PowerPC Book-E implementations. See Instruction Set Portability on page 250.
dlmzb RA, RS, RB Rc=0
dlmzb. RA, RS, RB Rc=1
31 RS RA RB 78 Rc
0 6 11 16 21 31