[LLVMdev] Pass and return of large objects

Duncan Sands
Tue, 02 Mar 2010 08:49:11 -0000

Hi Reid,

>> I hadn't realized that, I would've expected complex numbers to
be
>> doable as just a pair of scalar values. What's the fly in the
ointment
>> with C99 complex numbers?

the x86-64 ABI requires complex numbers to be passed *differently* to
a pair of scalar values.  So if the LLVM code generators were to do the
lowering, then there would need to be a way to say: this pair of scalars
is just a pair of scalars - pass it normally; but this other pair of scalars
is really a complex number - pass it using a different method.  If you take a
pessimistic view, then in order for LLVM to do the lowering then the entire C
type system would somehow have to be injected into the LLVM IR.

Ciao,

Duncan.