[LLVMdev] Problem returning aggregate struct (complex number) by value
Duncan Sands
baldrick at free.fr
Fri Apr 2 13:03:09 PDT 2010
Hi Andrew,
> %0 = type { float, float }
>
> define %0 @test600() {
> entry:
> ret %0 { float 4.200000e+01, float 3.500000e+01 }
> }
>
>
> Running that through llc, the x86-64 assembly looks like this (abbreviated):
unfortunately the x86-64 ABI says that complex numbers are *not* passed the
same as a struct containing two floats. Your LLVM IR is not ABI conformant
and thus will not interact properly with ABI conformant code, like that produced
by llvm-gcc.
Ciao,
Duncan.
More information about the llvm-dev
mailing list