Add header guards
[pcsx_rearmed.git] / libpcsxcore / new_dynarec / arm / assem_arm.h
1 #ifndef __ASSEM_ARM_H__
2 #define __ASSEM_ARM_H__
3
4 #define HOST_REGS 13
5 #define HOST_CCREG 10
6 #define HOST_BTREG 8
7 #define EXCLUDE_REG 11
8
9 #define HOST_IMM8 1
10 #define HAVE_CMOV_IMM 1
11 #define HAVE_CONDITIONAL_CALL 1
12 #define RAM_SIZE 0x200000
13
14 #define REG_SHIFT 2
15
16 /* ARM calling convention:
17    r0-r3, r12: caller-save
18    r4-r11: callee-save */
19
20 #define ARG1_REG 0
21 #define ARG2_REG 1
22 #define ARG3_REG 2
23 #define ARG4_REG 3
24
25 /* GCC register naming convention:
26    r10 = sl (base)
27    r11 = fp (frame pointer)
28    r12 = ip (scratch)
29    r13 = sp (stack pointer)
30    r14 = lr (link register)
31    r15 = pc (program counter) */
32
33 #define FP 11
34 #define LR 14
35 #define HOST_TEMPREG 14
36
37 // Note: FP is set to &dynarec_local when executing generated code.
38 // Thus the local variables are actually global and not on the stack.
39
40 extern char *invc_ptr;
41
42 #define TARGET_SIZE_2 24 // 2^24 = 16 megabytes
43
44 // Code generator target address
45 #if   defined(BASE_ADDR_FIXED)
46   // "round" address helpful for debug
47   // this produces best code, but not many platforms allow it,
48   // only use if you are sure this range is always free
49   #define BASE_ADDR 0x1000000
50   #define translation_cache (char *)BASE_ADDR
51 #elif defined(BASE_ADDR_DYNAMIC)
52   // for platforms that can't just use .bss buffer, like vita
53   // otherwise better to use the next option for closer branches
54   extern char *translation_cache;
55   #define BASE_ADDR (u_int)translation_cache
56 #else
57   // using a static buffer in .bss
58   extern char translation_cache[1 << TARGET_SIZE_2];
59   #define BASE_ADDR (u_int)translation_cache
60 #endif
61
62 #endif /* __ASSEM_ARM_H__ */