Thu Apr 22 16:10:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / mini / mini-ppc.h
1 #ifndef __MONO_MINI_PPC_H__
2 #define __MONO_MINI_PPC_H__
3
4 #include <mono/arch/ppc/ppc-codegen.h>
5
6 #define MONO_MAX_IREGS 32
7 #define MONO_MAX_FREGS 32
8
9 #define MONO_ARCH_FRAME_ALIGNMENT 4
10
11 /* fixme: align to 16byte instead of 32byte (we align to 32byte to get 
12  * reproduceable results for benchmarks */
13 #define MONO_ARCH_CODE_ALIGNMENT 32
14
15 void ppc_patch (guchar *code, guchar *target);
16
17 struct MonoLMF {
18         gpointer    previous_lmf;
19         gpointer    lmf_addr;
20         MonoMethod *method;
21         gulong     ebp;
22         gulong     eip;
23         gulong     iregs [19]; /* 13..31 */
24         gdouble    fregs [20]; /* 14..31 */
25 };
26
27 typedef struct MonoCompileArch {
28 } MonoCompileArch;
29
30 #define MONO_ARCH_EMULATE_FCONV_TO_I8 1
31 #define MONO_ARCH_EMULATE_LCONV_TO_R8 1
32 #define MONO_ARCH_EMULATE_LCONV_TO_R4 1
33 #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
34 #define MONO_ARCH_EMULATE_FREM 1
35 #define MONO_ARCH_BIGMUL_INTRINS 1
36
37 /* deal with some of the ABI differences here */
38 #ifdef __APPLE__
39 #define PPC_RET_ADDR_OFFSET 8
40 #define PPC_STACK_ALIGNMENT 16
41 #define PPC_STACK_PARAM_OFFSET 24
42 #define PPC_MINIMAL_STACK_SIZE 24
43 #define PPC_FIRST_ARG_REG ppc_r3
44 #define PPC_LAST_ARG_REG ppc_r10
45 #define PPC_FIRST_FPARG_REG ppc_f1
46 #define PPC_LAST_FPARG_REG ppc_f13
47 #define PPC_PASS_STRUCTS_BY_VALUE 1
48 #else
49 /* Linux */
50 #define PPC_RET_ADDR_OFFSET 4
51 #define PPC_STACK_ALIGNMENT 16
52 #define PPC_STACK_PARAM_OFFSET 8
53 #define PPC_MINIMAL_STACK_SIZE 8
54 #define PPC_FIRST_ARG_REG ppc_r3
55 #define PPC_LAST_ARG_REG ppc_r10
56 #define PPC_FIRST_FPARG_REG ppc_f1
57 #define PPC_LAST_FPARG_REG ppc_f8
58 /* set the next to 0 once inssel-ppc.brg is updated */
59 #define PPC_PASS_STRUCTS_BY_VALUE 1
60 #define PPC_SMALL_RET_STRUCT_IN_REG 1
61
62 #define MONO_ARCH_USE_SIGACTION 1
63
64 #endif
65
66 #define PPC_NUM_REG_ARGS (PPC_LAST_ARG_REG-PPC_FIRST_ARG_REG+1)
67 #define PPC_NUM_REG_FPARGS (PPC_LAST_FPARG_REG-PPC_FIRST_FPARG_REG+1)
68
69 #endif /* __MONO_MINI_PPC_H__ */