3-476
INSTRUCTION SET REFERENCE
PADDB/PADDW/PADDDPacked Add (Continued)
The PADDD instruction adds the doublewords of the source operand to the doublewords of the
destination operand and stores the results to the destination operand. When an individual result
is too large to be represented in 32 bits, the lower 32 bits of the result are written to the destina-
tion operand and therefore the result wraps around.
Note that like the integer ADD instruction, the PADDB, PADDW, and PADDD instructions can
operate on either unsigned or signed (twos complement notation) packed integers. Unlike the
integer instructions, none of the MMX instructions affect the EFLAGS register. With
MMX instructions, there are no carry or overflow flags to indicate when overflow has
occurred, so the software must control the range of values or else use the with saturation
MMX instructions.
Operation
IF instruction is PADDB
THEN
DEST(7..0)
<
DEST(7..0) + SRC(7..0);
DEST(15..8)
<
DEST(15..8) + SRC(15..8);
DEST(23..16)
<
DEST(23..16)+ SRC(23..16);
DEST(31..24)
<
DEST(31..24) + SRC(31..24);
DEST(39..32)
<
DEST(39..32) + SRC(39..32);
DEST(47..40)
<
DEST(47..40)+ SRC(47..40);
DEST(55..48)
<
DEST(55..48) + SRC(55..48);
DEST(63..56)
<
DEST(63..56) + SRC(63..56);
ELSEIF instruction is PADDW
THEN
DEST(15..0)
<
DEST(15..0) + SRC(15..0);
DEST(31..16)
<
DEST(31..16) + SRC(31..16);
DEST(47..32)
<
DEST(47..32) + SRC(47..32);
DEST(63..48)
<
DEST(63..48) + SRC(63..48);
ELSE (* instruction is PADDD *)
DEST(31..0)
<
DEST(31..0) + SRC(31..0);
DEST(63..32)
<
DEST(63..32) + SRC(63..32);
FI;