Architectures - natefoo/predef GitHub Wiki
Please submit updates/corrections via the process described on the wiki home page.
| Type |
Macro |
Description |
| Identification |
__alpha__ |
Defined by GNU C |
| Version |
__alpha_ev'V'__ |
V = Version |
| Identification |
__alpha |
Defined by DEC C |
| Identification |
_M_ALPHA |
Defined by Visual Studio |
Example
| CPU |
Macro |
| Alpha EV4 |
__alpha_ev4__ |
| Alpha EV5 |
__alpha_ev5__ |
| Alpha EV6 |
__alpha_ev6__ |
| Type |
Macro |
Description |
| Identification |
__amd64____amd64__x86_64____x86_64 |
Defined by GNU C and Sun Studio |
| Identification |
_M_X64_M_AMD64 |
Defined by Visual Studio |
Notice that x32 can be detected by checking if the CPU uses the ILP32 data model.
| Type |
Macro |
Description |
| Identification |
__arm__ |
Defined by GNU C and RealView |
| Identification |
__thumb__ |
Defined by GNU C and RealView in Thumb mode |
| Version |
__ARM_ARCH_'V'__ |
V = VersionDefined by GNU C 1 |
| Identification |
__TARGET_ARCH_ARM__TARGET_ARCH_THUMB |
Defined by RealView |
| Version |
__TARGET_ARCH_ARM = V__TARGET_ARCH_THUMB = V |
V = Version |
| Version |
__TARGET_ARCH_'VR' |
VR = Version and Revision |
| Identification |
_ARM |
Defined by ImageCraft C |
| Identification |
_M_ARM |
Defined by Visual Studio |
| Identification |
_M_ARMT |
Defined by Visual Studio in Thumb mode |
| Version |
_M_ARM = V |
V = Version |
| Identification |
__arm |
Defined by Diab |
Example
| CPU |
Macro |
_M_ARM |
| ARM 2 |
__ARM_ARCH_2__ |
|
| ARM 3 |
__ARM_ARCH_3____ARM_ARCH_3M__ |
|
| ARM 4T |
__ARM_ARCH_4T____TARGET_ARM_4T |
|
| ARM 5 |
__ARM_ARCH_5____ARM_ARCH_5E__ |
5 |
| ARM 5T |
__ARM_ARCH_5T____ARM_ARCH_5TE____ARM_ARCH_5TEJ__ |
|
| ARM 6 |
__ARM_ARCH_6____ARM_ARCH_6J____ARM_ARCH_6K____ARM_ARCH_6Z____ARM_ARCH_6ZK__ |
6 |
| ARM 6T2 |
__ARM_ARCH_6T2__ |
|
| ARM 7 |
__ARM_ARCH_7____ARM_ARCH_7A____ARM_ARCH_7R____ARM_ARCH_7M____ARM_ARCH_7S__ |
7 |
| Type |
Macro |
Description |
| Identification |
__aarch64__ |
Defined by GNU C 1 |
| Type |
Macro |
Description |
| Identification |
__bfin__BFIN__ |
Defined by GNU C |
| Type |
Macro |
Description |
| Identification |
__convex__ |
Defined by GNU C |
| Version |
__convex_'V'__ |
V = Version |
Example
| CPU |
Macro |
| Convex C1 |
__convex_c1__ |
| Convex C2 |
__convex_c2__ |
| Convex C32xx series |
__convex_c32__ |
| Convex C34xx series |
__convex_c34__ |
| Convex C38xx series |
__convex_c38__ |
| Type |
Macro |
| Identification |
__epiphany__ |
| Type |
Macro |
Description |
| Identification |
__hppa__ |
Defined by GNU C |
| Identification |
__HPPA__ |
Defined by Stratus VOS C |
| Identification |
__hppa |
|
| Version |
_PA_RISC'V'_'R' |
V = VersionR = Revision |
See also OpenPA.net.
Example
| CPU |
Macro |
| PA RISC 1.0 |
_PA_RISC1_0 |
| PA RISC 1.1 |
_PA_RISC1_1__HPPA11____PA7100__ |
| PA RISC 2.0 |
_PA_RISC2_0__RISC2_0____HPPA20____PA8000__ |
| Type |
Macro |
Format |
Description |
| Identification |
i386__i386__i386__ |
|
Defined by GNU C |
| Version |
__i386____i486____i586____i686__ |
|
Defined by GNU C |
| Identification |
__i386 |
|
Defined by Sun Studio |
| Identification |
__i386__IA32__ |
|
Defined by Stratus VOS C |
| Identification |
_M_I86 |
|
Only defined for 16-bits architecturesDefined by Visual Studio, Digital Mars, and Watcom C/C++ (see note below) |
| Identification |
_M_IX86 |
|
Only defined for 32-bits architecturesDefined by Visual Studio, Intel C/C++, Digital Mars, and Watcom C/C++ |
| Version |
_M_IX86 |
V00 |
V = Version |
| Identification |
__X86__ |
|
Defined by Watcom C/C++ |
| Identification |
_X86_ |
|
Defined by MinGW32 |
| Identification |
__THW_INTEL__ |
|
Defined by XL C/C++ |
| Identification |
__I86__ |
|
Defined by Digital Mars |
| Version |
__I86__ |
V |
V = Version |
| Identification |
__INTEL__ |
|
Defined by CodeWarrior |
| Identification |
__386 |
|
Defined by Diab |
Notice that Watcom C/C++ defines _M_IX86 for both 16-bits and 32-bits architectures. Use __386__ or _M_I386 to detect 32-bits architectures in this case.
Notice that the Stratus VOS is big-endian on IA32, so these macros cannot be used to detect endianness if __VOS__ is set.
Example
| CPU |
_M_IX86 |
__I86__ |
| 80386 |
300 |
3 |
| 80486 |
400 |
4 |
| Pentium |
500 |
5 |
| Pentium Pro/II |
600 |
6 |
| Type |
Macro |
Format |
Description |
| Identification |
__ia64___IA64__IA64__ |
|
Defined by GNU C |
| Identification |
__ia64 |
|
Defined by HP aCC |
| Identification |
_M_IA64 |
|
Defined by Visual Studio |
| Identification |
_M_IA64 |
|
Defined by Intel C/C++ |
| Version |
_M_IA64 |
? |
|
| Identification |
__itanium__ |
|
Defined by Intel C/C++ |
Example
| CPU |
_M_IA64 (Intel C/C++) |
|
64100 |
| Type |
Macro |
Description |
| Identification |
__m68k__ |
Defined by GNU C |
| Version |
__mc'V'____mc'V'mc'V' |
V = Version |
| Identification |
M68000 |
Defined by SAS/C |
| Identification |
__MC68K__ |
Defined by Stratus VOS C |
| Version |
__MC'V'__ |
V = Version |
Example
| CPU |
Macro |
| 68000 |
__mc68000____MC68000__ |
| 68010 |
__mc68010__ |
| 68020 |
__mc68020____MC68020__ |
| 68030 |
__mc68030____MC68030__ |
| 68040 |
__mc68040__ |
| 68060 |
__mc68060__ |
| Type |
Macro |
Description |
| Identification |
__mips__mips |
Defined by GNU C |
| Version |
_MIPS_ISA = _MIPS_ISA_MIPS'V' |
V = MIPS ISA level |
| Version |
_R3000_R4000_R5900 |
|
| Identification |
__mips |
Defined by MIPSpro and GNU C |
| Version |
__mips |
The value indicates the MIPS ISA (Instruction Set Architecture) level |
| Version |
__MIPS_ISA'V'__ |
V = MIPS ISA level |
| Identification |
__MIPS__ |
Defined by Metrowerks |
Example
| CPU |
_MIPS_ISA |
GNU C Macro |
__mips |
MIPSpro Macro |
| R2000 |
_MIPS_ISA_MIPS1 |
|
1 |
|
| R3000 |
_MIPS_ISA_MIPS1 |
_R3000 |
1 |
|
| R6000 |
_MIPS_ISA_MIPS2 |
|
2 |
__MIPS_ISA2__ |
| R4000 |
|
_R4000 |
|
|
| R4400 |
_MIPS_ISA_MIPS3 |
|
3 |
__MIPS_ISA3__ |
| R8000 |
_MIPS_ISA_MIPS4 |
|
4 |
__MIPS_ISA4__ |
| R10000 |
_MIPS_ISA_MIPS4 |
|
4 |
__MIPS_ISA4__ |
| Type |
Macro |
Description |
| Identification |
__powerpc__powerpc____powerpc64____POWERPC____ppc____ppc64____PPC____PPC64___ARCH_PPC_ARCH_PPC64 |
Defined by GNU C |
| Version |
__ppc'V'__ |
V = Version |
| Identification |
_M_PPC |
Defined by Visual Studio |
| Version |
_M_PPC |
? |
| Identification |
_ARCH_PPC_ARCH_PPC64 |
Defined by XL C/C++ |
| Version |
_ARCH_'V' |
V = Version |
| Version |
__PPCGECKO__ |
GekkoDefined by CodeWarrior |
| Version |
__PPCBROADWAY__ |
BroadwayDefined by CodeWarrior |
| Version |
_XENON |
Xenon |
| Identification |
__ppc |
Defined by Diab |
Example
| CPU |
_M_PPC |
Macro |
XL Macro |
| PowerPC 440 |
|
|
_ARCH_440 |
| PowerPC 450 |
|
|
_ARCH_450 |
| PowerPC 601 |
601 |
__ppc601__ |
_ARCH_601 |
| PowerPC 603 |
603 |
__ppc603__ |
_ARCH_603 |
| PowerPC 604 |
604 |
__ppc604__ |
_ARCH_604 |
| PowerPC 620 |
620 |
|
|
Pyramid 9810
| Type |
Macro |
| Identification |
pyr |
| Type |
Macro |
Description |
| Identification |
__THW_RS6000 |
Defined by XL C/C++ |
| Identification |
_IBMR2 |
|
| Identification |
_POWER |
|
| Identification |
_ARCH_PWR_ARCH_PWR2_ARCH_PWR3_ARCH_PWR4 |
|
| Type |
Macro |
Description |
| Identification |
__sparc__ |
Defined by GNU C |
| Identification |
__sparc |
Defined by Sun Studio |
| Version |
__sparc_v8____sparc_v9__ |
Defined by GNU C |
| Version |
__sparcv8__sparcv9 |
Defined by Sun Studio |
Example
| CPU |
Sun Studio Macro |
GNU C Macro |
| SPARC v8 (SuperSPARC) |
__sparcv8 |
__sparc_v8__ |
| SPARC v9 (UltraSPARC) |
__sparcv9 |
__sparc_v9__ |
| Type |
Macro |
Description |
| Identification |
__sh__ |
Defined by GNU C |
| Version |
__sh1____sh2____sh3____SH3____SH4____SH5__ |
|
| Type |
Macro |
Description |
| Identification |
__370____THW_370__ |
Identifies System/370Defined by XL C/C++ |
| Identification |
__s390__ |
Identifies System/390Defined by GNU C |
| Identification |
__s390x__ |
Identifies z/ArchitectureDefined by GNU C |
| Identification |
__zarch__ |
Identifies z/ArchitectureDefined by clang |
| Identification |
__SYSC_ZARCH__ |
Identifies z/ArchitectureDefined by Systems/C |
| Type |
Macro |
Description |
| Identification |
_TMS320C2XX__TMS320C2000__ |
C2000 series |
| Identification |
_TMS320C5X__TMS320C55X__ |
C5000 series |
| Identification |
_TMS320C6X__TMS320C6X__ |
C6000 series |
Example
| DSP |
Macro |
| C28xx |
_TMS320C28X |
| C54x |
_TMS320C5XX |
| C55x |
__TMS320C55X__ |
| C6200 |
_TMS320C6200 |
| C6400 |
_TMS320C6400 |
| C6400+ |
_TMS320C6400_PLUS |
| C6600 |
_TMS320C6600 |
| C6700 |
_TMS320C6700 |
| C6700+ |
_TMS320C6700_PLUS |
| C6740 |
_TMS320C6740 |
TMS470
| Type |
Macro |
| Identification |
__TMS470__ |