Il 07/04/2017 19:54, Thiago Macieira ha scritto:
>> 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.

This is a separate discussion, though. I.e. not "by value", not "by
const ref", but "unpacked field by field". Unlike value/const-ref, which
has also implications for the compiler (no aliasing, better value
tracking, etc.), value/unpacked should be purely about optimizing for
the ABI.

And I still wonder: is any of this really an issue on modern
superscalar, out of order CPU architectures? Does anyone know hard
numbers, research papers, tooling, anything to show that unpacking gives
actual benefits, because CPU vendors cannot or did not optimize for this
case?

I've tried to measure the difference of calling f(QStringView) vs.
f(char16_t*, size_t) on Windows, and the results were simply lost in the
variance. (And then whatever results I would've extracted, I'm sure they
would likely be completely different on another CPU).

My 2 c,
-- 
Giuseppe D'Angelo | [email protected] | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to