From: Marco Costalba Date: Sat, 4 Jul 2009 08:07:45 +0000 (+0100) Subject: Disable POPCNT support per default X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=36437f14e8cbac4c6b883248cccc9e707e957c68;hp=36437f14e8cbac4c6b883248cccc9e707e957c68 Disable POPCNT support per default This is mainly intended to allow 64 bit compiles on any system and avoid to crash when the binary, compiled on a box where POPCNT is not supported, is run on a Core i7 system or similar CPU. What could happen is that when compiled in a standard 64 bit system, because the correct headers for the POPCNT intrinsic are not found, the compiler creates dummy bit count functions instead, these are never called at runtime on the machine where Stockfish has been compiled. But if we run the same binary on a Core i7 system, because POPCNT is detected at run time, the dummy bitcount functions will be called giving false results that will crash the application. Note that would be possible to fallback on software bit count in these cases, but this is even more subtle because POPCNT path is not optimized so that we have an application working but at sub-optimal speed, so better to crash, at least user is loudly warned that there is something wrong. If, instead, Stockfish is compiled on a Core i7 system with POPCNT enabled, then if the PGO compile has been done properly, the same binary will run at optimal speed _both_ on the Core i7 machine and on any other 64 bit standard machine. This is the ideal mode for binary distribution. Finally this patch disables bsfq support under Windows, because it seems inline assembly is not supported both by MSVC and by Intel Windows version. Signed-off-by: Marco Costalba ---