[project @ 2000-10-24 10:12:16 by sewardj]
[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 #include "../includes/config.h"
27
28 #if 0
29 {-testing only-}
30 #undef sparc_TARGET_ARCH
31 #undef sunos4_TARGET_OS
32 #undef i386_TARGET_ARCH
33 #define i386_TARGET_ARCH 1
34 #undef linuxaout_TARGET_OS
35 #define linuxaout_TARGET_OS 1
36 #endif
37 #if 0
38 {-testing only-}
39 #undef sparc_TARGET_ARCH
40 #undef sunos4_TARGET_OS
41 #undef alpha_TARGET_ARCH
42 #define alpha_TARGET_ARCH 1
43 #endif
44
45 #if i386_TARGET_ARCH
46 # define STOLEN_X86_REGS 4
47 -- HACK: go for the max
48 #endif
49
50 #include "../includes/MachRegs.h"
51 #include "../includes/NativeDefs.h"
52
53 #if alpha_TARGET_ARCH
54 # define BYTES_PER_WORD 8
55 # define BYTES_PER_WORD_STR "8"
56 #endif
57
58 #if i386_TARGET_ARCH
59 # define BYTES_PER_WORD 4
60 # define BYTES_PER_WORD_STR "4"
61 #endif
62
63 #if sparc_TARGET_ARCH
64 # define BYTES_PER_WORD 4
65 # define BYTES_PER_WORD_STR "4"
66 #endif
67
68 ---------------------------------------------
69
70 #if alpha_TARGET_ARCH
71 # define IF_ARCH_alpha(x,y) x
72 #else
73 # define IF_ARCH_alpha(x,y) y
74 #endif
75
76 ---------------------------------------------
77
78 #if i386_TARGET_ARCH
79 # define IF_ARCH_i386(x,y) x
80 #else
81 # define IF_ARCH_i386(x,y) y
82 #endif
83 -- - - - - - - - - - - - - - - - - - - - - - 
84 #if freebsd_TARGET_OS
85 # define IF_OS_freebsd(x,y) x
86 #else
87 # define IF_OS_freebsd(x,y) y
88 #endif
89 -- - - - - - - - - - - - - - - - - - - - - - 
90 #if netbsd_TARGET_OS
91 # define IF_OS_netbsd(x,y) x
92 #else
93 # define IF_OS_netbsd(x,y) y
94 #endif
95 -- - - - - - - - - - - - - - - - - - - - - - 
96 #if openbsd_TARGET_OS
97 # define IF_OS_openbsd(x,y) x
98 #else
99 # define IF_OS_openbsd(x,y) y
100 #endif
101 -- - - - - - - - - - - - - - - - - - - - - - 
102 #if linux_TARGET_OS
103 # define IF_OS_linux(x,y) x
104 #else
105 # define IF_OS_linux(x,y) y
106 #endif
107 -- - - - - - - - - - - - - - - - - - - - - - 
108 #if linuxaout_TARGET_OS
109 # define IF_OS_linuxaout(x,y) x
110 #else
111 # define IF_OS_linuxaout(x,y) y
112 #endif
113 -- - - - - - - - - - - - - - - - - - - - - - 
114 #if bsdi_TARGET_OS
115 # define IF_OS_bsdi(x,y) x
116 #else
117 # define IF_OS_bsdi(x,y) y
118 #endif
119 -- - - - - - - - - - - - - - - - - - - - - - 
120 #if cygwin32_TARGET_OS
121 # define IF_OS_cygwin32(x,y) x
122 #else
123 # define IF_OS_cygwin32(x,y) y
124 #endif
125 ---------------------------------------------
126 #if sparc_TARGET_ARCH
127 # define IF_ARCH_sparc(x,y) x
128 #else
129 # define IF_ARCH_sparc(x,y) y
130 #endif
131 -- - - - - - - - - - - - - - - - - - - - - - 
132 #if sunos4_TARGET_OS
133 # define IF_OS_sunos4(x,y) x
134 #else
135 # define IF_OS_sunos4(x,y) y
136 #endif
137 -- - - - - - - - - - - - - - - - - - - - - - 
138 -- NB: this will catch i386-*-solaris2, too
139 #if solaris2_TARGET_OS
140 # define IF_OS_solaris2(x,y) x
141 #else
142 # define IF_OS_solaris2(x,y) y
143 #endif
144 ---------------------------------------------
145 #endif