views:

1019

answers:

4

In Visual Studio 2005 I went in:

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

But in Visual Studio 2008?

Thanks in advance

+1  A: 

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

Naveen
Thanks for your reply.I tried but in Project --> Properties I have:- Common Properties + Startup Project + Project Dependencies + Debug Source Files- Configuration Properties + ConfigurationI don't find any option for the instruction set.
Angelo
+2  A: 

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.

PiotrLegnica
Thank you so much! It's not a native project, but I create it with CMake.
Angelo
If you regenerate the project files using CMake the settings will not be stored when using this approach. See my answer for details on a permanent fix...
larsm
A: 

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 ist slower than normal fpu code.

greets, Andre

+2  A: 

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

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

or /arc:SSE2.

larsm