Intel ARCHITECTURE IA-32 User Manual Page 230

  • Download
  • Add to my manuals
  • Print
  • Page
    / 568
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 229
IA-32 Intel® Architecture Optimization
4-10
The pack instructions always assume that the source operands are
signed numbers. The result in the destination register is always defined
by the pack instruction that performs the operation. For example, the
packssdw instruction packs each of the two signed 32-bit values of the
two sources into four saturated 16-bit signed values in the destination
register. The
packuswb instruction, on the other hand, packs each of the
four signed 16-bit values of the two sources into eight saturated eight-bit
unsigned values in the destination. A complete specification of the
MMX instruction set can be found in the Intel Architecture MMX
Technology Programmers Reference Manual, order number 243007.
Interleaved Pack without Saturation
Example 4-5 is similar to Example 4-4 except that the resulting words
are not saturated. In addition, in order to protect against overflow, only
the low order 16 bits of each doubleword are used in this operation.
Example 4-4 Interleaved Pack with Saturation
; Input:
MM0 signed source1 value
; MM1 signed source2 value
; Output:
MM0 the first and third words contain the
; signed-saturated doublewords from MM0,
; the second and fourth words contain
; signed-saturated doublewords from MM1
;
packssdw MM0, MM0 ; pack and sign saturate
packssdw MM1, MM1 ; pack and sign saturate
punpcklwd MM0, MM1 ; interleave the low-end 16-bit
; values of the operands
Page view 229
1 2 ... 225 226 227 228 229 230 231 232 233 234 235 ... 567 568

Comments to this Manuals

No comments