[llvm-dev] running intrinsics from C code

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Tue May 24 18:09:39 PDT 2016


GCCBuiltin just gives it a name for clang to lookup. Generally they match
up with builtins that gcc also implements, but that's not a requirement.

If you add a builtin with the same name to the builtin file in clang's
include/clang/Basic/Builtins*.def then they will find each other.

You can also just add a builtin to clang's builtin file and catch it in
clang's lib/CodeGen/CGBuiltins.cpp and implement whatever IR you want
including calling an intrinsic.

Hope this helps.

On Tue, May 24, 2016 at 5:04 PM, Rail Shafigulin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I've created an intrinsic from my target, but I can't figure out how I can
> run it from a C code. Most of the targets have a GCCBuiltin and it looks
> like it is the way to execute an intrinsic from C code. However in my case
> there is no actual GCC built in.
>
> Any help on this is really appreciated.
>
> --
> Rail Shafigulin
> Software Engineer
> Esencia Technologies
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>


-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160524/55c715a9/attachment.html>


More information about the llvm-dev mailing list