mirror of
https://github.com/sockspls/badfish
synced 2025-05-02 01:29:36 +00:00
Cleanup code after dropping ICC support in favor of ICX
The commit removes all uses of ICC's __INTEL_COMPILER macro and other references to ICC. It also adds ICX info to the compiler command and fixes two typos in Makefile's help output. closes https://github.com/official-stockfish/Stockfish/pull/4769 No functional change
This commit is contained in:
parent
3d1b067d85
commit
b9319c4fa4
4 changed files with 25 additions and 31 deletions
|
@ -804,8 +804,8 @@ help:
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Supported compilers:"
|
@echo "Supported compilers:"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "gcc > Gnu compiler (default)"
|
@echo "gcc > GNU compiler (default)"
|
||||||
@echo "mingw > Gnu compiler with MinGW under Windows"
|
@echo "mingw > GNU compiler with MinGW under Windows"
|
||||||
@echo "clang > LLVM Clang compiler"
|
@echo "clang > LLVM Clang compiler"
|
||||||
@echo "icx > Intel oneAPI DPC++/C++ Compiler"
|
@echo "icx > Intel oneAPI DPC++/C++ Compiler"
|
||||||
@echo "ndk > Google NDK to cross-compile for Android"
|
@echo "ndk > Google NDK to cross-compile for Android"
|
||||||
|
|
|
@ -262,7 +262,7 @@ inline int popcount(Bitboard b) {
|
||||||
union { Bitboard bb; uint16_t u[4]; } v = { b };
|
union { Bitboard bb; uint16_t u[4]; } v = { b };
|
||||||
return PopCnt16[v.u[0]] + PopCnt16[v.u[1]] + PopCnt16[v.u[2]] + PopCnt16[v.u[3]];
|
return PopCnt16[v.u[0]] + PopCnt16[v.u[1]] + PopCnt16[v.u[2]] + PopCnt16[v.u[3]];
|
||||||
|
|
||||||
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
|
#elif defined(_MSC_VER)
|
||||||
|
|
||||||
return (int)_mm_popcnt_u64(b);
|
return (int)_mm_popcnt_u64(b);
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ inline int popcount(Bitboard b) {
|
||||||
|
|
||||||
/// lsb() and msb() return the least/most significant bit in a non-zero bitboard
|
/// lsb() and msb() return the least/most significant bit in a non-zero bitboard
|
||||||
|
|
||||||
#if defined(__GNUC__) // GCC, Clang, ICC
|
#if defined(__GNUC__) // GCC, Clang, ICX
|
||||||
|
|
||||||
inline Square lsb(Bitboard b) {
|
inline Square lsb(Bitboard b) {
|
||||||
assert(b);
|
assert(b);
|
||||||
|
|
25
src/misc.cpp
25
src/misc.cpp
|
@ -193,22 +193,21 @@ std::string compiler_info() {
|
||||||
|
|
||||||
/// Predefined macros hell:
|
/// Predefined macros hell:
|
||||||
///
|
///
|
||||||
/// __GNUC__ Compiler is gcc, Clang or Intel on Linux
|
/// __GNUC__ Compiler is GCC, Clang or ICX
|
||||||
/// __INTEL_COMPILER Compiler is Intel
|
/// __clang__ Compiler is Clang or ICX
|
||||||
/// _MSC_VER Compiler is MSVC or Intel on Windows
|
/// __INTEL_LLVM_COMPILER Compiler is ICX
|
||||||
|
/// _MSC_VER Compiler is MSVC
|
||||||
/// _WIN32 Building on Windows (any)
|
/// _WIN32 Building on Windows (any)
|
||||||
/// _WIN64 Building on Windows 64 bit
|
/// _WIN64 Building on Windows 64 bit
|
||||||
|
|
||||||
std::string compiler = "\nCompiled by ";
|
std::string compiler = "\nCompiled by ";
|
||||||
|
|
||||||
#ifdef __clang__
|
#if defined(__INTEL_LLVM_COMPILER)
|
||||||
|
compiler += "ICX ";
|
||||||
|
compiler += stringify(__INTEL_LLVM_COMPILER);
|
||||||
|
#elif defined(__clang__)
|
||||||
compiler += "clang++ ";
|
compiler += "clang++ ";
|
||||||
compiler += make_version_string(__clang_major__, __clang_minor__, __clang_patchlevel__);
|
compiler += make_version_string(__clang_major__, __clang_minor__, __clang_patchlevel__);
|
||||||
#elif __INTEL_COMPILER
|
|
||||||
compiler += "Intel compiler ";
|
|
||||||
compiler += "(version ";
|
|
||||||
compiler += stringify(__INTEL_COMPILER) " update " stringify(__INTEL_COMPILER_UPDATE);
|
|
||||||
compiler += ")";
|
|
||||||
#elif _MSC_VER
|
#elif _MSC_VER
|
||||||
compiler += "MSVC ";
|
compiler += "MSVC ";
|
||||||
compiler += "(version ";
|
compiler += "(version ";
|
||||||
|
@ -425,13 +424,7 @@ void prefetch(void*) {}
|
||||||
|
|
||||||
void prefetch(void* addr) {
|
void prefetch(void* addr) {
|
||||||
|
|
||||||
# if defined(__INTEL_COMPILER)
|
# if defined(_MSC_VER)
|
||||||
// This hack prevents prefetches from being optimized away by
|
|
||||||
// Intel compiler. Both MSVC and gcc seem not be affected by this.
|
|
||||||
__asm__ ("");
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined(__INTEL_COMPILER) || defined(_MSC_VER)
|
|
||||||
_mm_prefetch((char*)addr, _MM_HINT_T0);
|
_mm_prefetch((char*)addr, _MM_HINT_T0);
|
||||||
# else
|
# else
|
||||||
__builtin_prefetch(addr);
|
__builtin_prefetch(addr);
|
||||||
|
|
15
src/types.h
15
src/types.h
|
@ -48,9 +48,10 @@
|
||||||
|
|
||||||
/// Predefined macros hell:
|
/// Predefined macros hell:
|
||||||
///
|
///
|
||||||
/// __GNUC__ Compiler is gcc, Clang or Intel on Linux
|
/// __GNUC__ Compiler is GCC, Clang or ICX
|
||||||
/// __INTEL_COMPILER Compiler is Intel
|
/// __clang__ Compiler is Clang or ICX
|
||||||
/// _MSC_VER Compiler is MSVC or Intel on Windows
|
/// __INTEL_LLVM_COMPILER Compiler is ICX
|
||||||
|
/// _MSC_VER Compiler is MSVC
|
||||||
/// _WIN32 Building on Windows (any)
|
/// _WIN32 Building on Windows (any)
|
||||||
/// _WIN64 Building on Windows 64 bit
|
/// _WIN64 Building on Windows 64 bit
|
||||||
|
|
||||||
|
@ -65,12 +66,12 @@
|
||||||
# define IS_64BIT
|
# define IS_64BIT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
|
#if defined(USE_POPCNT) && defined(_MSC_VER)
|
||||||
# include <nmmintrin.h> // Intel and Microsoft header for _mm_popcnt_u64()
|
# include <nmmintrin.h> // Microsoft header for _mm_popcnt_u64()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
|
#if !defined(NO_PREFETCH) && defined(_MSC_VER)
|
||||||
# include <xmmintrin.h> // Intel and Microsoft header for _mm_prefetch()
|
# include <xmmintrin.h> // Microsoft header for _mm_prefetch()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_PEXT)
|
#if defined(USE_PEXT)
|
||||||
|
|
Loading…
Add table
Reference in a new issue