Example 4-5
Interleaved Pack without Saturation
; Input:
;
;
; Output:
;
;
;
;
pslld
pand
por
Non-Interleaved Unpack
The unpack instructions perform an interleave merge of the data
elements of the destination and source operands into the destination
register. The following example merges the two operands into the
destination registers without interleaving. For example, take two
adjacent elements of a packed-word data type in
value in the low 32 bits of the results. Then take two adjacent elements
of a packed-word data type in
32 bits of the results. One of the destination registers will have the
combination illustrated in Figure 4-3.
MM0
signed source value
MM1
signed source value
MM0
the first and third words contain the
low 16-bits of the doublewords in MM0,
the second and fourth words contain the
low 16-bits of the doublewords in MM1
MM1, 16
; shift the 16 LSB from each of the
; doubleword values to the 16 MSB
; position
MM0, {0,ffff,0,ffff}
; mask to zero the 16 MSB
; of each doubleword value
MM0, MM1
; merge the two operands
Optimizing for SIMD Integer Applications
source1
and place this value in the high
source2
4
and place this
4-11
Need help?
Do you have a question about the ARCHITECTURE IA-32 and is the answer not in the manual?