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

4-198 Vol. 2B
INSTRUCTION SET REFERENCE, N-Z
PSUBUSB/PSUBUSW—Subtract Packed Unsigned Integers with
Unsigned Saturation
Description
Performs a SIMD subtract of the packed unsigned integers of the source operand
(second operand) from the packed unsigned integers of the destination operand (first
operand), and stores the packed unsigned integer results in the destination operand.
See Figure 9-4 in the Intel
®
64 and IA-32 Architectures Software Developer’s
Manual, Volume 1, for an illustration of a SIMD operation. Overflow is handled with
unsigned 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 PSUBUSB instruction subtracts packed unsigned byte integers. When an indi-
vidual byte result is less than zero, the saturated value of 00H is written to the desti-
nation operand.
The PSUBUSW instruction subtracts packed unsigned word integers. When an indi-
vidual word result is less than zero, the saturated value of 0000H 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 D8 /r PSUBUSB mm,
mm/m64
Valid Valid Subtract unsigned packed bytes in
mm/m64 from unsigned packed
bytes in mm and saturate result.
66 0F D8 /r PSUBUSB xmm1,
xmm2/m128
Valid Valid Subtract packed unsigned byte
integers in xmm2/m128 from
packed unsigned byte integers in
xmm1 and saturate result.
0F D9 /r PSUBUSW mm,
mm/m64
Valid Valid Subtract unsigned packed words in
mm/m64 from unsigned packed
words in mm and saturate result.
66 0F D9 /r PSUBUSW xmm1,
xmm2/m128
Valid Valid Subtract packed unsigned word
integers in xmm2/m128 from
packed unsigned word integers in
xmm1 and saturate result.