78
78
#define UINT32_MAX (4294967295U)
79
79
#define UINT64_MAX ((uint64_t)(18446744073709551615))
82
typedef struct __sFILE FILE;
81
84
typedef struct FILE FILE;
82
86
extern int fprintf(FILE *, const char *, ...);
87
extern int fputs(const char *, FILE *);
83
88
extern int printf(const char *, ...);
88
93
#define AREG0 "ebp"
89
94
#define AREG1 "ebx"
90
95
#define AREG2 "esi"
91
96
#define AREG3 "edi"
97
#elif defined(__x86_64__)
96
100
#define AREG2 "r12"
97
101
#define AREG3 "r13"
102
//#define AREG4 "rbp"
103
//#define AREG5 "rbx"
104
#elif defined(__powerpc__)
102
105
#define AREG0 "r27"
103
106
#define AREG1 "r24"
104
107
#define AREG2 "r25"
240
243
#define ASM_NAME(x) #x
244
#define EXIT_TB() asm volatile ("ret")
245
#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
248
#define EXIT_TB() asm volatile ("ret")
249
#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
246
#if defined(__i386__)
247
#define EXIT_TB() asm volatile ("ret")
248
#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
249
#elif defined(__x86_64__)
250
#define EXIT_TB() asm volatile ("ret")
251
#define GOTO_LABEL_PARAM(n) asm volatile ("jmp " ASM_NAME(__op_gen_label) #n)
252
#elif defined(__powerpc__)
252
253
#define EXIT_TB() asm volatile ("blr")
253
254
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
255
#elif defined(__s390__)
256
256
#define EXIT_TB() asm volatile ("br %r14")
257
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
257
#define GOTO_LABEL_PARAM(n) asm volatile ("bras %r7,8; .long " ASM_NAME(__op_gen_label) #n "; l %r7, 0(%r7); br %r7")
258
#elif defined(__alpha__)
260
259
#define EXIT_TB() asm volatile ("ret")
260
#elif defined(__ia64__)
263
261
#define EXIT_TB() asm volatile ("br.ret.sptk.many b0;;")
264
262
#define GOTO_LABEL_PARAM(n) asm volatile ("br.sptk.many " \
265
263
ASM_NAME(__op_gen_label) #n)
264
#elif defined(__sparc__)
268
265
#define EXIT_TB() asm volatile ("jmpl %i0 + 8, %g0; nop")
269
266
#define GOTO_LABEL_PARAM(n) asm volatile ("ba " ASM_NAME(__op_gen_label) #n ";nop")
267
#elif defined(__arm__)
272
268
#define EXIT_TB() asm volatile ("b exec_loop")
273
269
#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n)
270
#elif defined(__mc68000)
276
271
#define EXIT_TB() asm volatile ("rts")
272
#elif defined(__mips__)
273
#define EXIT_TB() asm volatile ("jr $ra")
274
#define GOTO_LABEL_PARAM(n) asm volatile (".set noat; la $1, " ASM_NAME(__op_gen_label) #n "; jr $1; .set at")
276
#error unsupported CPU
279
279
#endif /* !defined(__DYNGEN_EXEC_H__) */