primesieve icon indicating copy to clipboard operation
primesieve copied to clipboard

MSVC AVX512 status

Open kimwalisch opened this issue 1 year ago • 0 comments

The __AVX512F__, __AVX512CD__, __AVX512BW__, __AVX512DQ__ and __AVX512VL__ preprocessor symbols are defined when the /arch:AVX512 compiler option is specified.

According to the Microsoft MSVC website https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170 the support of AVX512 macros is not good. When using the /arch:AVX512 option MSVC seems to support all of AVX512 however it only defines a small selection of the AVX512 macros. Because of this it is currently not possible to detect using the preprocessor if MSVC properly supports AVX512.

If MSVC would also define the __AVX512VBMI__ and __AVX512VBMI2__ macros (which might happen in the next major MSVC release) then AVX512 for MSVC would be supported by primesieve without any code changes required.

kimwalisch avatar Apr 07 '24 13:04 kimwalisch