2004-01-16 Zoltan Varga <vargaz@freemail.hu>
[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 struct MonoLMF {
16         gpointer    previous_lmf;
17         gpointer    lmf_addr;
18         MonoMethod *method;
19         gulong     ebp;
20         gulong     eip;
21         gulong     iregs [19]; /* 13..31 */
22         gdouble    fregs [20]; /* 14..31 */
23 };
24
25 #define MONO_ARCH_EMULATE_FCONV_TO_I8 1
26 #define MONO_ARCH_EMULATE_LCONV_TO_R8 1
27 #define MONO_ARCH_EMULATE_LCONV_TO_R4 1
28 #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
29 #define MONO_ARCH_EMULATE_FREM 1
30
31 /* deal with some of the ABI differences here */
32 #ifdef __APPLE__
33 #define PPC_RET_ADDR_OFFSET 8
34 #define PPC_STACK_ALIGNMENT 16
35 #define PPC_STACK_PARAM_OFFSET 24
36 #define PPC_MINIMAL_STACK_SIZE 24
37 #define PPC_FIRST_ARG_REG ppc_r3
38 #define PPC_LAST_ARG_REG ppc_r10
39 #define PPC_FIRST_FPARG_REG ppc_f1
40 #define PPC_LAST_FPARG_REG ppc_f13
41 #define PPC_PASS_STRUCTS_BY_VALUE 1
42 #else
43 /* Linux */
44 #define PPC_RET_ADDR_OFFSET 4
45 #define PPC_STACK_ALIGNMENT 16
46 #define PPC_STACK_PARAM_OFFSET 8
47 #define PPC_MINIMAL_STACK_SIZE 8
48 #define PPC_FIRST_ARG_REG ppc_r3
49 #define PPC_LAST_ARG_REG ppc_r10
50 #define PPC_FIRST_FPARG_REG ppc_f1
51 #define PPC_LAST_FPARG_REG ppc_f8
52 /* set the next to 0 once inssel-ppc.brg is updated */
53 #define PPC_PASS_STRUCTS_BY_VALUE 1
54 #define PPC_SMALL_RET_STRUCT_IN_REG 1
55 #endif
56
57 #define PPC_NUM_REG_ARGS (PPC_LAST_ARG_REG-PPC_FIRST_ARG_REG+1)
58 #define PPC_NUM_REG_FPARGS (PPC_LAST_FPARG_REG-PPC_FIRST_FPARG_REG+1)
59
60 #endif /* __MONO_MINI_PPC_H__ */