AMD amd64 architecture User Manual

Page of 336
128-Bit Media and Scientific Programming
165
24592—Rev. 3.15—November 2009
AMD64 Technology
4.6.4 Data Reordering
The floating-point data-reordering instructions unpack and interleave, or shuffle the elements of vector
operands.
Unpack and Interleave.
These instructions interleave vector elements from the high or low halves of
two floating-point source operands.
UNPCKHPS—Unpack High Single-Precision Floating-Point
UNPCKHPD—Unpack High Double-Precision Floating-Point
UNPCKLPS—Unpack Low Single-Precision Floating-Point
UNPCKLPD—Unpack Low Double-Precision Floating-Point
The UNPCKHPx instructions copy the high-order two single-precision floating-point values
(UNPCKHPS) or one double-precision floating-point value (UNPCKHPD) in the first and second
operands and interleave them into the 128-bit destination. The low-order 64 bits of the source operands
are ignored.
The UNPCKLPx instructions are analogous to their high-element counterparts except that they take
elements from the low quadword of each source vector and ignore elements in the high quadword.
Depending on the hardware implementation, if the source operand for UNPCKHPx or UNPCKLPx is
in memory, only the low 64 bits of the operand may be loaded.
Figure 4-33 shows the UNPCKLPS 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.
Figure 4-33.
UNPCKLPS Unpack and Interleave Operation
Shuffle.
These instructions reorder the elements of a vector.
SHUFPS—Shuffle Packed Single-Precision Floating-Point
513-159.eps
operand 1
result
127
0
operand 2
127
0
127
0