c++ SSE SIMD framework

user283145 picture user283145 · Feb 10, 2011 · Viewed 14.5k times · Source

Does anyone know an open-source C++ x86 SIMD intrinsics library?

Intel supplies exactly what I need in their integrated performance primitives library, but I can't use that because of the copyrights all over the place.

EDIT

I already know the intrinsics provided by the compilers. What I need is a convenient interface to use them.

Answer

user12 picture user12 · May 11, 2013

Take a look at libsimdpp header-only C++ SIMD wrapper library.

The library supports several instruction sets via single interface: SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, XOP, FMA3/4, NEON, NEONv2, Altivec. All of Clang, GCC, MSVC and ICC are suported.

Any differences between instruction sets are resolved by implementing the missing instructions as a combination of supported ones. As a bonus, it's possible to compile the same code for several instruction sets, link the resulting object files to a single executable and use a convenient dynamic dispatch mechanism to run the implementation most tailored to the current processor.