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

4-40 Vol. 2B
INSTRUCTION SET REFERENCE, N-Z
PADDSB/PADDSW—Add Packed Signed Integers with Signed
Saturation
Description
Performs a SIMD add of the packed signed 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 signed saturation, 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 PADDSB instruction adds packed signed byte integers. When an individual byte
result is beyond the range of a signed byte integer (that is, greater than 7FH or less
than 80H), the saturated value of 7FH or 80H, respectively, is written to the destina-
tion operand.
The PADDSW instruction adds packed signed word integers. When an individual word
result is beyond the range of a signed word integer (that is, greater than 7FFFH or
less than 8000H), the saturated value of 7FFFH or 8000H, respectively, is written to
the destination operand.
In 64-bit mode, using a REX prefix in the form of REX.R permits this instruction to
access additional registers (XMM8-XMM15).
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
0F EC /r PADDSB mm,
mm/m64
Valid Valid Add packed signed byte
integers from mm/m64 and
mm and saturate the results.
66 0F EC /r PADDSB xmm1,
xmm2/m128
Valid Valid Add packed signed byte
integers from xmm2/m128
and xmm1 saturate the results.
0F ED /r PADDSW mm,
mm/m64
Valid Valid Add packed signed word
integers from mm/m64 and
mm and saturate the results.
66 0F ED /r PADDSW xmm1,
xmm2/m128
Valid Valid Add packed signed word
integers from xmm2/m128
and xmm1 and saturate the
results.