Skip to content

Commit b9319c4

Browse files
UniQPDisservin
authored andcommitted
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 #4769 No functional change
1 parent 3d1b067 commit b9319c4

File tree

4 files changed

+25
-31
lines changed

4 files changed

+25
-31
lines changed

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,8 +804,8 @@ help:
804804
@echo ""
805805
@echo "Supported compilers:"
806806
@echo ""
807-
@echo "gcc > Gnu compiler (default)"
808-
@echo "mingw > Gnu compiler with MinGW under Windows"
807+
@echo "gcc > GNU compiler (default)"
808+
@echo "mingw > GNU compiler with MinGW under Windows"
809809
@echo "clang > LLVM Clang compiler"
810810
@echo "icx > Intel oneAPI DPC++/C++ Compiler"
811811
@echo "ndk > Google NDK to cross-compile for Android"

src/bitboard.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ inline int popcount(Bitboard b) {
262262
union { Bitboard bb; uint16_t u[4]; } v = { b };
263263
return PopCnt16[v.u[0]] + PopCnt16[v.u[1]] + PopCnt16[v.u[2]] + PopCnt16[v.u[3]];
264264

265-
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
265+
#elif defined(_MSC_VER)
266266

267267
return (int)_mm_popcnt_u64(b);
268268

@@ -276,7 +276,7 @@ inline int popcount(Bitboard b) {
276276

277277
/// lsb() and msb() return the least/most significant bit in a non-zero bitboard
278278

279-
#if defined(__GNUC__) // GCC, Clang, ICC
279+
#if defined(__GNUC__) // GCC, Clang, ICX
280280

281281
inline Square lsb(Bitboard b) {
282282
assert(b);

src/misc.cpp

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,21 @@ std::string compiler_info() {
193193

194194
/// Predefined macros hell:
195195
///
196-
/// __GNUC__ Compiler is gcc, Clang or Intel on Linux
197-
/// __INTEL_COMPILER Compiler is Intel
198-
/// _MSC_VER Compiler is MSVC or Intel on Windows
199-
/// _WIN32 Building on Windows (any)
200-
/// _WIN64 Building on Windows 64 bit
196+
/// __GNUC__ Compiler is GCC, Clang or ICX
197+
/// __clang__ Compiler is Clang or ICX
198+
/// __INTEL_LLVM_COMPILER Compiler is ICX
199+
/// _MSC_VER Compiler is MSVC
200+
/// _WIN32 Building on Windows (any)
201+
/// _WIN64 Building on Windows 64 bit
201202

202203
std::string compiler = "\nCompiled by ";
203204

204-
#ifdef __clang__
205+
#if defined(__INTEL_LLVM_COMPILER)
206+
compiler += "ICX ";
207+
compiler += stringify(__INTEL_LLVM_COMPILER);
208+
#elif defined(__clang__)
205209
compiler += "clang++ ";
206210
compiler += make_version_string(__clang_major__, __clang_minor__, __clang_patchlevel__);
207-
#elif __INTEL_COMPILER
208-
compiler += "Intel compiler ";
209-
compiler += "(version ";
210-
compiler += stringify(__INTEL_COMPILER) " update " stringify(__INTEL_COMPILER_UPDATE);
211-
compiler += ")";
212211
#elif _MSC_VER
213212
compiler += "MSVC ";
214213
compiler += "(version ";
@@ -425,13 +424,7 @@ void prefetch(void*) {}
425424

426425
void prefetch(void* addr) {
427426

428-
# if defined(__INTEL_COMPILER)
429-
// This hack prevents prefetches from being optimized away by
430-
// Intel compiler. Both MSVC and gcc seem not be affected by this.
431-
__asm__ ("");
432-
# endif
433-
434-
# if defined(__INTEL_COMPILER) || defined(_MSC_VER)
427+
# if defined(_MSC_VER)
435428
_mm_prefetch((char*)addr, _MM_HINT_T0);
436429
# else
437430
__builtin_prefetch(addr);

src/types.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@
4848

4949
/// Predefined macros hell:
5050
///
51-
/// __GNUC__ Compiler is gcc, Clang or Intel on Linux
52-
/// __INTEL_COMPILER Compiler is Intel
53-
/// _MSC_VER Compiler is MSVC or Intel on Windows
54-
/// _WIN32 Building on Windows (any)
55-
/// _WIN64 Building on Windows 64 bit
51+
/// __GNUC__ Compiler is GCC, Clang or ICX
52+
/// __clang__ Compiler is Clang or ICX
53+
/// __INTEL_LLVM_COMPILER Compiler is ICX
54+
/// _MSC_VER Compiler is MSVC
55+
/// _WIN32 Building on Windows (any)
56+
/// _WIN64 Building on Windows 64 bit
5657

5758
#if defined(__GNUC__ ) && (__GNUC__ < 9 || (__GNUC__ == 9 && __GNUC_MINOR__ <= 2)) && defined(_WIN32) && !defined(__clang__)
5859
#define ALIGNAS_ON_STACK_VARIABLES_BROKEN
@@ -65,12 +66,12 @@
6566
# define IS_64BIT
6667
#endif
6768

68-
#if defined(USE_POPCNT) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
69-
# include <nmmintrin.h> // Intel and Microsoft header for _mm_popcnt_u64()
69+
#if defined(USE_POPCNT) && defined(_MSC_VER)
70+
# include <nmmintrin.h> // Microsoft header for _mm_popcnt_u64()
7071
#endif
7172

72-
#if !defined(NO_PREFETCH) && (defined(__INTEL_COMPILER) || defined(_MSC_VER))
73-
# include <xmmintrin.h> // Intel and Microsoft header for _mm_prefetch()
73+
#if !defined(NO_PREFETCH) && defined(_MSC_VER)
74+
# include <xmmintrin.h> // Microsoft header for _mm_prefetch()
7475
#endif
7576

7677
#if defined(USE_PEXT)

0 commit comments

Comments
 (0)