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: 25th of January 2007

Contents:

 
TRANSFERRING (2 instructions)

 
MOV (MOVe):
 
MOVD [0x0F6E when moving into a MMX register, 0x0F7E when from]
MOVQ [0x0F6F when moving into a MMX register, 0x0F7F when from]
 
src (MOVD): mm, int32, mem32
dst (MOVD): mm, int32, mem32
 
src (MOVQ): mm, mem64
dst (MOVQ): mm, mem64
 
Copy doublewords or quadwords from the source operand to the destination operand.
 
MOVD cannot transfer data from one MMX register to another, from one memory location to another, and from one integer register to another. If the source operand is a MMX register, the low-order doubleword only is transferred. If the destination operand is a MMX register, the 32-bit source operand is written into the low-order doubleword, and remaining the high-order doubleword is populated with zeros.
 
MOVQ cannot transfer data from one memory location to another.

 
STATE MANAGING (1 instruction)

 
EMMS (Exit MultiMedia State) [0x0F77]
 
src: none
dst: none
 
Closes the MMX state.
 
There is the floating-point tag word with 2 bits allocated per every floating-point register. These bits define current status of a register: valid (00), zero (01), invalid or infinity (10), empty (11). There are also the floating-point status word and control word which serve the purpose of exception and condition handling mostly, though the first one accommodates 3 bits pointing to the current stack top. These bits together with the tag word help to minimise time penalties implied by task switching, i. e. to save those only registers which are used actually. However, this technique doesn't work well with the MMX registers which are accessed randomly. So, the first time a MMX instruction accesses a MMX register, the whole tag word is labelled as valid. If any floating-point instruction executes concurrently or subsequently, it finds the stack full. To prevent this, the EMMS instruction resets the tag word to all ones. Of course, there is the FINIT instruction to soft-reset the floating-point unit with all registers of its own, but it's even more expensive in means of performance. It's a sign of good manners to leave EMMS at the end of a MMX-powered function unless there is a really serious reason not to do so.

<< Previous 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