User Guide

128-Bit Media and Scientific Programming 147
24592—Rev. 3.15—November 2009 AMD64 Technology
The PADDUSB and PADDUSW instructions perform saturating-add operations analogous to the
PADDSB and PADDSW instructions, except on unsigned integer elements.
Subtraction.
PSUBB—Packed Subtract Bytes
PSUBW—Packed Subtract Words
PSUBD—Packed Subtract Doublewords
PSUBQ—Packed Subtract Quadword
PSUBSB—Packed Subtract with Saturation Bytes
PSUBSW—Packed Subtract with Saturation Words
PSUBUSB—Packed Subtract Unsigned and Saturate Bytes
PSUBUSW—Packed Subtract Unsigned and Saturate Words
The subtraction instructions perform operations analogous to the addition instructions.
The PSUBB, PSUBW, PSUBD, and PSUBQ instructions subtract each 8-bit (PSUBB), 16-bit
(PSUBW), 32-bit (PSUBD), or 64-bit (PSUBQ) integer element in the second operand from the
corresponding, same-sized integer element in the first operand and write the integer result to the
corresponding, same-sized element of the destination. For vectors of n number of elements, the
operation is:
operand1[i] = operand1[i] - operand2[i]
where: i = 0 to n 1
These instructions operate on both signed and unsigned integers. However, if the result underflows, the
borrow is ignored and only the low-order byte, word, doubleword, or quadword of each result is
written to the destination.
The PSUBSB and PSUBSW instructions subtract each 8-bit (PSUBSB) or 16-bit (PSUBSW) signed
integer element in the second operand from the corresponding, same-sized signed integer element in
the first operand and write the signed integer result to the corresponding, same-sized element of the
destination. For each result in the destination, if the result is larger than the largest, or smaller than the
smallest, representable 8-bit (PSUBSB) or 16-bit (PSUBSW) signed integer, the result is saturated to
the largest or smallest representable value, respectively.
The PSUBUSB and PSUBUSW instructions perform saturating-add operations analogous to the
PSUBSB and PSUBSW instructions, except on unsigned integer elements.
Multiplication.
PMULHW—Packed Multiply High Signed Word
PMULLW—Packed Multiply Low Signed Word
PMULHUW—Packed Multiply High Unsigned Word
PMULUDQ—Packed Multiply Unsigned Doubleword and Store Quadword