Intrinsic Function

In compiler theory, an intrinsic function is a function available for use in a given language whose implementation is handled specially by the compiler. Typically, it substitutes a sequence of automatically generated instructions for the original function call, similar to an inline function. Unlike an inline function though, the compiler has an intimate knowledge of the intrinsic function and can therefore better integrate it and optimize it for the situation. This is also called builtin function in many languages.

Compilers that implement intrinsic functions generally enable them only when the user has requested optimization, falling back to a default implementation provided by the language runtime environment otherwise.

Intrinsic functions are often used to explicitly implement vectorization and parallelization in languages which do not address such constructs. Altivec and OpenMP are examples of APIs which use intrinsic functions to declare, respectively, vectorizable and multiprocessor-aware operations during compilation. The compiler parses the intrinsic functions and converts them into vector math or multiprocessing object code appropriate for the target platform.

Microsoft and Intel's C/C++ compilers as well as GCC implement intrinsics that map directly to the x86 SIMD instructions (MMX, SSE, SSE2, SSE3, SSSE3, SSE4). In the latest version of the Microsft Visual Studio (VS2010), the Visual C++ compiler does not support inline assembler for X86-64 (neither VS2008 nor VS2005). To compensate for the lack of inline assembly, new intrinsics have been added that map to standard assembly instructions that are not normally accessible through C/C++ (e.g.: bit scan).

Famous quotes containing the words intrinsic and/or function:

    Three elements go to make up an idea. The first is its intrinsic quality as a feeling. The second is the energy with which it affects other ideas, an energy which is infinite in the here-and-nowness of immediate sensation, finite and relative in the recency of the past. The third element is the tendency of an idea to bring along other ideas with it.
    Charles Sanders Peirce (1839–1914)

    The function of literature, through all its mutations, has been to make us aware of the particularity of selves, and the high authority of the self in its quarrel with its society and its culture. Literature is in that sense subversive.
    Lionel Trilling (1905–1975)