Intel MMX Technology Support in Visual C++

ID: Q154853


The information in this article applies to:
  • The C/C++ Compiler (CL.EXE), included with:
    • Microsoft Visual C++, 32-bit Editions, versions 4.1, 4.2, 5.0, 6.0


SUMMARY

Beginning with Microsoft Visual C++ version 4.1 for Intel, support of Intel's MMX Technology is available in the Microsoft C/C++ compiler Cl.exe. This capability is enabled with the /GM compiler switch and is only available within inline assembly.

NOTE: The /GM switch is not necessary in Visual C++ versions 5.0 and 6.0.


MORE INFORMATION

Microsoft provides MMX Technology compiler support but does not provide programming support. For this information, view Intel Corporation's Web page at:

http://www.intel.com/pc-supp/multimed/mmx
Here can be found very clear and thorough documentation, frequently-asked- questions (FAQs), information on programming, and so on, on MMX Technology.

Included here is a trivial sample using the PAND instruction with the two MMX registers MM0 and MM1. This sample just illustrates MMX Technology support. For information on MMX programming, refer to Intel documentation.

Note that running a program that uses MMX instructions on a standard Pentium (P5) processor will generate an invalid instruction exception. This is the expected behavior because the P5C processor is required. Again, for more information, refer to the Intel web site.

Sample Code


   /* Compile options needed: /GM
   */ 

   void main(void)
   {
       _asm {
           pand mm0, mm1  ; packed and
           emms           ; empty MMX state
       }
   } 

Additional query words: Pentium P5C Pro illegal instruction

Keywords : kbCompiler kbVC kbVC410 kbVC420 kbVC500 kbVC600 kbx86 InLineAsmIss
Version : WinNT:4.1,4.2,5.0,6.0
Platform :
Issue type :


Last Reviewed: September 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.