Alasir Enterprises
Main Page >  Reference >  A Concise Guide to the MMX Technology  

 
Main Page
 
 
Reviews
 
Articles
 
Software
 
Reference
 
Motley
 
 
About Us
 
 
A Concise Guide to the MMX Technology

Paul V. Bolotoff
 
Release date: 31st of January 2005
Last modify date: 24th of January 2007

Contents:

 
CONVERTING (9 instructions)

 
PACKSS (PACKed with Signed Saturation):
 
PACKSSWB [0x0F63]
PACKSSDW [0x0F6B]
 
src: mm, mem64
dst: mm
 
Pack and saturate signed data elements of the source and destination operands, and write the signed result to the destination operand.
 
PACKSSWB packs 4 signed words of the source operand and 4 signed words of the destination operand into 8 signed bytes of the destination operand. If a value of any signed word is larger or smaller than the data range of signed byte, the value is saturated (in case of overflow to 0x7F, in case of underflow to 0x80).
 
63 0  
 
word3 word2 word1 word0
  src
 
word7 word6 word5 word4
  dst
 
 
byte7
(word3)
byte6
(word2)
byte5
(word1)
byte4
(word0)
byte3
(word7)
byte2
(word6)
byte1
(word5)
byte0
(word4)
  dst (new)

PACKSSDW packs 2 signed doublewords of the source operand and 2 signed doublewords of the destination operand into 4 signed words of the destination operand. If a value of any signed doubleword is larger or smaller than the data range of signed word, the value is saturated (in case of overflow to 0x7FFF, in case of underflow to 0x8000).
 
63 0  
 
dword1 dword0
  src
 
dword3 dword2
  dst
 
 
word3
(dword1)
word2
(dword0)
word1
(dword3)
word0
(dword2)
  dst (new)

 
PACKUS (PACKed with Unsigned Saturation):
 
PACKUSWB [0x0F67]
 
src: mm, mem64
dst: mm
 
Pack and saturate signed data elements of the source and destination operands, and write the unsigned result to the destination operand.
 
PACKUSWB packs 4 signed words of the source operand and 4 signed words of the destination operand into 8 unsigned bytes of the destination operand. If a value of any signed word is larger or smaller than the data range of unsigned byte, the value is saturated (in case of overflow to 0xFF, in case of underflow to 0x00).
 
63 0  
 
word3 word2 word1 word0
  src
 
word7 word6 word5 word4
  dst
 
 
byte7
(word3)
byte6
(word2)
byte5
(word1)
byte4
(word0)
byte3
(word7)
byte2
(word6)
byte1
(word5)
byte0
(word4)
  dst (new)

 
PUNPCKL (Packed UNPaCK Low):
 
PUNPCKLBW [0x0F60]
PUNPCKLWD [0x0F61]
PUNPCKLDQ [0x0F62]
 
src: mm, mem64
dst: mm
 
Unpack and interleave low-order data elements of the source and destination operands, and write the result to the destination operand. If the source operand consists of all zeros, the result is zero extension of low-order elements of the destination operand. Packed byte (PUNPCKLBW), packed word (PUNPCKLWD), and packed doubleword (PUNPCKLDQ) data types are recognised.
 
for PUNPCKLBW:
63 0  
 
        byte3 byte2 byte1 byte0
  src
 
        byte7 byte6 byte5 byte4
  dst
 
 
byte3 byte7 byte2 byte6 byte1 byte5 byte0 byte4
  dst (new)

 
for PUNPCKLWD:
63 0  
 
    word1 word0
  src
 
    word3 word2
  dst
 
 
word1 word3 word0 word2
  dst (new)

 
for PUNPCKLDQ:
63 0  
 
  dword0
  src
 
  dword1
  dst
 
 
dword0 dword1
  dst (new)

 
PUNPCKH (Packed UNPaCK High):
 
PUNPCKHBW [0x0F68]
PUNPCKHWD [0x0F69]
PUNPCKHDQ [0x0F6A]
 
src: mm, mem64
dst: mm
 
Unpack and interleave high-order data elements of the source and destination operands into the destination operand, and write the result to the destination operand. If the source operand consists of all zeros, the result is zero extension of high-order elements of the destination operand. Packed byte (PUNPCKHBW), packed word (PUNPCKHWD), and packed doubleword (PUNPCKHDQ) data types are recognised.
 
for PUNPCKHBW:
63 0  
 
byte3 byte2 byte1 byte0        
  src
 
byte7 byte6 byte5 byte4        
  dst
 
 
byte3 byte7 byte2 byte6 byte1 byte5 byte0 byte4
  dst (new)

 
for PUNPCKHWD:
63 0  
 
word1 word0    
  src
 
word3 word2    
  dst
 
 
word1 word3 word0 word2
  dst (new)

 
for PUNPCKHDQ:
63 0  
 
dword0  
  src
 
dword1  
  dst
 
 
dword0 dword1
  dst (new)

<< Previous page
 

Next page >>
 

Copyright (c) Paul V. Bolotoff, 2005-07. All rights reserved.
A full or partial reprint without a permission received from the author is prohibited.
 
Designed and maintained by Alasir Enterprises, 1999-2007
rhett from alasir.com, walter from alasir.com