Prefer #if defined to #ifdef
[ghc.git] / includes / stg / HaskellMachRegs.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2011
4 *
5 * Registers used in STG code. Might or might not correspond to
6 * actual machine registers.
7 *
8 * Do not #include this file directly: #include "Rts.h" instead.
9 *
10 * To understand the structure of the RTS headers, see the wiki:
11 * http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
12 *
13 * ---------------------------------------------------------------------------*/
14
15 #pragma once
16
17 /*
18 * Defining NO_REGS causes no global registers to be used. NO_REGS is
19 * typically defined by GHC, via a command-line option passed to gcc,
20 * when the -funregisterised flag is given.
21 *
22 * NB. When NO_REGS is on, calling & return conventions may be
23 * different. For example, all function arguments will be passed on
24 * the stack, and components of an unboxed tuple will be returned on
25 * the stack rather than in registers.
26 */
27 #if defined(NO_REGS)
28
29 #define MACHREGS_NO_REGS 1
30
31 #else
32
33 #define MACHREGS_NO_REGS 0
34
35 #if defined(i386_TARGET_ARCH)
36 #define MACHREGS_i386 1
37 #endif
38
39 #if defined(x86_64_TARGET_ARCH)
40 #define MACHREGS_x86_64 1
41 #endif
42
43 #if defined(powerpc_TARGET_ARCH) || defined(powerpc64_TARGET_ARCH) \
44 || defined(powerpc64le_TARGET_ARCH) || defined(rs6000_TARGET_ARCH)
45 #define MACHREGS_powerpc 1
46 #endif
47
48 #if defined(sparc_TARGET_ARCH)
49 #define MACHREGS_sparc 1
50 #endif
51
52 #if defined(arm_TARGET_ARCH)
53 #define MACHREGS_arm 1
54 #endif
55
56 #if defined(aarch64_TARGET_ARCH)
57 #define MACHREGS_aarch64 1
58 #endif
59
60 #if defined(darwin_TARGET_OS)
61 #define MACHREGS_darwin 1
62 #endif
63
64 #endif
65
66 #include "MachRegs.h"