[project @ 1998-12-02 13:17:09 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 #include "../includes/NativeDefs.h"
54
55 #if alpha_TARGET_ARCH
56 # define BYTES_PER_WORD 8
57 # define BYTES_PER_WORD_STR "8"
58 #endif
59
60 #if i386_TARGET_ARCH
61 # define BYTES_PER_WORD 4
62 # define BYTES_PER_WORD_STR "4"
63 #endif
64
65 #if sparc_TARGET_ARCH
66 # define BYTES_PER_WORD 4
67 # define BYTES_PER_WORD_STR "4"
68 #endif
69
70 ---------------------------------------------
71
72 #if alpha_TARGET_ARCH
73 # define IF_ARCH_alpha(x,y) x
74 #else
75 # define IF_ARCH_alpha(x,y) y
76 #endif
77
78 ---------------------------------------------
79
80 #if i386_TARGET_ARCH
81 # define IF_ARCH_i386(x,y) x
82 #else
83 # define IF_ARCH_i386(x,y) y
84 #endif
85 -- - - - - - - - - - - - - - - - - - - - - - 
86 #if freebsd_TARGET_OS
87 # define IF_OS_freebsd(x,y) x
88 #else
89 # define IF_OS_freebsd(x,y) y
90 #endif
91 -- - - - - - - - - - - - - - - - - - - - - - 
92 #if netbsd_TARGET_OS
93 # define IF_OS_netbsd(x,y) x
94 #else
95 # define IF_OS_netbsd(x,y) y
96 #endif
97 -- - - - - - - - - - - - - - - - - - - - - - 
98 #if linux_TARGET_OS
99 # define IF_OS_linux(x,y) x
100 #else
101 # define IF_OS_linux(x,y) y
102 #endif
103 -- - - - - - - - - - - - - - - - - - - - - - 
104 #if linuxaout_TARGET_OS
105 # define IF_OS_linuxaout(x,y) x
106 #else
107 # define IF_OS_linuxaout(x,y) y
108 #endif
109 -- - - - - - - - - - - - - - - - - - - - - - 
110 #if bsdi_TARGET_OS
111 # define IF_OS_bsdi(x,y) x
112 #else
113 # define IF_OS_bsdi(x,y) y
114 #endif
115 -- - - - - - - - - - - - - - - - - - - - - - 
116 #if cygwin32_TARGET_OS
117 # define IF_OS_cygwin32(x,y) x
118 #else
119 # define IF_OS_cygwin32(x,y) y
120 #endif
121 ---------------------------------------------
122 #if sparc_TARGET_ARCH
123 # define IF_ARCH_sparc(x,y) x
124 #else
125 # define IF_ARCH_sparc(x,y) y
126 #endif
127 -- - - - - - - - - - - - - - - - - - - - - - 
128 #if sunos4_TARGET_OS
129 # define IF_OS_sunos4(x,y) x
130 #else
131 # define IF_OS_sunos4(x,y) y
132 #endif
133 -- - - - - - - - - - - - - - - - - - - - - - 
134 -- NB: this will catch i386-*-solaris2, too
135 #if solaris2_TARGET_OS
136 # define IF_OS_solaris2(x,y) x
137 #else
138 # define IF_OS_solaris2(x,y) y
139 #endif
140 ---------------------------------------------
141 #endif