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.)