Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z

Vol. 2B 4-33
INSTRUCTION SET REFERENCE, N-Z
PADDB/PADDW/PADDD—Add Packed Integers
Description
Performs a SIMD add of the packed integers from the source operand (second
operand) and the destination operand (first operand), and stores the packed integer
results in the destination operand. See Figure 9-4 in the Intel
®
64 and IA-32 Archi-
tectures Software Developer’s Manual, Volume 1, for an illustration of a SIMD opera-
tion. Overflow is handled with wraparound, as described in the following paragraphs.
These instructions can operate on either 64-bit or 128-bit operands. When operating
on 64-bit operands, the destination operand must be an MMX technology register
and the source operand can be either an MMX technology register or a 64-bit
memory location. When operating on 128-bit operands, the destination operand
must be an XMM register and the source operand can be either an XMM register or a
128-bit memory location.
The PADDB instruction adds packed byte integers. When an individual result is too
large to be represented in 8 bits (overflow), the result is wrapped around and the low
8 bits are written to the destination operand (that is, the carry is ignored).
The PADDW instruction adds packed word integers. When an individual result is too
large to be represented in 16 bits (overflow), the result is wrapped around and the
low 16 bits are written to the destination operand.
The PADDD instruction adds packed doubleword integers. When an individual result
is too large to be represented in 32 bits (overflow), the result is wrapped around and
the low 32 bits are written to the destination operand.
Note that the PADDB, PADDW, and PADDD instructions can operate on either
unsigned or signed (two's complement notation) packed integers; however, it does
not set bits in the EFLAGS register to indicate overflow and/or a carry. To prevent
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
0F FC /r PADDB mm,
mm/m64
Valid Valid Add packed byte integers from
mm/m64 and mm.
66 0F FC /r PADDB xmm1,
xmm2/m128
Valid Valid Add packed byte integers from
xmm2/m128 and xmm1.
0F FD /r PADDW mm,
mm/m64
Valid Valid Add packed word integers from
mm/m64 and mm.
66 0F FD
/r
PADDW xmm1,
xmm2/m128
Valid Valid Add packed word integers from
xmm2/m128 and xmm1.
0F FE /r PADDD mm,
mm/m64
Valid Valid Add packed doubleword integers
from mm/m64 and mm.
66 0F FE /r PADDD xmm1,
xmm2/m128
Valid Valid Add packed doubleword integers
from xmm2/m128 and xmm1.