> For the record, I finally got it working. I had to hack the calling
> conventions in LLVM to disable the use of ST(0)/ST(1) registers to return
> multiple floating-point values. Then the generated assembly is compatible
> with MSVC ABI. What I don't understand is why that problem does not occur on
> 32-bits Linux. AFAIK the ABI to return aggregates are the same (except for
> who's popping the hidden pointer argument).
Thank you for looking into this. Calling conventions are a real pain.
I'm not sure if disabling ST(0)/ST(1) is a good long term solution as
we might run into issues trying to return some other type. I should
look at clang to see how they handle this issue (this might take some
time though).
I didn't disable ST(0)/ST(1), I just removed ST(1) as a possible return register. So {double,double} are now returned as a hidden pointer (while a single double is returned in ST(0), as it should be). I didn't test, but I'm wondering what LLVM will generate for code returning {float,float}. On x86-32 it should use EAX:EDX.
This problem might also appear on 32bit linux. I have a machine
running 32bit linux and am trying it now.
I wanted to try on my F16 box, but it only has LLVM 2.9. Is LLVM 3.0 absolutely required? The configure script succeeded, but the compilation failed as it couldn't find llvm/Support/TargetSelect.h.