Intrinsic function

转载 2012年03月26日 18:20:30

Intrinsic function

From Wikipedia, the free encyclopedia
Jump to: navigation,search

In compiler theory, an intrinsic function is a function available for use in a givenlanguage 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 requestedoptimization, 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 andmultiprocessor-aware operations during compilation. The compiler parses the intrinsic functions and converts them into vector math or multiprocessingobject 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[1] (neither VS2008[2] nor VS2005[3]). 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).[4]


在llvm的clang中添加新的后端和Intrinsic function

本文记录一下如何在llvm的clang源码中添加一种新的后端(暂时命名为cpu0),并在其中添加Intrinsic function。涉及到的文件列表:./src/include/llvm/IR/In...


一、问题背景   最初,我们只能使用汇编语言来编写SIMD代码。不仅写起来很麻烦,而且易读性、可维护性、移植性都较差。   不久,VC、GCC等编译器相继支持了Intrinsic函数,使我们可...

hardware intrinsic security

  • 2015-04-15 22:48
  • 5.29MB
  • 下载

Intrinsic geometry of surfaces

  • 2008-02-14 08:44
  • 2.85MB
  • 下载

Cognition & The Intrinsic User Experience

转载出处: Cognition & The Intrin...

HLSL固有函数 【Intrinsic Functions (DirectX HLSL)】

Intrinsic Functions (DirectX HLSL) The following table lists the intrinsic functions available in H...

GCC中x86架构下simd intrinsic函数的实现的分析


Intrinsic Locks & Synchronized Statements

Java的同步建立在intrinsic lock(也称为monitor lock)的基础之上,intrinsic lock用于保证对指定对象状态的排他性访问及建立happens-before关系。每一...

在C/C++代码中使用SSE等指令集的指令(4)SSE指令集Intrinsic函数使用 在

使用RAMP理解内在动机 Understanding Intrinsic Motivation with RAMP

使用RAMP理解内在动机 原文地址 关于Gamification中的外在奖励和内在动机我们讨论了很多了。这种讨论总是像在讨论好的和坏的方式。我对于之前这样讨论常常感到内疚!其实最好...