Developer Guide and Reference


EMMS Usage Guidelines

Here are guidelines for when to use the EMMS instruction:
  • Use
    after an MMX™ instruction if the next instruction is a floating-point (FP) instruction. For example, you should use the EMMS instruction before performing calculations on
    long double
    . You must be aware of all situations in which your code generates an MMX™ instruction:
    • when using an MMX™ technology intrinsic
    • when using Intel® Streaming SIMD Extensions (Intel® SSE) integer intrinsics that use the
      data type
    • when referencing an
      data type variable
    • when using an MMX™ instruction through inline assembly
  • Use different functions for operations that use floating point instructions and those that use MMX™ instructions. This action eliminates the need to empty the multimedia state within the body of a critical loop.
  • Use
    during runtime initialization of
    and FP data types. This ensures resetting the register between data type transitions.
  • Do not use
    before an MMX™ instruction, since using
    before an MMX™ instruction incurs an operation with no benefit (no-op).
  • See the Correct Usage and Incorrect Usage coding examples in the following table.
Incorrect Usage
Correct Usage
__m64 x = _m_paddd(y, z);
float f = init();
__m64 x = _m_paddd(y, z);
float f = ( _mm_empty(), init());