A Discussion of Tuple Syntax

Manu turkeyman at gmail.com
Tue Aug 20 07:46:08 PDT 2013


On 20 August 2013 16:39, Timon Gehr <timon.gehr at gmx.ch> wrote:

> On 08/20/2013 02:18 AM, Andrei Alexandrescu wrote:
>
>>
>> Why would it be necessary to return an object of type TypeTuple (i.e.
>> template tuple)?
>>
>
> - ABI
>
> Multiple return values could use a more efficient ABI than struct
> instances because they do not have an address.
>

*** this

I've been banging this drum for years!

However this discussion resolves, I just hope it allows for convenient and
efficient MRV's.
Obviously it should be syntactically convenient, and assignment of MRV to
callee locals should be convenient too.
But more importantly, I'd like to see ALL the argument registers re-used to
return multiple values, rather than just the first one. They're just
sitting there begging to be used, and in many cases, would lead to some
great efficiency improvements across function calls/returns. Especially on
non-x86 architectures.

Perhaps one of the most common causes for (otherwise unnecessary) inlining
of functions is because of the terrible legacy ABI for returning multiple
values from functions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130821/aaa2f2e7/attachment.html>


More information about the Digitalmars-d mailing list