On May 9, 2011, at 1:41 PM, Renato Golin wrote: [snip]> One example is the struct byval. The ARM back-end still doesn't > support struct byval (maybe now it does, I was away for a while),The ARM backend now supports struct byval for APCS. Extending it to support AAPCS shouldn't be too difficult. Alas, I won't have time to revisit this in the near future. stuart
On Wed, May 11, 2011 at 11:42 PM, Stuart Hastings <stuart at apple.com> wrote:> > On May 9, 2011, at 1:41 PM, Renato Golin wrote: > > [snip] > >> One example is the struct byval. The ARM back-end still doesn't >> support struct byval (maybe now it does, I was away for a while), > > The ARM backend now supports struct byval for APCS. Extending it to support AAPCS shouldn't be too difficult. Alas, I won't have time to revisit this in the near future.It's slightly unclear to me what byval means for an ABI that passes some structs in registers, such as AAPCS-VFP. deep
Hi Sandeep,>> The ARM backend now supports struct byval for APCS. Extending it to support AAPCS shouldn't be too difficult. Alas, I won't have time to revisit this in the near future. > > It's slightly unclear to me what byval means for an ABI that passes > some structs in registers, such as AAPCS-VFP.I think in that case the front-end is supposed to extract the bits passed in registers and pass them as registers (i.e. as float/integer parameters) and pass the rest of the struct (i.e. the bit that is passed on the stack) as a byval parameter. Ciao, Duncan.
On May 12, 2011, at 12:30 AM, Sandeep Patel wrote:> On Wed, May 11, 2011 at 11:42 PM, Stuart Hastings <stuart at apple.com> wrote: >> >> On May 9, 2011, at 1:41 PM, Renato Golin wrote: >> >> [snip] >> >>> One example is the struct byval. The ARM back-end still doesn't >>> support struct byval (maybe now it does, I was away for a while), >> >> The ARM backend now supports struct byval for APCS. Extending it to support AAPCS shouldn't be too difficult. Alas, I won't have time to revisit this in the near future. > > It's slightly unclear to me what byval means for an ABI that passes > some structs in registers, such as AAPCS-VFP.IIUC, the byval attribute on a pointer to a structure means "this struct should really be passed by value." If you ignore the byval attribute, the IR mis-represents what the developer wrote. The target ISel is supposed to notice the byval attribute and replace the pointer argument with a copy of the structure in the generated code. I'm not familiar with AAPCS-VFP, but I'd assume that any byval struct should be passed by value, as if byval didn't exist. The ABI should not be aware that byval is in use. stuart