From a02d183357424b007eb93170acf9577a4f1a34e1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 16 Sep 2010 18:17:55 +0000 Subject: [PATCH] add a compatibility note about vector builtins git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114101 91177308-0d34-0410-b5e6-96231b3b80d8 --- www/compatibility.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/www/compatibility.html b/www/compatibility.html index bc34a863f5..4196e880ec 100644 --- a/www/compatibility.html +++ b/www/compatibility.html @@ -32,6 +32,7 @@
  • C compatibility @@ -114,6 +115,32 @@ Undefined symbols: be changed.
  • + + +

    "missing" vector __builtin functions

    + + +

    The Intel and AMD manuals document a number "<*mmintrin.h>" +header files, which define a standardized API for accessing vector operations +on X86 CPUs. These functions have names like _mm_xor_ps and +_mm256_addsub_pd. Compilers have leeway to implement these functions +however they want. Since Clang supports an excellent set of native vector operations, +the Clang headers implement these interfaces in terms of the native vector +operations. +

    + +

    In contrast, GCC implements these functions mostly as a 1-to-1 mapping to +builtin function calls, like __builtin_ia32_paddw128. These builtin +functions are an internal implementation detail of GCC, and are not portable to +the Intel compiler, the Microsoft compiler, or Clang. If you get build errors +mentioning these, the fix is simple: switch to the *mmintrin.h functions.

    + +

    The same issue occurs for NEON and Altivec for the ARM and PowerPC +architectures respectively. For these, make sure to use the <arm_neon.h> +and <altivec.h> headers.

    + +

    Lvalue casts