dangi12012 wrote: ↑Sun Oct 10, 2021 12:56 pm
maksimKorzh wrote: ↑Sun Oct 10, 2021 4:22 am
dangi12012 wrote: ↑Sun Oct 10, 2021 1:51 am
Sure we are almost there replace the instances of / redefine:
_blsr_u64(X) =>
(X & (X-1))
_tzcnt_u64(X) => __builtin_ctz(X)
_blsi_u64(X) => (X & -X)
Then we have it finished. No more intrinsics needed.
Performance? I cant tell - should still be very very fast. Weak Intel with lower clocks and without intrinsics.
My gut feeling tells me maybe 30% of a Zen3 thread performance.
Greetings - Daniel
Ok, this worked, actually only redefining __blsr_u64(X) and __blsi_u64(X) was enough, than it was compiling for... more than 5 minutes for sure (why so long???) and then finally I got a linker error which is obviously not related to the movegen but maybe you can tell me what's wrong:
Code: Select all
../../clang/bin/clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
/usr/bin/ld: /home/maksim/Downloads/clang/bin/../lib/LLVMgold.so: error loading plugin: /home/maksim/Downloads/clang/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
Gongrats now you have the currently most advanced C++ compiler installed on your machine. I think compilation is ok but now the error is during linktime. Cant you use ubuntu?
Anyways you also need llvm-12 as it seems:
Code: Select all
printf "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main" |sudo tee /etc/apt/sources.list.d/llvm-toolchain-xenial-12.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key |sudo apt-key add -
sudo apt update
sudo apt install llvm-12
Then we also want to add that -v to see what exactly might be missing.
clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -v -o giga_clang
re: most advanced C++ compiler:
- yeah, but all of my life I've been trying to simplify things (hence the chess programming channel btw) to make complicated topics easily accessible
by noobs like me) When I see code of your level I feel very stupid)) Like I didn't write 10+ engines before) And the word class coding style tends to
use world class instruments, e.g. compiler/linker/etc. And for me that is something I've been struggling all of my life and still do, haha))) The idea is
to avoid things that I'm not able to understand because what I don't understand (no matter if someone explains) doesn't make any sense. The only
reason behind the fact I didn't give up installing your movegen are the perft results I couldn't believe in... Curiosity won))) But for daily life/programming
- I would never consider this like sophisticated toolchain/code because my mission is to write code as simple as possible, build as simple as possible
and the recent projects were in high-level languages to simplify the access to the materials even more. I highly respect your work and I'm not sure if
I manage to understand it one day (apart anything else I hate C++ with it's modern nitty gritty enhancements with all of my heart))) - it just does
nothing but making me feel very stupid, haha))) ). BUT YOUR WORK IS WORTH TO GIVE UP MY PRINCIPLES FOR A WHILE! HATS OFF DANIEL!
EDIT: I hope your code would replace SF's movegen and brings chess engines to the new level!