Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
Vol. 2B 4-187
INSTRUCTION SET REFERENCE, N-Z
PSUBB/PSUBW/PSUBD—Subtract Packed Integers
Description
Performs a SIMD subtract of the packed integers of the source operand (second
operand) from the packed integers of 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 Architectures Software Developer’s Manual, Volume 1, for an
illustration of a SIMD operation. 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 PSUBB instruction subtracts packed byte integers. When an individual result is
too large or too small to be represented in a byte, the result is wrapped around and
the low 8 bits are written to the destination element.
The PSUBW instruction subtracts packed word integers. When an individual result is
too large or too small to be represented in a word, the result is wrapped around and
the low 16 bits are written to the destination element.
Opcode Instruction
64-Bit
Mode
Compat/
Leg
Mode Description
0F F8 /r PSUBB mm,
mm/m64
Valid Valid Subtract packed byte integers in
mm/m64 from packed byte integers
in mm.
66 0F F8 /r PSUBB xmm1,
xmm2/m128
Valid Valid Subtract packed byte integers in
xmm2/m128 from packed byte
integers in xmm1.
0F F9 /r PSUBW mm,
mm/m64
Valid Valid Subtract packed word integers in
mm/m64 from packed word integers
in mm.
66 0F F9 /r PSUBW xmm1,
xmm2/m128
Valid Valid Subtract packed word integers in
xmm2/m128 from packed word
integers in xmm1.
0F FA /r PSUBD mm,
mm/m64
Valid Valid Subtract packed doubleword integers
in mm/m64 from packed doubleword
integers in mm.
66 0F FA /r PSUBD xmm1,
xmm2/m128
Valid Valid Subtract packed doubleword integers
in xmm2/mem128 from packed
doubleword integers in xmm1.