pinterf/FluxSmooth

why I can't build the x86 verion via MSVC?

Opened this issue · 5 comments

x64 build works fine but x86 build not work. (both MSVC 142&141_xp)

I tried /arch:AVX512 it won't work.

PS: LLVM x86 build works fine.

Option /arch:AVX512 is only specified directly at the relevant source files.
What does 'not work' mean? Won't compile or the DLL just crashes or ?

with your default settings. It will act like this.

1>FluxSmooth_avx512.cpp
1>D:\Source code\AviSynth\FluxSmooth\FluxSmooth\FluxSmooth_avx512.cpp(10): fatal error C1189: #error: This source file will only work properly when compiled with AVX512F and AVX512BW option. Set /arch=AVX512 to command line options for this file.

For some reason, AVX512BW was defined for me for MSVC builds but not for you.
But I'm not sure MS defines it always, not a well documented part.

Anyway I'm checking now only for BW option for MSVC

All I found is:

c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64\cl.exe
c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x86\cl.exe
c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x64\cl.exe
c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x86\cl.exe

Just looking at the hexdump (very scientific), the second and fourth ones (x86/cl.exe) define
-D__AVX__,-D__AVX2__,-D__AVX512CD__,-D__AVX512BW__,-D__AVX512DQ__,-D__AVX512VL__
while the x64/cl.exe ones has
-D__AVX__,-D__AVX2__,-D__AVX512F__,-D__AVX512CD__,-D__AVX512BW__,-D__AVX512DQ__,-D__AVX512VL__

For some reason, AVX512BW was defined for me for MSVC builds but not for you.
But I'm not sure MS defines it always, not a well documented part.

Anyway I'm checking now only for BW option for MSVC

All I found is:

c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64\cl.exe
c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x86\cl.exe
c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x64\cl.exe
c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x86\cl.exe

Just looking at the hexdump (very scientific), the second and fourth ones (x86/cl.exe) define
-D__AVX__,-D__AVX2__,-D__AVX512CD__,-D__AVX512BW__,-D__AVX512DQ__,-D__AVX512VL__
while the x64/cl.exe ones has
-D__AVX__,-D__AVX2__,-D__AVX512F__,-D__AVX512CD__,-D__AVX512BW__,-D__AVX512DQ__,-D__AVX512VL__

So, the x86 cl.exe doesn't support AVX512F instructions?

It should. It's the basic set, the "Foundation". Anyway the compiler is not hectic about that like gcc or clang, when I'm issuing an advanced AVX512 intrinsics, it puts there as-is.