Visual C 中的 SSE2 选项 (x64)

发布于 2024-07-26 01:27:12 字数 205 浏览 5 评论 0原文

我已将 x64 配置添加到我的 C++ 项目中以编译我的应用程序的 64 位版本。 一切看起来都很好,但编译器给出了以下警告:

`cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'`

是否有 SSE2 优化真的不适用于 64 位项目?

I've added x64 configuration to my C++ project to compile 64-bit version of my app. Everything looks fine, but compiler gives the following warning:

`cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'`

Is there SSE2 optimization really not available for 64-bit projects?

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

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

发布评论

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

评论(3

要走就滚别墨迹 2024-08-02 01:27:12

似乎所有 64 位处理器都有 SSE2。 由于编译器选项始终默认打开,因此无需手动打开它。

来自维基百科

SSE指令:最初的AMD64架构采用Intel的SSE和SSE2作为核心指令。 SSE3 指令于 2005 年 4 月添加。SSE2 用 IEEE 32 位或 64 位浮点数学选择取代了 x87 指令集的 IEEE 80 位精度。 这提供了与许多其他现代 CPU 兼容的浮点运算。 SSE 和 SSE2 指令也已扩展,可以在八个新的 XMM 寄存器上运行。 SSE 和 SSE2 在现代 x86 处理器中以 32 位模式提供; 但是,如果它们在 32 位程序中使用,则这些程序只能在具有该功能的处理器的系统上运行。 这在 64 位程序中不是问题,因为所有 AMD64 处理器都有 SSE 和 SSE2,因此使用 SSE 和 SSE2 指令代替 x87 指令不会减少可以运行 x64 程序的机器集.SSE 和 SSE2 通常比传统 x87 指令、MMX 和 3DNow 更快,并且复制了传统 x87 指令、MMX 和 3DNow 的大部分功能!

Seems to be all 64-bit processors has SSE2. Since compiler option always switched on by default no need to switch it on manually.

From Wikipedia:

SSE instructions: The original AMD64 architecture adopted Intel's SSE and SSE2 as core instructions. SSE3 instructions were added in April 2005. SSE2 replaces the x87 instruction set's IEEE 80-bit precision with the choice of either IEEE 32-bit or 64-bit floating-point mathematics. This provides floating-point operations compatible with many other modern CPUs. The SSE and SSE2 instructions have also been extended to operate on the eight new XMM registers. SSE and SSE2 are available in 32-bit mode in modern x86 processors; however, if they're used in 32-bit programs, those programs will only work on systems with processors that have the feature. This is not an issue in 64-bit programs, as all AMD64 processors have SSE and SSE2, so using SSE and SSE2 instructions instead of x87 instructions does not reduce the set of machines on which x64 programs can be run. SSE and SSE2 are generally faster than, and duplicate most of the features of the traditional x87 instructions, MMX, and 3DNow!.

烂柯人 2024-08-02 01:27:12

编译器选项 /arch:AVX 不适用于旧 CPU,因此您需要确保您的 CPU 支持它。 当我不得不为不支持的旧 Xeon CPU 重新编译 1.12 张量流包时,我遇到了这个问题。

我已经打开了上面发布的 /arch:SSE2 (如 Kirill),但遇到了完全相同的问题。 Microsoft 编译器发出警告 (INFO),表明此选项将被忽略。

Command line warning D9002 : ignoring unknown option '/arch:SSE2'

根据 Microsoft 文档,我的理解是此选项仅在 x86 上可用,这对我来说也没有意义。

然而 MSDN 上说:

/arch:SSE and /arch:SSE2 are only available when you compile for the x86 platform.

并且 SSE 无论如何都在 x64 上使用。 因此我现在删除了该选项。

The compiler option /arch:AVX will not work on old CPUs hence you need to ensure your CPU supports it. I ran into this issues when I had to re-compile the 1.12 tensorflow package for my old Xeon CPU which does not support.

I have switched on /arch:SSE2 (as Kirill) posted above but getting exactly same issue. The Microsoft compiler issues a warning (INFO) that this option will be ignored.

Command line warning D9002 : ignoring unknown option '/arch:SSE2'

From the Microsoft documentation my understanding is that this option is only available on x86 and that does not make sense to me either.

However on MSDN says:

/arch:SSE and /arch:SSE2 are only available when you compile for the x86 platform.

and that SSE is used on x64 anyways. Hence I just removed the option now.

酷炫老祖宗 2024-08-02 01:27:12

我理解如果您选择 SSE2 会出现的警告,尽管它仍然很愚蠢。 但是,如果您选择 /arch:AVX,您仍然会收到警告。 我确信 SP1 会修复这个问题。 它只是有点垃圾邮件和烦恼。

I understand the warning appearing if you choose SSE2, althought its still silly. However you still get the warning if you select /arch:AVX. I'm sure it'll get fixed with SP1. Its just a bit spammy and an annoyance.

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