[llvm-dev] ABI for i256 in MCJIT

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sat Apr 16 08:00:12 PDT 2016


On 16 April 2016 at 03:22, Paweł Bylica <llvm-dev at lists.llvm.org> wrote:
> The other part of the question is how to match i256 type on the C/C++ side?

For a single i256, I think anything with the same size will do
("struct { uint64_t vals[4]; }" for example).

If other arguments are around you get into how the target decides to
split values between registers and the stack which is complicated
business. For the cases I'm aware of a similar struct with the largest
valid type is *probably* OK (so an array of "unsigned __int128" if
it's legal on the C side, otherwise uint64_t, ...).

It would be safest to do the munging on the LLVM side though (i.e.
split up your i256 and actually do the call as a "{ [4 x i64] }").

Cheers.

Tim.


More information about the llvm-dev mailing list