News for hackers. Stuff that matters.
Re:Comparing the Cost of Different Multiple-return Technique... by justincormack on Monday December 23, 2013 @10:44AM (#6954783)
The other method is to change the calling convention and use a different ABI. NetBSD syscalls have multiple return values in registers, although it is little used (pipe returns two args, plus functions that return 64 bits on 32 bit platforms. If you were inventing a new ABI this could be nice. Multiple return values are very idiomatic...
Re:Comparing the Cost of Different Multiple-return Technique... by mikeash on Monday December 23, 2013 @12:01PM (#6955222)
From the ABI perspective, struct returns are multiple return values. ARM64 allows structs to be returned in registers if the struct members are suitable for it.
Re:Comparing the Cost of Different Multiple-return Technique... by justincormack on Monday December 23, 2013 @12:17PM (#6955305)
I didnt know that. Apparently amd64 lets you return two 64 bit values in registers too, but no more.
Re:Comparing the Cost of Different Multiple-return Technique... by mprovost on Monday December 23, 2013 @05:11PM (#6956852)
Two is still an incredibly handy feature. I would guess that the most common case for returning multiple values is data and size, like all the functions that return a string and the length of the string.
Re:Comparing the Cost of Different Multiple-return Technique... by justincormack on Tuesday December 24, 2013 @04:06AM (#6958801)
Yes. Or the value. error style as used by node.js. forcing errors unto the domain gets messy.