Developer Guide and Reference

Contents

Additional Predefined Macros

The compiler supports the predefined macros listed in the table below. The compiler also includes predefined macros specified by the ISO/ANSI standard.
Unless otherwise stated, the macros are supported on systems based on
IA-32 and
Intel® 64 architectures.
IA-32 is not available on macOS*.
The Intel® C++ Compiler defines the same target-architecture macros that GCC does. For
-m 
feature
, GCC defines
__
FEATURE
__
.
You can target specific processor architectures by using the
-x
,
-m
, and
-march
compiler options. Each of these options enables feature-specific macros in the compiler. These macros are used to guard a section of application code that uses target-specific feature. The following command emits the list of predefined macros enabled by targeting a specific processor architecture:
icpc -dM -E helloworld.cc -x
arch
For example, you could do the following to determine which feature macros would help identify whether this is ICELAKE-SERVER:
icpc -dM -E helloworld.cc -xSKYLAKE-AVX512 > avx512.txt 2>&1 icpc -dM -E helloworld.cc -xICELAKE-SERVER > icelake.txt 2>&1 diff avx512.txt icelake.txt 317a318 > #define AVX512IFMA 1 320a322,329 > #define AVX512VBMI 1 > #define AVX512VPOPCNTDQ 1 > #define AVX512BITALG 1 > #define AVX512VBMI2 1 > #define GFNI 1 > #define VAES 1 > #define VPCLMUL 1 > #define AVX512VNNI 1 321a331,334 > #define RDPID 1 > #define SGX 1 > #define WBNOINVD 1 > #define PCONFIG 1
The result of the
diff
command is the list of feature macros that can be used to differentiate
icelake-server
from
skylake-avx512
.
Macro
Description
__APPLE__
(
macOS*
)
Defined as '1'.
__APPLE_CC__
(
macOS*
)
The gcc* build number
__ARRAY_OPERATORS