Which header files provide the intrinsics for the different x86 SIMD instruction set extensions (MMX, SSE, AVX, …)? It seems impossible to find such a list online. Correct me if I’m wrong.
Which header files provide the intrinsics for the different x86 SIMD instruction set extensions
Share
These days you should normally just include
<immintrin.h>. It includes everything.GCC and clang will stop you from using intrinsics for instructions you haven’t enabled at compile time (e.g. with
-march=nativeor-mavx2 -mbmi2 -mpopcnt -mfma -mcx16 -mtune=znver1or whatever.)MSVC and ICC will let you use intrinsics without enabling anything at compile time, but you still should enable AVX before using AVX intrinsics.
Historically (before
immintrin.hpulled in everything) you had to manually include a header for the highest level of intrinsics you wanted.This may still be useful with MSVC and ICC to stop yourself from using instruction-sets you don’t want to require.
Including one of these pulls in all previous ones (except AMD-only SSE4A:
immintrin.hdoesn’t pull that in)Some compilers also have
<zmmintrin.h>for AVX512.