User Guide
64-Bit Media Programming 213
24592—Rev. 3.15—November 2009 AMD64 Technology
Figure 5-12. PACKSSDW Pack Operation
Conversion from higher-to-lower precision may be needed, for example, after an arithmetic operation
which requires the higher-precision format to prevent possible overflow, but which requires the lower-
precision format for a subsequent operation.
Unpack and Interleave. These instructions interleave vector elements from the high or low half of
two source operands. They can be used to double the precision of operands.
• PUNPCKHBW—Unpack and Interleave High Bytes
• PUNPCKHWD—Unpack and Interleave High Words
• PUNPCKHDQ—Unpack and Interleave High Doublewords
• PUNPCKLBW—Unpack and Interleave Low Bytes
• PUNPCKLWD—Unpack and Interleave Low Words
• PUNPCKLDQ—Unpack and Interleave Low Doublewords
The PUNPCKHBW instruction unpacks the four high-order bytes from its two source operands and
interleaves them into the bytes in the destination operand. The bytes in the low-order half of the source
operand are ignored. The PUNPCKHWD and PUNPCKHDQ instructions perform analogous
operations for words and doublewords in the source operands, packing them into interleaved words
and interleaved doublewords in the destination operand.
The PUNPCKLBW, PUNPCKLWD, and PUNPCKLDQ instructions are analogous to their high-
element counterparts except that they take elements from the low doubleword of each source vector
and ignore elements in the high doubleword. If the source operand for PUNPCKLx instructions is in
memory, only the low 32 bits of the operand are loaded.
Figure 5-13 on page 214 shows an example of the PUNPCKLWD instruction. The elements are taken
from the low half of the source operands. In this register image, elements from operand2 are placed to
the left of elements from operand1.
513-143.eps
operand 1
result
63 0
63 0
operand 2
63 0