intro_asm_intrin

Date:

07-07-2014

NAME

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

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

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 http://gcc.gnu.org/onlinedocs/gcc/X86-Built-in-Functions.html#X86-Built-in-Functions (link to URL http://gcc.gnu.org/onlinedocs/gcc/X86-Built-in-Functions.html#X86-Built-in-Functions) .

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.

EXAMPLE

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

http://gcc.gnu.org/onlinedocs/gcc/X86-Built-in-Functions.html#X86-Built-in-Functions (link to URL http://gcc.gnu.org/onlinedocs/gcc/X86-Built-in-Functions.html#X86-Built-in-Functions)

Intel Intrinsics Guide