Can you set Visual Studio 2017 CPU target for old CPU?

人盡茶涼 提交于 2021-01-29 14:18:22

问题


Is there a way to setup Visual Studio 2017 to support older CPU? Say one that doesn't have SSE2?

Thanks.


回答1:


You can select what CPU extensions to use (or not to use any) in the project's settings. The following works in VS2019 but, IIRC, it's very similar for VS2017.

In the solution explorer, right-click on the project and select "Properties" from the pop-up menu. Open the C/C++ tree list and select the Code Generation page. Then, in the "Enable Enhanced Instruction Set" select the "No Enhanced Instructions" option (or "Not Set," if that isn't available), as below:

The "No Enhanced Instructions" option will instruct the compiler to use only the 'basic' Intel-x86 instruction set (which should work for a Pentium CPU).

The equivalent command-line option is /arch:IA32, which, as per M/S Documentation:

Specifies no enhanced instructions and also specifies x87 for floating-point calculations.

In older versions of MSVC, there was an option to include code guards against the "Pentium FDIV Bug," (/QIfdiv) but it appears that has now been removed.



来源:https://stackoverflow.com/questions/59864779/can-you-set-visual-studio-2017-cpu-target-for-old-cpu

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