Multiple return values...

Iain Buclaw ibuclaw at ubuntu.com
Mon Mar 12 12:23:31 PDT 2012


On 12 March 2012 17:59, Manu <turkeyman at gmail.com> wrote:
> On 12 March 2012 19:49, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
>>
>> OK, -msse2 is not an ARM target option. :~)
>
>
> Oh sorry, I thought you were asking about the x86 codegen ;)
>
> I used -S -O2 -float-abi=hard
>
>
>> Looking around, the "Procedure Call Standard for the ARM Architecture"
>> specifically says (section 5.4: Result Return):
>>
>> "A Composite Type not larger than 4 bytes is returned in R0."
>>
>> "A Composite Type larger than 4 bytes ... is stored in memory at an
>> address passed as an extra argument when the function was called ..."
>
>
> Indeed, x86 is the only architecture I know which has this magic 8byte
> packing. Every other architecture will be just as bad as ARM by the standard
> C ABI.
> Something needs to be done about delegates and ranges at the very least, it
> would seen GDC just see's these as 8 byte structs being passed around by
> value, and only x86 has a hack to improve this.
> Does GDC understand MRV internally? I know LLVM does at least, but I
> couldn't find info about GDC.
>

It does not.

>
>> Feel free to correct me if that document is slightly out of date.
>
>
> Document? :)

Link:  http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list