psihodelia
psihodelia

Reputation: 30502

How to use SSE with both Windows compiler and GCC compiler?

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?

Upvotes: 2

Views: 576

Answers (1)

Paul R
Paul R

Reputation: 213059

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);

Upvotes: 6

Related Questions