Xmmintrin.h vs gcc vector extensions

What method should be used to write SIMD instructions?

mm * form methods * mmintrin.h seem more portable to compilers.

But gcc vector extensions seem to create simple, simple code and support more architectures.

So which method is better?

+4
source share
2 answers

If you use gcc vector extensions, you can only use a limited subset of SSE functions, since there are many built-in SSE functions that do not fit into a common vector model such as gcc. If you only want to do fairly simple things, for example. with floating point arithmetic on vectors, then you can get away from it, but if you are interested in using SIMD for maximum performance, you will need to use your own built-in functions.

+4
source

The internal capabilities available from * mmintrin.h files are available only on SSE machines, but they are available for different compilers. GCC vector extensions are more limited, but implemented on a wider range of platforms and, obviously, are specific to GCC.

As with everything, there is no β€œbest” answer; You will need to choose the one that suits you.

+2
source

All Articles