Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
4-30 Vol. 2B
INSTRUCTION SET REFERENCE, N-Z
PACKUSWB—Pack with Unsigned Saturation
Description
Converts 4 or 8 signed word integers from the destination operand (first operand)
and 4 or 8 signed word integers from the source operand (second operand) into 8 or
16 unsigned byte integers and stores the result in the destination operand. (See
Figure 4-1 for an example of the packing operation.) If a signed word integer value is
beyond the range of an unsigned byte integer (that is, greater than FFH or less than
00H), the saturated unsigned byte integer value of FFH or 00H, respectively, is stored
in the destination.
The PACKUSWB instruction operates 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.
In 64-bit mode, using a REX prefix in the form of REX.R permits this instruction to
access additional registers (XMM8-XMM15).
Operation
PACKUSWB instruction with 64-bit operands:
DEST[7:0] ← SaturateSignedWordToUnsignedByte DEST[15:0];
DEST[15:8] ← SaturateSignedWordToUnsignedByte DEST[31:16];
DEST[23:16] ← SaturateSignedWordToUnsignedByte DEST[47:32];
DEST[31:24] ← SaturateSignedWordToUnsignedByte DEST[63:48];
DEST[39:32] ← SaturateSignedWordToUnsignedByte SRC[15:0];
DEST[47:40] ← SaturateSignedWordToUnsignedByte SRC[31:16];
DEST[55:48] ← SaturateSignedWordToUnsignedByte SRC[47:32];
DEST[63:56] ← SaturateSignedWordToUnsignedByte SRC[63:48];
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
0F 67 /r PACKUSWB mm,
mm/m64
Valid Valid Converts 4 signed word integers
from mm and 4 signed word
integers from mm/m64 into 8
unsigned byte integers in mm
using unsigned saturation.
66 0F 67 /r PACKUSWB xmm1,
xmm2/m128
Valid Valid Converts 8 signed word integers
from xmm1 and 8 signed word
integers from xmm2/m128 into
16 unsigned byte integers in
xmm1 using unsigned saturation.