[project @ 1996-04-05 08:26:04 by partain]
[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 solaris2_TARGET_OS
69 #  include "../../includes/i386-unknown-solaris2.h"
70 # endif
71 #endif
72
73 #if sparc_TARGET_ARCH
74 # define BYTES_PER_WORD 4
75 # define BYTES_PER_WORD_STR "4"
76
77 # if sunos4_TARGET_OS
78 #  include "../../includes/sparc-sun-sunos4.h"
79 # endif
80 # if solaris2_TARGET_OS
81 #  include "../../includes/sparc-sun-solaris2.h"
82 # endif
83 #endif
84
85 ---------------------------------------------
86
87 #if alpha_TARGET_ARCH
88 # define IF_ARCH_alpha(x,y) x
89 #else
90 # define IF_ARCH_alpha(x,y) y
91 #endif
92
93 ---------------------------------------------
94
95 #if i386_TARGET_ARCH
96 # define IF_ARCH_i386(x,y) x
97 #else
98 # define IF_ARCH_i386(x,y) y
99 #endif
100 -- - - - - - - - - - - - - - - - - - - - - - 
101 #if freebsd_TARGET_OS
102 # define IF_OS_freebsd(x,y) x
103 #else
104 # define IF_OS_freebsd(x,y) y
105 #endif
106 -- - - - - - - - - - - - - - - - - - - - - - 
107 #if netbsd_TARGET_OS
108 # define IF_OS_netbsd(x,y) x
109 #else
110 # define IF_OS_netbsd(x,y) y
111 #endif
112 -- - - - - - - - - - - - - - - - - - - - - - 
113 #if linux_TARGET_OS
114 # define IF_OS_linux(x,y) x
115 #else
116 # define IF_OS_linux(x,y) y
117 #endif
118 -- - - - - - - - - - - - - - - - - - - - - - 
119 #if linuxaout_TARGET_OS
120 # define IF_OS_linuxaout(x,y) x
121 #else
122 # define IF_OS_linuxaout(x,y) y
123 #endif
124 -- - - - - - - - - - - - - - - - - - - - - - 
125 #if bsdi_TARGET_OS
126 # define IF_OS_bsdi(x,y) x
127 #else
128 # define IF_OS_bsdi(x,y) y
129 #endif
130 ---------------------------------------------
131 #if sparc_TARGET_ARCH
132 # define IF_ARCH_sparc(x,y) x
133 #else
134 # define IF_ARCH_sparc(x,y) y
135 #endif
136 -- - - - - - - - - - - - - - - - - - - - - - 
137 #if sunos4_TARGET_OS
138 # define IF_OS_sunos4(x,y) x
139 #else
140 # define IF_OS_sunos4(x,y) y
141 #endif
142 -- - - - - - - - - - - - - - - - - - - - - - 
143 -- NB: this will catch i386-*-solaris2, too
144 #if solaris2_TARGET_OS
145 # define IF_OS_solaris2(x,y) x
146 #else
147 # define IF_OS_solaris2(x,y) y
148 #endif
149 ---------------------------------------------
150 #endif