3e4d8c143ccab68d93c8ee586839a1a58696c88b
[ghc-hetmet.git] / ghc / compiler / nativeGen / NCG.h
1 #define COMMA ,
2
3 #ifndef NCG_H
4 #define NCG_H
5 #if 0
6  COMPILING_NCG is used to control the visibility of 
7  relevant information from the GHC header files when
8  compiling the native code generator modules.
9 #endif
10
11 #ifndef COMPILING_NCG
12 #define COMPILING_NCG
13 #endif
14
15 #if 0
16
17 IMPORTANT!  If you put extra tabs/spaces in these macro definitions,
18 you will screw up the layout where they are used in case expressions!
19
20 (This is cpp-dependent, of course)
21
22 ** Convenience macros for writing the native-code generator **
23
24 #endif
25
26 #define FAST_REG_NO FAST_INT
27
28 #include "../../includes/config.h"
29
30 #if 0
31 {-testing only-}
32 #undef sparc_TARGET_ARCH
33 #undef sunos4_TARGET_OS
34 #undef i386_TARGET_ARCH
35 #define i386_TARGET_ARCH 1
36 #undef linuxaout_TARGET_OS
37 #define linuxaout_TARGET_OS 1
38 #endif
39 #if 0
40 {-testing only-}
41 #undef sparc_TARGET_ARCH
42 #undef sunos4_TARGET_OS
43 #undef alpha_TARGET_ARCH
44 #define alpha_TARGET_ARCH 1
45 #endif
46
47 #if i386_TARGET_ARCH
48 # define STOLEN_X86_REGS 4
49 -- HACK: go for the max
50 #endif
51
52 #include "../../includes/MachRegs.h"
53
54 #if alpha_TARGET_ARCH
55 # define BYTES_PER_WORD 8
56 # define BYTES_PER_WORD_STR "8"
57
58 # include "../../includes/alpha-dec-osf1.h"
59 #endif
60
61 #if i386_TARGET_ARCH
62 # define BYTES_PER_WORD 4
63 # define BYTES_PER_WORD_STR "4"
64
65 # if linuxaout_TARGET_OS
66 #  include "../../includes/i386-unknown-linuxaout.h"
67 # endif
68 # if linux_TARGET_OS
69 #  include "../../includes/i386-unknown-linux.h"
70 # endif
71 # if freebsd_TARGET_OS
72 #  include "../../includes/i386-unknown-freebsd.h"
73 # endif
74 # if netbsd_TARGET_OS
75 #  include "../../includes/i386-unknown-netbsd.h"
76 # endif
77 # if bsdi_TARGET_OS
78 #  include "../../includes/i386-unknown-bsdi.h"
79 # endif
80 # if cygwin32_TARGET_OS
81 #  include "../../includes/i386-unknown-cygwin32.h"
82 # endif
83 # if solaris2_TARGET_OS
84 #  include "../../includes/i386-unknown-solaris2.h"
85 # endif
86 #endif
87
88 #if sparc_TARGET_ARCH
89 # define BYTES_PER_WORD 4
90 # define BYTES_PER_WORD_STR "4"
91
92 # if sunos4_TARGET_OS
93 #  include "../../includes/sparc-sun-sunos4.h"
94 # endif
95 # if solaris2_TARGET_OS
96 #  include "../../includes/sparc-sun-solaris2.h"
97 # endif
98 #endif
99
100 ---------------------------------------------
101
102 #if alpha_TARGET_ARCH
103 # define IF_ARCH_alpha(x,y) x
104 #else
105 # define IF_ARCH_alpha(x,y) y
106 #endif
107
108 ---------------------------------------------
109
110 #if i386_TARGET_ARCH
111 # define IF_ARCH_i386(x,y) x
112 #else
113 # define IF_ARCH_i386(x,y) y
114 #endif
115 -- - - - - - - - - - - - - - - - - - - - - - 
116 #if freebsd_TARGET_OS
117 # define IF_OS_freebsd(x,y) x
118 #else
119 # define IF_OS_freebsd(x,y) y
120 #endif
121 -- - - - - - - - - - - - - - - - - - - - - - 
122 #if netbsd_TARGET_OS
123 # define IF_OS_netbsd(x,y) x
124 #else
125 # define IF_OS_netbsd(x,y) y
126 #endif
127 -- - - - - - - - - - - - - - - - - - - - - - 
128 #if linux_TARGET_OS
129 # define IF_OS_linux(x,y) x
130 #else
131 # define IF_OS_linux(x,y) y
132 #endif
133 -- - - - - - - - - - - - - - - - - - - - - - 
134 #if linuxaout_TARGET_OS
135 # define IF_OS_linuxaout(x,y) x
136 #else
137 # define IF_OS_linuxaout(x,y) y
138 #endif
139 -- - - - - - - - - - - - - - - - - - - - - - 
140 #if bsdi_TARGET_OS
141 # define IF_OS_bsdi(x,y) x
142 #else
143 # define IF_OS_bsdi(x,y) y
144 #endif
145 -- - - - - - - - - - - - - - - - - - - - - - 
146 #if cygwin32_TARGET_OS
147 # define IF_OS_cygwin32(x,y) x
148 #else
149 # define IF_OS_cygwin32(x,y) y
150 #endif
151 ---------------------------------------------
152 #if sparc_TARGET_ARCH
153 # define IF_ARCH_sparc(x,y) x
154 #else
155 # define IF_ARCH_sparc(x,y) y
156 #endif
157 -- - - - - - - - - - - - - - - - - - - - - - 
158 #if sunos4_TARGET_OS
159 # define IF_OS_sunos4(x,y) x
160 #else
161 # define IF_OS_sunos4(x,y) y
162 #endif
163 -- - - - - - - - - - - - - - - - - - - - - - 
164 -- NB: this will catch i386-*-solaris2, too
165 #if solaris2_TARGET_OS
166 # define IF_OS_solaris2(x,y) x
167 #else
168 # define IF_OS_solaris2(x,y) y
169 #endif
170 ---------------------------------------------
171 #endif