Multiple return values
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Wed Jan 4 06:23:44 PST 2012
On 1/4/12 2:36 AM, Manu wrote:
> Regardless, I'd like to put a strong +1 towards proper multiple return
> values. The point is NOT just to have the syntactical feature (ie.
> struct return value semantics via tuples). The point is a language
> guarantee that the architecture will do its best job to return each
> value in consecutive registers OF ITS OWN TYPE, avoiding
> allocation&writing to the stack. This is a common problem in C where the
> only solution is to make functions inline or pay the cost of hitting the
> stack (LHS hazard, very expensive on many RISC architectures).
> It would lead to many optimisations in lots of code in my experience.
Why make those optimizations only for multiple return values and not for
every single returned structure?
Andrei
More information about the Digitalmars-d
mailing list