Pre-defined C/C++ Compiler Macros

Index Standards Compilers Operating Systems Architecture

Hardware Architectures

Incomplete.
 
Name Macro Comment
Alpha
__alpha__ [__GNUC__]
__alpha [__DECCXX]
_M_ALPHA [_MSC_VER]
 
Intel x86
i386, __i386__ [__GNUC__]
i386, __i386 [__SUNPRO_C]
_M_IX86 [_MSC_VER]
_M_IX86 [__ICC]
_X86_ [__MINGW32__]
__THW_INTEL [_AIX]
Examples
 
CPU _M_IX86 value Macro
80386 300
80486 400
Pentium 500
Pentium Pro/II 600 _ARCH_PENTIUM2
Intel Itanium
__ia64__ [__GNUC__]
_IA64 [__GNUC__]
__IA64__ [__GNUC__]
_M_IA64 [__ICC]
Examples
 
CPU _M_IA64 value
64100
MIPS
__mips__ [__GNUC__]
__mips [__sgi]
__MIPS__ [__MWERKS__]
The value of the __mips macro indicates the MIPS ISA (Instruction Set Architecture) level. 

Examples
 
CPU __mips value Macro
R2000, R3000 1
R6000 2 __MIPS_ISA2__
R4400 3 __MIPS_ISA3__
R8000, R10000 4 __MIPS_ISA4__

PA RISC
__hppa__ [__GNUC__]
__hppa
Examples
 
CPU Macro
PA RISC 1.0 _PA_RISC1_0
PA RISC 1.1 _PA_RISC1_1
PA RISC 2.0 _PA_RISC2_0, __RISC2_0__
PowerPC
__powerpc [__GNUC__]
__powerpc__ [__GNUC__]
__POWERPC__ [__GNUC__]
__ppc__ [__GNUC__]
_M_PPC [_MSC_VER]
__PPC
__PPC__
Examples
 
CPU _M_PPC value Macro
PowerPC 601 601 __ppc601__
PowerPC 603 603 __ppc603__
PowerPC 604 604 __ppc604__
PowerPC 620 620
RS/6000
__THW_RS6000 [_AIX]
_IBMR2
_POWER [_AIX]
_ARCH_PWR [_AIX]
_ARCH_PWR2 [_AIX]
 
SPARC
__sparc__ [__GNUC__]
sparc, __sparc [__SUNPRO_C]
Examples
 
CPU Macro
SPARC v8 (SuperSPARC) __sparcv8
SPARC v9 (UltraSPARC) __sparcv9

$Id: prearch.html,v 1.1.1.1 2003/08/03 17:50:05 breese Exp $