User Guide

64-Bit Media Programming 195
24592—Rev. 3.15—November 2009 AMD64 Technology
Figure 5-1. Parallel Integer Operations on Elements of Vectors
5.3.2 Data Conversion and Reordering
The 64-bit media instructions support conversions of various integer data types to floating-point data
types, and vice versa.
There are also instructions that reorder vector-element ordering or the bit-width of vector elements.
For example, the unpack instructions take two vector operands and interleave their low or high
elements. Figure 5 -2 on page 196 shows an unpack operation (PUNPCKLWD) that interleaves low-
order elements of each source operand. If each element of operand 2 has the value zero, the operation
zero-extends each element of operand 1 to twice its original width. This may be useful, for example,
prior to an arithmetic operation in which the data-conversion result must be paired with another source
operand containing vector elements that are twice the width of the pre-conversion (half-size) elements.
There are also pack instructions that convert each element of 2x size in a pair of vectors to elements of
1x size, with saturation at maximum and minimum values.
513-121.eps
operand 1
result
63 0
63 0
operand 2
63 0
op op op op