User Guide
128-Bit Media and Scientific Programming 109
24592—Rev. 3.15—November 2009 AMD64 Technology
Figure 4-4. Pack Operation
Figure 4-5 shows one of many types of shuffle operation (PSHUFD). Here, the second operand is a
vector containing doubleword elements, and an immediate byte provides shuffle control for up to 256
permutations of the elements. Shuffles are useful, for example, in color imaging when computing
alpha saturation of RGB values. In this case, a shuffle instruction can replicate an alpha value in a
register so that parallel comparisons with three RGB values can be performed.
Figure 4-5. Shuffle Operation
There is an instruction that inserts a single word from a general-purpose register or memory into an
XMM register, at a specified location, leaving the other words in the XMM register unmodified.
513-150.eps
operand 1
result
127 0
127 0
operand 2
127 0
513-151.eps
result
operand 1
127 0
127 0
operand 2
127 0