Hello All (& Ian)

The Go language has functions which can give more than one result.

In my MELT experience, most multiple-results function calls have only two 
results. Giving 3 results is very rare, and giving more than 3 results is 
really exceptionnal (probably as exceptionnal as functions with more than 6 
arguments).

>From what I learned from the Go tutorial at the GCC summit, The Go language 
>also have several idioms with two results.

>From what I know of the AMD64 ABI, (but I might be false), functions are only 
>supposed to return one result in a register (rax...).

I would imagine that most (& perhaps all) GCC target architectures have at 
least two available registers to return values. So I would imagine that 
defining a (e.g. Go specific) binary convention where a dual-result functions 
gives the secondary result in another register (eg rbx on AMD64) would make 
sense, and be quite quick, and be reasonably easy to implement.

However, I don't know much about GCC backends.

Does the Go language define a specific ABI convention for returning two values 
from a function thru registers? If yes, how does GCC implement it? Or is it 
some future work?

Cheers.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

Reply via email to