2003-12-04 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/x86/x86-codegen.h>
5 #include <mono/arch/ppc/ppc-codegen.h>
6
7 #define MONO_MAX_IREGS 32
8 #define MONO_MAX_FREGS 32
9
10 #define MONO_ARCH_FRAME_ALIGNMENT 4
11
12 /* fixme: align to 16byte instead of 32byte (we align to 32byte to get 
13  * reproduceable results for benchmarks */
14 #define MONO_ARCH_CODE_ALIGNMENT 32
15
16 #define MONO_ARCH_BASEREG X86_EBP
17 #define MONO_ARCH_RETREG1 ppc_r3
18 #define MONO_ARCH_RETREG2 ppc_r4
19
20 struct MonoLMF {
21         gpointer    previous_lmf;
22         gpointer    lmf_addr;
23         MonoMethod *method;
24         guint32     ebp;
25         guint32     eip;
26 };
27
28 #define MONO_ARCH_EMULATE_FCONV_TO_I8 1
29 #define MONO_ARCH_EMULATE_LCONV_TO_R8 1
30 #define MONO_ARCH_EMULATE_LCONV_TO_R4 1
31 #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
32 #define MONO_ARCH_EMULATE_FREM 1
33
34 /* deal with some of the ABI differences here */
35 #ifdef __APPLE__
36 #define PPC_RET_ADDR_OFFSET 8
37 #define PPC_STACK_ALIGNMENT 16
38 #define PPC_STACK_PARAM_OFFSET 24
39 #define PPC_MINIMAL_STACK_SIZE 24
40 #else
41 /* Linux */
42 #define PPC_RET_ADDR_OFFSET 4
43 #define PPC_STACK_ALIGNMENT 16
44 #define PPC_STACK_PARAM_OFFSET 8
45 #define PPC_MINIMAL_STACK_SIZE 8
46 #endif
47
48
49 #endif /* __MONO_MINI_PPC_H__ */