How do I enable the SSE/SSE2 instruction set in Visual Studio 2008 (using CMake)?

后端 未结 4 1162
庸人自扰
庸人自扰 2021-01-11 11:39

In Visual Studio 2005 I went in:

View --> Property Pages --> C/C++ --> Code Generation --> Enable Enhanced Instruction Set

But in Visual Studio 200

相关标签:
4条回答
  • 2021-01-11 12:00

    If you're looking for SSE/SSE2: Project > Properties > Configuration Properties > C/C++ > Code Generation > Enable Enhanced Instruction Set, or append /arch:SSE (or /arch:SSE2) in Command Line > Additional Options.

    You need to have a native project, and at least one .cpp file added to access this, though.

    0 讨论(0)
  • 2021-01-11 12:03

    If you are using inline assembler __asm { .... } you don't need to enable it.

    But if you enable SSE you have to be careful. It may be that the code is slower than normal FPU code.

    0 讨论(0)
  • 2021-01-11 12:05

    It is Project->Properties... (same path as above)

    0 讨论(0)
  • 2021-01-11 12:07

    Using CMake you could add the following to CMakeLists.txt:

    IF(MSVC)
       ADD_DEFINITIONS(/arch:SSE)
    ENDIF(MSVC)
    

    or /arch:SSE2.

    0 讨论(0)
提交回复
热议问题