[LLVMdev] Pass and return of large objects

Duncan Sands baldrick at free.fr
Tue Mar 2 01:17:59 PST 2010


Hi Russell,

> Hmm. I've already decided to implement complex numbers basically the
> classic C++ way, as a template. On the bright side, hopefully that
> means the LLVM code generators will end up putting them in pairs of
> registers. On the downside, I suppose that means I'll be honoring the
> x86-64 ABI for complex numbers in the breach rather than the
> observance. Is that going to have any horribly bad consequences?

it only matters if you will be linking with complex number code compiled
with a different compiler, eg BLAS/lapack, complex math functions.

> I would be inclined to guess no, the ABI mostly matters when you're
> calling libraries to do various kinds of IO/protocol translation, and
> those wouldn't normally use complex numbers.

The ABI specifies how parameters are passed when calling a function,
and how values are returned from function calls.  If your code calls
eg "cabs" then you are probably dead.

Ciao,

Duncan.




More information about the llvm-dev mailing list