Revision 522777bb dyngen-exec.h
b/dyngen-exec.h | ||
---|---|---|
89 | 89 |
#undef NULL |
90 | 90 |
#define NULL 0 |
91 | 91 |
|
92 |
#ifdef __i386__
|
|
92 |
#if defined(__i386__)
|
|
93 | 93 |
#define AREG0 "ebp" |
94 | 94 |
#define AREG1 "ebx" |
95 | 95 |
#define AREG2 "esi" |
96 | 96 |
#define AREG3 "edi" |
97 |
#endif |
|
98 |
#ifdef __x86_64__ |
|
97 |
#elif defined(__x86_64__) |
|
99 | 98 |
#define AREG0 "r14" |
100 | 99 |
#define AREG1 "r15" |
101 | 100 |
#define AREG2 "r12" |
102 | 101 |
#define AREG3 "r13" |
103 | 102 |
//#define AREG4 "rbp" |
104 | 103 |
//#define AREG5 "rbx" |
105 |
#endif |
|
106 |
#ifdef __powerpc__ |
|
104 |
#elif defined(__powerpc__) |
|
107 | 105 |
#define AREG0 "r27" |
108 | 106 |
#define AREG1 "r24" |
109 | 107 |
#define AREG2 "r25" |
... | ... | |
121 | 119 |
#endif |
122 | 120 |
#define USE_INT_TO_FLOAT_HELPERS |
123 | 121 |
#define BUGGY_GCC_DIV64 |
124 |
#endif |
|
125 |
#ifdef __arm__ |
|
122 |
#elif defined(__arm__) |
|
126 | 123 |
#define AREG0 "r7" |
127 | 124 |
#define AREG1 "r4" |
128 | 125 |
#define AREG2 "r5" |
129 | 126 |
#define AREG3 "r6" |
130 |
#endif |
|
131 |
#ifdef __mips__ |
|
127 |
#elif defined(__mips__) |
|
132 | 128 |
#define AREG0 "fp" |
133 | 129 |
#define AREG1 "s0" |
134 | 130 |
#define AREG2 "s1" |
... | ... | |
138 | 134 |
#define AREG6 "s5" |
139 | 135 |
#define AREG7 "s6" |
140 | 136 |
#define AREG8 "s7" |
141 |
#endif |
|
142 |
#ifdef __sparc__ |
|
137 |
#elif defined(__sparc__) |
|
143 | 138 |
#ifdef HOST_SOLARIS |
144 | 139 |
#define AREG0 "g2" |
145 | 140 |
#define AREG1 "g3" |
... | ... | |
168 | 163 |
#endif |
169 | 164 |
#endif |
170 | 165 |
#define USE_FP_CONVERT |
171 |
#endif |
|
172 |
#ifdef __s390__ |
|
166 |
#elif defined(__s390__) |
|
173 | 167 |
#define AREG0 "r10" |
174 | 168 |
#define AREG1 "r7" |
175 | 169 |
#define AREG2 "r8" |
176 | 170 |
#define AREG3 "r9" |
177 |
#endif |
|
178 |
#ifdef __alpha__ |
|
171 |
#elif defined(__alpha__) |
|
179 | 172 |
/* Note $15 is the frame pointer, so anything in op-i386.c that would |
180 | 173 |
require a frame pointer, like alloca, would probably loose. */ |
181 | 174 |
#define AREG0 "$15" |
... | ... | |
185 | 178 |
#define AREG4 "$12" |
186 | 179 |
#define AREG5 "$13" |
187 | 180 |
#define AREG6 "$14" |
188 |
#endif |
|
189 |
#ifdef __mc68000 |
|
181 |
#elif defined(__mc68000) |
|
190 | 182 |
#define AREG0 "%a5" |
191 | 183 |
#define AREG1 "%a4" |
192 | 184 |
#define AREG2 "%d7" |
193 | 185 |
#define AREG3 "%d6" |
194 | 186 |
#define AREG4 "%d5" |
195 |
#endif |
|
196 |
#ifdef __ia64__ |
|
187 |
#elif defined(__ia64__) |
|
197 | 188 |
#define AREG0 "r7" |
198 | 189 |
#define AREG1 "r4" |
199 | 190 |
#define AREG2 "r5" |
200 | 191 |
#define AREG3 "r6" |
192 |
#else |
|
193 |
#error unsupported CPU |
|
201 | 194 |
#endif |
202 | 195 |
|
203 | 196 |
/* force GCC to generate only one epilog at the end of the function */ |
... | ... | |
250 | 243 |
#define ASM_NAME(x) #x |
251 | 244 |
#endif |
252 | 245 |
|
253 |
#ifdef __i386__
|
|
246 |
#if defined(__i386__)
|
|
254 | 247 |
#define EXIT_TB() asm volatile ("ret") |
255 | 248 |
#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n) |
256 |
#endif |
|
257 |
#ifdef __x86_64__ |
|
249 |
#elif defined(__x86_64__) |
|
258 | 250 |
#define EXIT_TB() asm volatile ("ret") |
259 | 251 |
#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n) |
260 |
#endif |
|
261 |
#ifdef __powerpc__ |
|
252 |
#elif defined(__powerpc__) |
|
262 | 253 |
#define EXIT_TB() asm volatile ("blr") |
263 | 254 |
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n) |
264 |
#endif |
|
265 |
#ifdef __s390__ |
|
255 |
#elif defined(__s390__) |
|
266 | 256 |
#define EXIT_TB() asm volatile ("br %r14") |
267 | 257 |
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n) |
268 |
#endif |
|
269 |
#ifdef __alpha__ |
|
258 |
#elif defined(__alpha__) |
|
270 | 259 |
#define EXIT_TB() asm volatile ("ret") |
271 |
#endif |
|
272 |
#ifdef __ia64__ |
|
260 |
#elif defined(__ia64__) |
|
273 | 261 |
#define EXIT_TB() asm volatile ("br.ret.sptk.many b0;;") |
274 | 262 |
#define GOTO_LABEL_PARAM(n) asm volatile ("br.sptk.many " \ |
275 | 263 |
ASM_NAME(__op_gen_label) #n) |
276 |
#endif |
|
277 |
#ifdef __sparc__ |
|
264 |
#elif defined(__sparc__) |
|
278 | 265 |
#define EXIT_TB() asm volatile ("jmpl %i0 + 8, %g0; nop") |
279 | 266 |
#define GOTO_LABEL_PARAM(n) asm volatile ("ba " ASM_NAME(__op_gen_label) #n ";nop") |
280 |
#endif |
|
281 |
#ifdef __arm__ |
|
267 |
#elif defined(__arm__) |
|
282 | 268 |
#define EXIT_TB() asm volatile ("b exec_loop") |
283 | 269 |
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n) |
284 |
#endif |
|
285 |
#ifdef __mc68000 |
|
270 |
#elif defined(__mc68000) |
|
286 | 271 |
#define EXIT_TB() asm volatile ("rts") |
287 |
#endif |
|
288 |
#ifdef __mips__ |
|
272 |
#elif defined(__mips__) |
|
289 | 273 |
#define EXIT_TB() asm volatile ("jr $ra") |
290 | 274 |
#define GOTO_LABEL_PARAM(n) asm volatile (".set noat; la $1, " ASM_NAME(__op_gen_label) #n "; jr $1; .set at") |
275 |
#else |
|
276 |
#error unsupported CPU |
|
291 | 277 |
#endif |
292 | 278 |
|
293 | 279 |
#endif /* !defined(__DYNGEN_EXEC_H__) */ |
Also available in: Unified diff