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]

CMPXCHG8B - 比较并交换 8 字节

说明 比较 EDX:EAX 中的 64 位值与操作数(目标操作数)。如果这两个值相等,则将 ECX:EBX 中的 64 位值存储到目标操作数。否则,将目标操作数的值加载到 EDX:EAX。目标操作数...

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

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

hardware intrinsic security

  • 2015年04月15日 22:48
  • 5.29MB
  • 下载

Intrinsic geometry of surfaces

  • 2008年02月14日 08:44
  • 2.85MB
  • 下载

[C] 跨平台使用Intrinsic函数范例1——使用SSE、AVX指令集 处理 单精度浮点数组求和(支持vc、gcc,兼容Windows、Linux、Mac)

作者:zyl910。   本文面对对SSE等SIMD指令集有一定基础的读者,以单精度浮点数组求和为例演示了如何跨平台使用SSE、AVX指令集。因使用了stdint、zintrin、ccpuid这三个...

Intrinsic 基础入门【1】

Intel 官方网站上的Intrinsic指导: Microsoft官方网...
  • cmsbupt
  • cmsbupt
  • 2013年07月18日 13:38
  • 2119

[C] 跨平台使用Intrinsic函数范例2——使用SSE2、AVX指令集 处理 双精度浮点数组求和

作者:zyl910。   本文面对对SSE等SIMD指令集有一定基础的读者,以双精度浮点数组求和为例演示了如何跨平台使用SSE2、AVX指令集。支持vc、gcc编译器,在Windows、Linux、...
  • zyl910
  • zyl910
  • 2012年10月26日 18:06
  • 3955

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...
  • Gypsyy
  • Gypsyy
  • 2012年05月20日 09:44
  • 572

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

您举报文章:Intrinsic function