intro_asm_intrin - Overview of intrinsic/built-in function support for direct access to assembly instructions.


Cray Linux Environment (CLE)


The Cray C/C++ compiler supports the use of intrinsic/built-in functions to access Streaming SIMD Extensions (SSE) and Advanced Vector Extensions (AVX) on x86 hardware. The compiler supports both Intel-style intrinsic names and the GNU-style built-in names.

The compiler supports intrinsics for the SSE, SSE2, and SSE3 instruction sets, as well as SSE4.1, SSE4.2, FMA, AVX, and AVX2 on targets that support those instruction sets. See Intel Intrinsics Guide and (link to URL .

The GNU intrinsics are available by using the compiler command-line option -hgnu.

These functions are defined in the <fmaintrin.h>, <x86intrin.h>, <xmmintrin.h>, <pmmintrin.h>, <smmintrin.h>, and <immintrin.h> header files.


The following examples illustrate that CCE recognizes both the GNU syntax and Intel intrinsic syntax to generate a mulps instruction.

Example 1: Intel

#include <xmmintrin.h>

__m128 myfunction( __m128 __A,  __m128 __B)
return _mm_mul_ps( __A, __B);

Example 2: GNU

#include <x86intrin.h>    /* SSE */

__v4sf myfunction( __v4sf arg0, __v4sf arg1)
return __builtin_ia32_mulps(arg0,arg1);

SEE ALSO (link to URL

Intel Intrinsics Guide