[Development] Passing QSize, QPoint, QTime and other small structs by value

Thiago Macieira thiago.macieira at intel.com
Fri Apr 7 19:54:23 CEST 2017


Em sexta-feira, 7 de abril de 2017, às 10:10:38 PDT, Giuseppe D'Angelo 
escreveu:
> Il 07/04/2017 17:45, Thiago Macieira ha scritto:
> > We're not talking about primitives. We're talking about structs that are
> > very small and trivial. See for yourself:
> > 
> > https://godbolt.org/g/pvwjWE
> > 
> > Direct primitive passing is fine:
> > 
> > https://godbolt.org/g/Ghj8US
> 
> Sorry, what do you mean "is fine"? What's not fine?

Passing float or double by value means they get passed in the x87 registers. 
Passing float inside a struct means it's passed in the x86 stack instead.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list