Intrinsic function

High-level language compilers often support so-called intrinsic functions or intrinsics in which processor-specific operations are encapsulated in function calls. Unlike the use of inline assembler the compiler intrinsic functions can fully taken into account in optimization.

Often you need to include some header files and / or set certain compiler options for the use of intrinsic functions. Most intrinsic functions are specifically named in order to distinguish them from the library or your own functions, for example by two underscores as a prefix.

Examples

The program line

U32_intvalue __ = ROUND ( f_floatvalue ); is translated by the C compiler for the processor in the assembler code R32C ROUND, the compiler has control of the processor registers which are used for the variables .. ( round- converts the opcode R32C a float taking into account the set for the processor rounding mode into an integer number. )

Situation in the programming languages ​​C and C for x86 processors

Microsoft and Intel's C or C compiler and GCC also provide intrinsic functions directly on the x86 SIMD instructions (MMX, SSE, SSE2, SSE3, SSSE3, SSE4 ) are mapped. In the newer versions of the Microsoft compiler ( VC2005 and VC2008 ) no inline assembler is supported for 64-bit applications. To compensate for the absence of the in-line assembler intrisische additional functions have been added, which are mapped on standard assembler instructions (such as bit scan) that are not otherwise obtainable by C or C.

415388
de