Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-18 Thread John McCall via swift-dev
> On Dec 18, 2015, at 10:29 AM, Joe Groff wrote: >> On Dec 17, 2015, at 3:43 PM, John McCall wrote: >> >>> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >>> wrote: >>> We currently always pass inout parameters indirectly, but it seems to me >>> that for inout parameters that are of sma

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-18 Thread Joe Groff via swift-dev
> On Dec 17, 2015, at 3:43 PM, John McCall wrote: > >> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >> wrote: >> We currently always pass inout parameters indirectly, but it seems to me >> that for inout parameters that are of small trivial types like Int or >> CGSize, a value-result

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-18 Thread John McCall via swift-dev
> On Dec 17, 2015, at 11:09 PM, Slava Pestov via swift-dev > wrote: >> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >> wrote: >> >> We currently always pass inout parameters indirectly, but it seems to me >> that for inout parameters that are of small trivial types like Int or >> CGS

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-17 Thread Slava Pestov via swift-dev
> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev > wrote: > > We currently always pass inout parameters indirectly, but it seems to me that > for inout parameters that are of small trivial types like Int or CGSize, a > value-result calling convention might always be preferable, and we m

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-17 Thread Chris Lattner via swift-dev
> On Dec 17, 2015, at 3:44 PM, Joe Groff via swift-dev > wrote: > > >> On Dec 17, 2015, at 3:43 PM, Greg Parker wrote: >> >> >>> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >>> wrote: >>> >>> On ARMv7 and ARM64, the argument and return register sets are the same >> >> Nit: True

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-17 Thread Joe Groff via swift-dev
> On Dec 17, 2015, at 3:43 PM, Greg Parker wrote: > > >> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >> wrote: >> >> On ARMv7 and ARM64, the argument and return register sets are the same > > Nit: True on arm64. Not true on armv7; the GPR parameters are r0-r3 but GPR > return is r

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-17 Thread John McCall via swift-dev
> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev > wrote: > We currently always pass inout parameters indirectly, but it seems to me that > for inout parameters that are of small trivial types like Int or CGSize, a > value-result calling convention might always be preferable, and we might

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-17 Thread Greg Parker via swift-dev
> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev > wrote: > > On ARMv7 and ARM64, the argument and return register sets are the same Nit: True on arm64. Not true on armv7; the GPR parameters are r0-r3 but GPR return is r0-r1. -- Greg Parker gpar...@apple.com Runtime Wrangler

[swift-dev] Value-result ABI for small trivial inouts

2015-12-17 Thread Joe Groff via swift-dev
We currently always pass inout parameters indirectly, but it seems to me that for inout parameters that are of small trivial types like Int or CGSize, a value-result calling convention might always be preferable, and we might want to codify that in the stable ABI. Values of these types are likel