LLVM 2.6 and Aggregate Return Values: 64 bit

Dear All.

How well does LLVM 2.6 support aggregate return values for 64 bit targets? I'm currently working on 64 bit Mac OS X and 64 bit Linux. Are there any known problems or limitations?

-- John T.

Hi John,

How well does LLVM 2.6 support aggregate return values for 64 bit targets? I'm currently working on 64 bit Mac OS X and 64 bit Linux. Are there any known problems or limitations?

on x86-64 it depends on what you are returning, but for example you
should be able to return a 128 bit integer fine, but anything more
will cause the code generator blow up. This limitation has been
removed in the development version.

Ciao,

Duncan.

I'm just curious but does this also work limitlessly on ARM?

Not yet, as far as I know. There is a small target-specific hook that
needs to be implemented, and I've only done so for x86 since it's the
only machine I own. As far as I know, no one has stepped up to fill
in the hook for other processors.

Duncan Sands wrote:

Hi John,

How well does LLVM 2.6 support aggregate return values for 64 bit targets? I'm currently working on 64 bit Mac OS X and 64 bit Linux. Are there any known problems or limitations?
    
on x86-64 it depends on what you are returning, but for example you
should be able to return a 128 bit integer fine,

Just to make sure I understand, if the size of the aggregate return value is 128 bits or less, then it should work. Correct?

but anything more
will cause the code generator blow up.

By "blow up," do you mean that the code generator will fail to generate code at all (e.g., it will hit an assertion) or do you mean that the code generator will generate incorrect code? I am seeing the latter in my code, and I currently suspect it's a code generator bug (though I could be wrong).

-- John T.

You will see the code generator hit an assertion if the return value
isn't supported on your platform. If assertions are turned off, then
of course it will generate bad code.

On the trunk, large struct returns *should* work on x86-64, but I
haven't tested that... I've only tested x86.