Passing types containing SSE/AVX values

一笑奈何 提交于 2019-12-06 06:06:14

The answer is that it doesn't matter.

According to this:

http://msdn.microsoft.com/en-us/library/ms235286.aspx

The calling convention states that 16-byte (and probably 32-byte) operands are always passed by reference. So even if you to pass by value, the compiler will pass it by reference underneath.

In other words, XMM and YMM registers are never passed by value in Windows. But the lower halves of XMM0-4 can still be used to pass 64-bit parameters by value.

EDIT:

In your second example with the float value, there is a slight difference since it will still affect whether or not b is passed by reference or by value.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!