Current state of compiler differences STOCKFISH

Discussion of chess software programming and technical issues.

Moderator: Ras

dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Current state of compiler differences STOCKFISH

Post by dangi12012 »

Fulvio wrote: Tue Dec 07, 2021 8:22 am
dangi12012 wrote: Tue Dec 07, 2021 2:23 am BMI2+EVX2 is enabled via settings in the vcxproj.
Share with us if you have some news :)
I get a ~25% slower executable using that vcxproj
What you mean? cl.exe is 25% slower than using vcxproj - or cl.exe is 25% slower than clang?
Also ENABLING PEXT on a ryzen 1000 or ryzen 2000 would be bad.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Current state of compiler differences STOCKFISH

Post by dangi12012 »

AndrewGrant wrote: Tue Dec 07, 2021 10:07 am
Fulvio wrote: Tue Dec 07, 2021 8:22 am
dangi12012 wrote: Tue Dec 07, 2021 2:23 am BMI2+EVX2 is enabled via settings in the vcxproj.
Share with us if you have some news :)
I get a ~25% slower executable using that vcxproj
You happen to have a Ryzen by chance? PEXT could produce that level of slowdown. I notice your original compilation does not include BMI2.
I can test that. I happen to have a Zen3. When someone has Zen2 we can compare.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Fulvio
Posts: 395
Joined: Fri Aug 12, 2016 8:43 pm

Re: Current state of compiler differences STOCKFISH

Post by Fulvio »

AndrewGrant wrote: Tue Dec 07, 2021 10:07 am You happen to have a Ryzen by chance? PEXT could produce that level of slowdown. I notice your original compilation does not include BMI2.
Yes, thanks, I have a Ryzen 3600.
Removing USE_PEXT I get an executable that's just 2% slower compared to when compiled directly from the command line (8% slower than the PGO's one, which is at the moment the fastest I can get with msvc)
tcusr
Posts: 325
Joined: Tue Aug 31, 2021 10:32 pm
Full name: Mateo

Re: Current state of compiler differences STOCKFISH

Post by tcusr »

Fulvio wrote: Mon Dec 06, 2021 9:48 pm I use this to compile the Stockfish-AVX2 with msvc:

Code: Select all

 cl /std:c++17 /DNDEBUG /DUSE_POPCNT /DUSE_AVX2 /DUSE_SSE41 /DUSE_SSSE3 /DUSE_SSE2  /GS- /MT /O2 /Oi /Ot /Oy /GL /EHsc *.cpp nnue/*.cpp nnue/features/*.cpp syzygy/*.cpp /link /LTCG /STACK:reserve=8388608 /OUT:stockfish.exe advapi32.lib
Anyone have something better?
i just run 'make build' which uses these flags

Code: Select all

-Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Current state of compiler differences STOCKFISH

Post by dangi12012 »

tcusr wrote: Tue Dec 07, 2021 7:01 pm
Fulvio wrote: Mon Dec 06, 2021 9:48 pm I use this to compile the Stockfish-AVX2 with msvc:

Code: Select all

 cl /std:c++17 /DNDEBUG /DUSE_POPCNT /DUSE_AVX2 /DUSE_SSE41 /DUSE_SSSE3 /DUSE_SSE2  /GS- /MT /O2 /Oi /Ot /Oy /GL /EHsc *.cpp nnue/*.cpp nnue/features/*.cpp syzygy/*.cpp /link /LTCG /STACK:reserve=8388608 /OUT:stockfish.exe advapi32.lib
Anyone have something better?
i just run 'make build' which uses these flags

Code: Select all

-Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto
Yes we all know how to compile with make gcc/clang/mingw. It was about a comparison to MSVC.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
tcusr
Posts: 325
Joined: Tue Aug 31, 2021 10:32 pm
Full name: Mateo

Re: Current state of compiler differences STOCKFISH

Post by tcusr »

dangi12012 wrote: Tue Dec 07, 2021 7:35 pm
tcusr wrote: Tue Dec 07, 2021 7:01 pm
Fulvio wrote: Mon Dec 06, 2021 9:48 pm I use this to compile the Stockfish-AVX2 with msvc:

Code: Select all

 cl /std:c++17 /DNDEBUG /DUSE_POPCNT /DUSE_AVX2 /DUSE_SSE41 /DUSE_SSSE3 /DUSE_SSE2  /GS- /MT /O2 /Oi /Ot /Oy /GL /EHsc *.cpp nnue/*.cpp nnue/features/*.cpp syzygy/*.cpp /link /LTCG /STACK:reserve=8388608 /OUT:stockfish.exe advapi32.lib
Anyone have something better?
i just run 'make build' which uses these flags

Code: Select all

-Wall -Wcast-qual -fno-exceptions -std=c++17  -pedantic -Wextra -Wshadow -m64 -DUSE_PTHREADS -DNDEBUG -O3 -DIS_64BIT -msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2 -flto
Yes we all know how to compile with make gcc/clang/mingw. It was about a comparison to MSVC.
sorry i didn't know, i have never programmed on windows