Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
17 Views

Unable to use SSE intrinsics in some files

Hi,

I'm having troubles using SSE intrinsics in my project although everything is included.
I'm doing something like this :
[cpp]#include "stdlib.h"
#include "emmintrin.h"

void Foo::Bar()
{
 	const __m128 rmul1 = _mm_set_ps1(.393f);
}[/cpp]
but it generates this error :
[bash]1>Foo.cpp
1>.\Foo.cpp(41): error: identifier "__m128" is undefined
1>   	const __m128 rmul1 = _mm_set_ps1(.393f);[/bash]
the funny part is, in other parts of my project I can use whatever intrinsic I need by including the same headers and it all works fine...

I'm using Visual Studio 2008 in combination with the Intel Compiler (no clue what version, the one that came with Parallel Composer 2011 ) .
I'm sure that I enabled the /arch:SSE2 compiler flag.

I actually want to include but that generates (only by including) over 100 errors, all more or less the same than the one above.

any help with this ?

cheers
0 Kudos
1 Reply
Highlighted
17 Views

Add "Preprocess to a file (/P)" to your compilation settings and compile to generate a .i file. This should contain #line comments to tell you what headers code is coming from. Do that with a known good file and see where __m128 is defined when you include emmintrin.h, then do it with a file with the error and see where it's missing the define. That should give you a clue about what's wrong.
0 Kudos