[cfe-dev] Writing built-ins for instructions returning multiple operands

Martin J. O'Riordan via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 9 02:53:34 PDT 2015

I have written many builtins for our SHAVE processor which bind directly to
our instructions, and making instructions that are not easily selectable by
the compiler available to the programmer.


The majority of these are straight-forward enough, taking a small number pf
input operands and returning a single result; for example 'int
__builtin_shave_mul(int, int)' might map onto a simple multiple instruction
that takes two input integer operands in registers, and returns a single
integer result in another register.


However, I have a small number instructions that have two output operands,
each in a separate register.  I would like to provide access to these
instructions using the builtins approach.  This is easy enough to express in
LLVM IR, but I have not been able to figure out how this can be presented in
a C or C++ binding.


Is there a pattern for doing this kind of thing that I haven't discovered,
or is it simply something that cannot be expressed using the C binding to
the builtins?




            MartinO (Movidius Ltd.)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150909/af148aa4/attachment.html>

More information about the cfe-dev mailing list