GCC supports Intel Advanced Vector Extensions 512 instructions (AVX-512), including inline assembly support, extended existing and new registers, intrinsics set (covered by corresponding testsuite) and basic autovectorization. AVX-512 instructions are available via following GCC switches:

  • AVX-512 foundamental instructions -mavx512f
  • AVX-512 prefetch instructions -mavx512pf
  • AVX-512 exponential and reciprocal instructions -mavx512er
  • AVX-512 conflict detection instructions -mavx512cd

Since GCC-5.2 (GCC-4.9 introduces first patches) versions, you can compile source code with -mavx512f -mavx512er -mavx512cd -mavx512pf options.

For Gnu C compiler:

gcc -mavx512f -mavx512er -mavx512cd -mavx512pf -o executable code.c

For Gnu C++ compiler:

g++ -mavx512f -mavx512er -mavx512cd -mavx512pf -o executable code.cpp

For Gnul Fortran compiler:

gfortran -mavx512f -mavx512er -mavx512cd -mavx512pf -o executable code.f

-mavx512f and -mavx512cd are available on Intel Xeon and Intel Xeon Phi processors.

-mavx512er and -mavx512pf are only available on Intel Xeon Phi processors.