[project @ 1998-02-05 12:23:33 by simonm]
[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 # if osf1_TARGET_OS
59 #  include "../../includes/alpha-dec-osf1.h"
60 # endif
61 # if osf3_TARGET_OS
62 #  include "../../includes/alpha-dec-osf3.h"
63 # endif
64 #endif
65
66 #if i386_TARGET_ARCH
67 # define BYTES_PER_WORD 4
68 # define BYTES_PER_WORD_STR "4"
69
70 # if linuxaout_TARGET_OS
71 #  include "../../includes/i386-unknown-linuxaout.h"
72 # endif
73 # if linux_TARGET_OS
74 #  include "../../includes/i386-unknown-linux.h"
75 # endif
76 # if freebsd_TARGET_OS
77 #  include "../../includes/i386-unknown-freebsd.h"
78 # endif
79 # if netbsd_TARGET_OS
80 #  include "../../includes/i386-unknown-netbsd.h"
81 # endif
82 # if bsdi_TARGET_OS
83 #  include "../../includes/i386-unknown-bsdi.h"
84 # endif
85 # if cygwin32_TARGET_OS
86 #  include "../../includes/i386-unknown-cygwin32.h"
87 # endif
88 # if solaris2_TARGET_OS
89 #  include "../../includes/i386-unknown-solaris2.h"
90 # endif
91 #endif
92
93 #if sparc_TARGET_ARCH
94 # define BYTES_PER_WORD 4
95 # define BYTES_PER_WORD_STR "4"
96
97 # if sunos4_TARGET_OS
98 #  include "../../includes/sparc-sun-sunos4.h"
99 # endif
100 # if solaris2_TARGET_OS
101 #  include "../../includes/sparc-sun-solaris2.h"
102 # endif
103 #endif
104
105 ---------------------------------------------
106
107 #if alpha_TARGET_ARCH
108 # define IF_ARCH_alpha(x,y) x
109 #else
110 # define IF_ARCH_alpha(x,y) y
111 #endif
112
113 ---------------------------------------------
114
115 #if i386_TARGET_ARCH
116 # define IF_ARCH_i386(x,y) x
117 #else
118 # define IF_ARCH_i386(x,y) y
119 #endif
120 -- - - - - - - - - - - - - - - - - - - - - - 
121 #if freebsd_TARGET_OS
122 # define IF_OS_freebsd(x,y) x
123 #else
124 # define IF_OS_freebsd(x,y) y
125 #endif
126 -- - - - - - - - - - - - - - - - - - - - - - 
127 #if netbsd_TARGET_OS
128 # define IF_OS_netbsd(x,y) x
129 #else
130 # define IF_OS_netbsd(x,y) y
131 #endif
132 -- - - - - - - - - - - - - - - - - - - - - - 
133 #if linux_TARGET_OS
134 # define IF_OS_linux(x,y) x
135 #else
136 # define IF_OS_linux(x,y) y
137 #endif
138 -- - - - - - - - - - - - - - - - - - - - - - 
139 #if linuxaout_TARGET_OS
140 # define IF_OS_linuxaout(x,y) x
141 #else
142 # define IF_OS_linuxaout(x,y) y
143 #endif
144 -- - - - - - - - - - - - - - - - - - - - - - 
145 #if bsdi_TARGET_OS
146 # define IF_OS_bsdi(x,y) x
147 #else
148 # define IF_OS_bsdi(x,y) y
149 #endif
150 -- - - - - - - - - - - - - - - - - - - - - - 
151 #if cygwin32_TARGET_OS
152 # define IF_OS_cygwin32(x,y) x
153 #else
154 # define IF_OS_cygwin32(x,y) y
155 #endif
156 ---------------------------------------------
157 #if sparc_TARGET_ARCH
158 # define IF_ARCH_sparc(x,y) x
159 #else
160 # define IF_ARCH_sparc(x,y) y
161 #endif
162 -- - - - - - - - - - - - - - - - - - - - - - 
163 #if sunos4_TARGET_OS
164 # define IF_OS_sunos4(x,y) x
165 #else
166 # define IF_OS_sunos4(x,y) y
167 #endif
168 -- - - - - - - - - - - - - - - - - - - - - - 
169 -- NB: this will catch i386-*-solaris2, too
170 #if solaris2_TARGET_OS
171 # define IF_OS_solaris2(x,y) x
172 #else
173 # define IF_OS_solaris2(x,y) y
174 #endif
175 ---------------------------------------------
176 #endif