[llvm-commits] [PATCH] Bug in APCS
echristo at apple.com
Tue Oct 12 14:33:27 CDT 2010
On Oct 12, 2010, at 12:31 PM, Chris Lattner wrote:
> On Oct 12, 2010, at 12:28 PM, Eric Christopher wrote:
>> On Oct 12, 2010, at 12:14 PM, Tanya Lattner wrote:
>>> I discovered a bug in APCS when returning a vector of size 3 and type double. It hits llvm_unreachable because it runs out of registers to use when attempting to return the double3 via the calling convention APCS.
>>> Attached is a patch with my suggested changes and a test case. I'd appreciate a review of this patch.
>> Since it's greater than 128-bits I think the abi says to pass it by reference and return in memory?
>> A 128-bit containerized vector is returned in r0-r3.
>> A Composite Type larger than 4 bytes, or whose size cannot be determined statically by both caller and callee, is stored in memory at an address passed as an extra argument when the function was called (§5.5, rule A.4).
> Typically that would be handled by the frontend, not in the code generator. If a <3 x double> makes it into LLVM IR, the code generator can do whatever it wants. Similar things happen on X86 etc.
Sure, but what do you think should happen with the return value? Seems like whatever generated the arg passing in the first place should have done the right thing?
More information about the llvm-commits