Intel ARCHITECTURE IA-32 User Manual Page 249

  • Download
  • Add to my manuals
  • Print
  • Page
    / 568
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 248
Optimizing for SIMD Integer Applications 4
4-29
packed-subtract instructions with unsigned saturation, thus this
technique can only be used on packed-bytes and packed-words data
types.
The example illustrates the operation on word values.
Packed Max/Min of Signed Word and Unsigned Byte
Signed Word
The pmaxsw instruction returns the maximum between the four signed
words in either two SIMD registers, or one SIMD register and a
memory location.
The
pminsw instruction returns the minimum between the four signed
words in either two SIMD registers, or one SIMD register and a
memory location.
Example 4-22 Clipping to an Arbitrary Unsigned Range [high, low]
; Input:
; MM0 unsigned source operands
; Output:
; MM1 unsigned operands clipped to the unsigned
; range [HIGH, LOW]
paddusw MM0, 0xffff - high
; in effect this clips to high
psubusw MM0, (0xffff - high + low)
; in effect this clips to low
paddw MM0, low
; undo the previous two offsets
Page view 248
1 2 ... 244 245 246 247 248 249 250 251 252 253 254 ... 567 568

Comments to this Manuals

No comments