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