3-567
INSTRUCTION SET REFERENCE
PSUBSB/PSUBSWPacked Subtract with Saturation
Description
These instructions subtract the individual signed data elements (bytes or words) of the source
operand (second operand) from the individual signed data elements of the destination operand
(first operand) (refer to Figure 3-81). If the result of a subtraction exceeds the range for the spec-
ified data type, the result is saturated. The destination operand must be an MMX technology
register; the source operand can be either an MMX technology register or a quadword
memory location.
The PSUBSB instruction subtracts the signed bytes of the source operand from the signed bytes
of the destination operand and stores the results to the destination operand. When an individual
result is beyond the range of a signed byte (that is, greater than 7FH or less than 80H), the satu-
rated byte value of 7FH or 80H, respectively, is written to the destination operand.
The PSUBSW instruction subtracts the signed words of the source operand from the signed
words of the destination operand and stores the results to the destination operand. When an indi-
vidual result is beyond the range of a signed word (that is, greater than 7FFFH or less than
8000H), the saturated word value of 7FFFH or 8000H, respectively, is written to the destination
operand.
Opcode
Instruction
Description
0F E8 /r
PSUBSB mm,
mm/m64
Subtract signed packed bytes in mm/m64 from
signed packed bytes in mm and saturate.
0F E9 /r
PSUBSW mm,
mm/m64
Subtract signed packed words in mm/m64 from
signed packed words in mm and saturate.
Figure 3-81. Operation of the PSUBSW Instruction
PSUBSW mm, mm/m64
mm
mm/m64
mm
1000000000000000
0000000000000001
1000000000000000
0111111100111000
1110100011111001
0111111111111111
3006029