访问Visual Studio与Xcode中__M128D内在的组件不以相同的方式工作吗?
以下代码与Xcode合作:
const __m128d source = { x, y };
const double destination = source[0]; // Read the "x" from "source"
在Visual Studio的最新版本中,我从编译器中获取以下错误消息: --->没有操作器与这些操作数匹配。
根据我从Web中发现的所有示例,上面应该是访问__M128D内部这些组件的标准方法,那么什么导致错误以及如何解决该组件?
The below code works fine with Xcode:
const __m128d source = { x, y };
const double destination = source[0]; // Read the "x" from "source"
In latest version of Visual Studio I get the following error message from the compiler:
---> No operator "[]" matches these operands.
According to all examples I've found from the web the above should be the standard way of accessing those components inside __m128d, so what is causing the error and how to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
source [i]
语法是GCC/clang扩展名,不适用于MSVC。要提取A
__ M128D
向量组件的下部组件,用于上部组件,您需要首先将其移至下部,例如,例如,使用:
而不是
_movehl_ps
您还可以使用_mm_shuffle_pd
指令。另外,如果您实际上打算将上层元素存储到内存中,则可以使用:
The
source[i]
syntax is a GCC/Clang extension which does not work with MSVC.To extract the lower
double
component of a__m128d
vector useFor the upper component, you need to first move it to the lower part, e.g., using:
Instead of
_movehl_ps
you could also use a_mm_shuffle_pd
instruction.Also, if you actually intend to store the upper element to memory, you could use: