AMD amd64 architecture User Manual

Page of 336
128-Bit Media and Scientific Programming
145
24592—Rev. 3.15—November 2009
AMD64 Technology
Figure 4-23.
PSHUFD Shuffle Operation
The PSHUFHW and PSHUFLW instructions are analogous to PSHUFD, except that they fill each
word of the high or low quadword, respectively, of the first operand by copying any one of the four
words in the high or low quadword of the second operand. Figure 4-24 shows the PSHUFHW
operation. PSHUFHW and PSHUFLW are useful, for example, in color imaging when computing
alpha saturation of RGB values. In this case, PSHUFxW can replicate an alpha value in a register so
that parallel comparisons with three RGB values can be performed.
Figure 4-24.
PSHUFHW Shuffle Operation
4.5.5 Arithmetic
The integer vector-arithmetic instructions perform an arithmetic operation on the elements of two
source vectors. Figure 4-25 on page 146 shows a typical arithmetic operation on vectors of bytes. Such
instructions performs 16 arithmetic operations in parallel.
513-151.eps
result
operand 1
127
0
127
0
operand 2
127
0
513-167.eps
result
operand 1
127
0
127
0
operand 2
127
0