Go to main content
Oracle® Developer Studio 12.5: C User's Guide

Exit Print View

Updated: June 2017
 
 

2.19 Compiler Support for Intel MMX and Extended x86 Platform Intrinsics

Prototypes declared in the mmintrin.h header file support the Intel MMX intrinsics, and are provided for compatibility.

Specific header files provide prototypes for additional extended platform intrinsics, as shown in Table 6. Include these header files in your source code like any other system header file; that is, #include <header> where header.h is one of the files listed in Table 6. To find the location of these header files to examine their content, use the –H flag when compiling with the C compiler. For example:

% cat t.c
#include <xmmintrin.h>
% cc -H t.c -c
/opt/studio/lib/compilers/include/cc/xmmintrin.h
        /opt/studio/lib/compilers/include/cc/sys/xmmintrin.h
                /opt/studio/lib/compilers/include/cc/sys/mmintrin.h
                        /opt/studio/lib/compilers/include/cc/sys/sunmedia_types.h
%
Table 6  MMX and Extended x86 Intrinsics
x86 Platform
Header File
SSE
mmintrin.h
SSE2
xmmintrin.h
SSE3
pmmintrin.h
SSSE3
tmmintrin.h
SSE4A
ammintrin.h
SSE4.1
smmintrin.h
SSE4.2
nmmintrin.h
AES encryption and PCLMULQDQ
wmmintrin.h
AVX, CORE-AVX-I, AVX2
immintrin.h

Each header file includes the prototypes before it in the table. For example, on an SSE4.1 platform, including smmintrin.h in the user program declares the intrinsic names supporting SSE4 .1, SSSE3, SSE3, SSE2, SSE, and MMX platforms because smmintrin.h includes tmmintrin.h, which includes pmmintrin.h, and so on down to mmintrin.h.

Note that ammintrin.h is published by AMD and is not included in any of the Intel intrinsic headers. ammintrin.h includes pmmintrin.h, so by including ammintrin.h, all AMD SSE4A as well as Intel SSE3, SSE2, SSE and MMX functions are declared.

Alternatively, the single Oracle Developer Studio header file sunmedia_intrin.h includes declarations from all the Intel header files, but does not include the AMD header file ammintrin.h.

Be aware that code deployed on a host platform (for example, SSE3) that calls any super-set intrinsic function (for example, for AVX) will not load on Oracle Solaris platforms and could fail with undefined behavior or incorrect results on Oracle Linux platforms. Deploy programs that call these platform-specific intrinsics only on the platforms that support them.

These are system header files and should appear in your program as shown in this example:

#include <nmmintrin.h>

Refer to the latest Intel C++ compiler reference guides for details on these intrinsics.