[cfe-commits] r167647 - in /cfe/trunk: include/clang/Basic/BuiltinsNVPTX.def test/CodeGen/builtins-nvptx.c

Eli Friedman eli.friedman at gmail.com
Fri Nov 9 16:02:41 PST 2012


On Fri, Nov 9, 2012 at 3:50 PM, Justin Holewinski
<justin.holewinski at gmail.com> wrote:
> Author: jholewinski
> Date: Fri Nov  9 17:50:51 2012
> New Revision: 167647
>
> URL: http://llvm.org/viewvc/llvm-project?rev=167647&view=rev
> Log:
> [NVPTX] Add __nvvm_* intrinsics as Clang builtins
>
> Fixes bug 13354.
>
> Modified:
>     cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def
>     cfe/trunk/test/CodeGen/builtins-nvptx.c
>
> Modified: cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def?rev=167647&r1=167646&r2=167647&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def (original)
> +++ cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def Fri Nov  9 17:50:51 2012
> @@ -14,6 +14,7 @@
>
>  // The format of this database matches clang/Basic/Builtins.def.
>
> +// Builtins retained from previous PTX back-end
>  BUILTIN(__builtin_ptx_read_tid_x, "i", "nc")
>  BUILTIN(__builtin_ptx_read_tid_y, "i", "nc")
>  BUILTIN(__builtin_ptx_read_tid_z, "i", "nc")
> @@ -59,4 +60,249 @@
>  BUILTIN(__builtin_ptx_bar_sync, "vi", "n")
>
>
> +// Builtins exposed as part of NVVM
> +BUILTIN(__syncthreads, "v", "nc")
> +BUILTIN(__nvvm_bar0, "v", "nc")
> +BUILTIN(__nvvm_bar0_popc, "ii", "nc")
> +BUILTIN(__nvvm_bar0_and, "ii", "nc")
> +BUILTIN(__nvvm_bar0_or, "ii", "nc")
> +BUILTIN(__nvvm_membar_cta, "v", "n")
> +BUILTIN(__nvvm_membar_gl, "v", "n")
> +BUILTIN(__nvvm_membar_sys, "v", "n")
> +BUILTIN(__nvvm_popc_i, "ii", "n")
> +BUILTIN(__nvvm_popc_ll, "iLLi", "n")

Shouldn't this be marked with "c" as well?   More generally, how
carefully did you review this?

-Eli



More information about the cfe-commits mailing list