Intel MMX Technology Support in Visual C++

Last reviewed: September 26, 1997
Article ID: Q154853
4.10 4.20 WINDOWS NT kbtool

The information in this article applies to:

- The Microsoft C/C++ Compiler (CL.EXE), included with:

  Microsoft Visual C++, 32-bit Edition, versions 4.1, 4.2, 5.0
  on the following platform: x86

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.

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 does nothing programmatically useful but is meant simply to illustrate 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
    }
}


KBCategory: kbtool
KBSubcategory: VCx86 CLIss InLineAsmIss
Additional reference words: 4.10 4.20kbdsh Pentium P5C Pro illegal
instruction
Keywords : CLIss InLineAsmIss VCx86
Version : WinNT:4.1,4.2,5.0


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 26, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.