views:

99

answers:

1

I have to optimize a piece of code using SSE extensions. My target platforms are Windows and Linux, so I build my application using MS compiler (VStudio) and GCC compiler.

What approach does exist to involve SSE? I can find a lot of examples how to use SSE with GCC, but they seem to be incompatible to be used with MS compiler. Does exist a milti-platform SSE approach?

+3  A: 

You can use the same C intrinsics with both MSVC and gcc (and Intel ICC too, for that matter), e.g.

#include <emmintrin.h>

__m128i a, b, c;

c = _mm_add_epi16(a, b);
Paul R