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.
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!
20 (This is cpp-dependent, of course)
22 ** Convenience macros for writing the native-code generator **
26 #include "../includes/config.h"
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
39 #undef sparc_TARGET_ARCH
40 #undef sunos4_TARGET_OS
41 #undef alpha_TARGET_ARCH
42 #define alpha_TARGET_ARCH 1
46 # define STOLEN_X86_REGS 4
47 -- HACK: go for the max
50 #include "../includes/MachRegs.h"
51 #include "../includes/NativeDefs.h"
54 # define BYTES_PER_WORD 8
55 # define BYTES_PER_WORD_STR "8"
59 # define BYTES_PER_WORD 4
60 # define BYTES_PER_WORD_STR "4"
64 # define BYTES_PER_WORD 4
65 # define BYTES_PER_WORD_STR "4"
68 #if powerpc_TARGET_ARCH
69 # define BYTES_PER_WORD 4
70 # define BYTES_PER_WORD_STR "4"
73 ---------------------------------------------
76 # define IF_ARCH_alpha(x,y) x
78 # define IF_ARCH_alpha(x,y) y
81 ---------------------------------------------
84 # define IF_ARCH_i386(x,y) x
86 # define IF_ARCH_i386(x,y) y
88 -- - - - - - - - - - - - - - - - - - - - - -
90 # define IF_OS_freebsd(x,y) x
92 # define IF_OS_freebsd(x,y) y
94 -- - - - - - - - - - - - - - - - - - - - - -
96 # define IF_OS_netbsd(x,y) x
98 # define IF_OS_netbsd(x,y) y
100 -- - - - - - - - - - - - - - - - - - - - - -
101 #if openbsd_TARGET_OS
102 # define IF_OS_openbsd(x,y) x
104 # define IF_OS_openbsd(x,y) y
106 -- - - - - - - - - - - - - - - - - - - - - -
108 # define IF_OS_linux(x,y) x
110 # define IF_OS_linux(x,y) y
112 -- - - - - - - - - - - - - - - - - - - - - -
113 #if linuxaout_TARGET_OS
114 # define IF_OS_linuxaout(x,y) x
116 # define IF_OS_linuxaout(x,y) y
118 -- - - - - - - - - - - - - - - - - - - - - -
120 # define IF_OS_bsdi(x,y) x
122 # define IF_OS_bsdi(x,y) y
124 -- - - - - - - - - - - - - - - - - - - - - -
125 #if cygwin32_TARGET_OS
126 # define IF_OS_cygwin32(x,y) x
128 # define IF_OS_cygwin32(x,y) y
130 ---------------------------------------------
131 #if sparc_TARGET_ARCH
132 # define IF_ARCH_sparc(x,y) x
134 # define IF_ARCH_sparc(x,y) y
136 -- - - - - - - - - - - - - - - - - - - - - -
138 # define IF_OS_sunos4(x,y) x
140 # define IF_OS_sunos4(x,y) y
142 -- - - - - - - - - - - - - - - - - - - - - -
143 -- NB: this will catch i386-*-solaris2, too
144 #if solaris2_TARGET_OS
145 # define IF_OS_solaris2(x,y) x
147 # define IF_OS_solaris2(x,y) y
149 ---------------------------------------------
150 #if powerpc_TARGET_ARCH
151 # define IF_ARCH_powerpc(x,y) x
153 # define IF_ARCH_powerpc(x,y) y
155 -- - - - - - - - - - - - - - - - - - - - - -
157 # define IF_OS_darwin(x,y) x
159 # define IF_OS_darwin(x,y) y
161 ---------------------------------------------