带 /CLR 开关的 SSE2 指令支持

发布于 2024-09-09 02:39:00 字数 48 浏览 1 评论 0原文

为什么 SSE2 增强指令集优化不适用于使用 /clr 开关编译的 C++ 程序?

Why isn't the SSE2 enhanced instruction set optimization available for C++ programs compiled with the /clr switch?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

真心难拥有 2024-09-16 02:39:00

JIT 编译器的工作就是生成机器代码。它将根据其运行的处理器的架构来执行此操作。是的,它会在适当的时候使用 SSE 指令,x64 JITter 大量使用它们。

如果您想在代码中使用 SSE2,则必须在不使用 /clr 的情况下单独编译它。或者使用 #pragma 托管指令切换到机器代码生成,以便您可以使用内在函数。

It is the job of the JIT compiler to generate the machine code. It will do so based on the architecture of the processor it runs on. Yes, it will use SSE instructions when appropriate, the x64 JITter uses them heavily.

If you want to use SSE2 in your code then you'll have to compile it separately without /clr. Or use the #pragma managed directive to switch to machine code generation so you can use the intrinsics.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文