RetroArch
asm.h
Go to the documentation of this file.
1 #ifndef __ASM_H__
2 #define __ASM_H__
3 
4 #ifdef _LANGUAGE_ASSEMBLY
5 /* Condition Register Bit Fields */
6 
7 #define cr0 0
8 #define cr1 1
9 #define cr2 2
10 #define cr3 3
11 #define cr4 4
12 #define cr5 5
13 #define cr6 6
14 #define cr7 7
15 
16 
17 /* General Purpose Registers (GPRs) */
18 
19 #define r0 0
20 #define r1 1
21 #define sp 1
22 #define r2 2
23 #define toc 2
24 #define r3 3
25 #define r4 4
26 #define r5 5
27 #define r6 6
28 #define r7 7
29 #define r8 8
30 #define r9 9
31 #define r10 10
32 #define r11 11
33 #define r12 12
34 #define r13 13
35 #define r14 14
36 #define r15 15
37 #define r16 16
38 #define r17 17
39 #define r18 18
40 #define r19 19
41 #define r20 20
42 #define r21 21
43 #define r22 22
44 #define r23 23
45 #define r24 24
46 #define r25 25
47 #define r26 26
48 #define r27 27
49 #define r28 28
50 #define r29 29
51 #define r30 30
52 #define r31 31
53 
54 
55 /* Floating Point Registers (FPRs) */
56 
57 #define fr0 0
58 #define fr1 1
59 #define fr2 2
60 #define fr3 3
61 #define fr4 4
62 #define fr5 5
63 #define fr6 6
64 #define fr7 7
65 #define fr8 8
66 #define fr9 9
67 #define fr10 10
68 #define fr11 11
69 #define fr12 12
70 #define fr13 13
71 #define fr14 14
72 #define fr15 15
73 #define fr16 16
74 #define fr17 17
75 #define fr18 18
76 #define fr19 19
77 #define fr20 20
78 #define fr21 21
79 #define fr22 22
80 #define fr23 23
81 #define fr24 24
82 #define fr25 25
83 #define fr26 26
84 #define fr27 27
85 #define fr28 28
86 #define fr29 29
87 #define fr30 30
88 #define fr31 31
89 
90 #define vr0 0
91 #define vr1 1
92 #define vr2 2
93 #define vr3 3
94 #define vr4 4
95 #define vr5 5
96 #define vr6 6
97 #define vr7 7
98 #define vr8 8
99 #define vr9 9
100 #define vr10 10
101 #define vr11 11
102 #define vr12 12
103 #define vr13 13
104 #define vr14 14
105 #define vr15 15
106 #define vr16 16
107 #define vr17 17
108 #define vr18 18
109 #define vr19 19
110 #define vr20 20
111 #define vr21 21
112 #define vr22 22
113 #define vr23 23
114 #define vr24 24
115 #define vr25 25
116 #define vr26 26
117 #define vr27 27
118 #define vr28 28
119 #define vr29 29
120 #define vr30 30
121 #define vr31 31
122 
123 #endif //_LANGUAGE_ASSEMBLY
124 
125 #define SPRG0 272
126 #define SPRG1 273
127 #define SPRG2 274
128 #define SPRG3 275
129 
130 #define PMC1 953
131 #define PMC2 954
132 #define PMC3 957
133 #define PMC4 958
134 
135 #define MMCR0 952
136 #define MMCR1 956
137 
138 
139 #define LINK_REGISTER_CALLEE_UPDATE_ROOM 4
140 #define EXCEPTION_NUMBER 8
141 #define SRR0_OFFSET 12
142 #define SRR1_OFFSET 16
143 #define GPR0_OFFSET 20
144 #define GPR1_OFFSET 24
145 #define GPR2_OFFSET 28
146 #define GPR3_OFFSET 32
147 #define GPR4_OFFSET 36
148 #define GPR5_OFFSET 40
149 #define GPR6_OFFSET 44
150 #define GPR7_OFFSET 48
151 #define GPR8_OFFSET 52
152 #define GPR9_OFFSET 56
153 #define GPR10_OFFSET 60
154 #define GPR11_OFFSET 64
155 #define GPR12_OFFSET 68
156 #define GPR13_OFFSET 72
157 #define GPR14_OFFSET 76
158 #define GPR15_OFFSET 80
159 #define GPR16_OFFSET 84
160 #define GPR17_OFFSET 88
161 #define GPR18_OFFSET 92
162 #define GPR19_OFFSET 96
163 #define GPR20_OFFSET 100
164 #define GPR21_OFFSET 104
165 #define GPR22_OFFSET 108
166 #define GPR23_OFFSET 112
167 #define GPR24_OFFSET 116
168 #define GPR25_OFFSET 120
169 #define GPR26_OFFSET 124
170 #define GPR27_OFFSET 128
171 #define GPR28_OFFSET 132
172 #define GPR29_OFFSET 136
173 #define GPR30_OFFSET 140
174 #define GPR31_OFFSET 144
175 
176 #define GQR0_OFFSET 148
177 #define GQR1_OFFSET 152
178 #define GQR2_OFFSET 156
179 #define GQR3_OFFSET 160
180 #define GQR4_OFFSET 164
181 #define GQR5_OFFSET 168
182 #define GQR6_OFFSET 172
183 #define GQR7_OFFSET 176
184 
185 #define CR_OFFSET 180
186 #define LR_OFFSET 184
187 #define CTR_OFFSET 188
188 #define XER_OFFSET 192
189 #define MSR_OFFSET 196
190 #define DAR_OFFSET 200
191 
192 #define STATE_OFFSET 204
193 #define MODE_OFFSET 206
194 
195 #define FPR0_OFFSET 208
196 #define FPR1_OFFSET 216
197 #define FPR2_OFFSET 224
198 #define FPR3_OFFSET 232
199 #define FPR4_OFFSET 240
200 #define FPR5_OFFSET 248
201 #define FPR6_OFFSET 256
202 #define FPR7_OFFSET 264
203 #define FPR8_OFFSET 272
204 #define FPR9_OFFSET 280
205 #define FPR10_OFFSET 288
206 #define FPR11_OFFSET 296
207 #define FPR12_OFFSET 304
208 #define FPR13_OFFSET 312
209 #define FPR14_OFFSET 320
210 #define FPR15_OFFSET 328
211 #define FPR16_OFFSET 336
212 #define FPR17_OFFSET 344
213 #define FPR18_OFFSET 352
214 #define FPR19_OFFSET 360
215 #define FPR20_OFFSET 368
216 #define FPR21_OFFSET 376
217 #define FPR22_OFFSET 384
218 #define FPR23_OFFSET 392
219 #define FPR24_OFFSET 400
220 #define FPR25_OFFSET 408
221 #define FPR26_OFFSET 416
222 #define FPR27_OFFSET 424
223 #define FPR28_OFFSET 432
224 #define FPR29_OFFSET 440
225 #define FPR30_OFFSET 448
226 #define FPR31_OFFSET 456
227 
228 #define FPSCR_OFFSET 464
229 
230 #define PSR0_OFFSET 472
231 #define PSR1_OFFSET 480
232 #define PSR2_OFFSET 488
233 #define PSR3_OFFSET 496
234 #define PSR4_OFFSET 504
235 #define PSR5_OFFSET 512
236 #define PSR6_OFFSET 520
237 #define PSR7_OFFSET 528
238 #define PSR8_OFFSET 536
239 #define PSR9_OFFSET 544
240 #define PSR10_OFFSET 552
241 #define PSR11_OFFSET 560
242 #define PSR12_OFFSET 568
243 #define PSR13_OFFSET 576
244 #define PSR14_OFFSET 584
245 #define PSR15_OFFSET 592
246 #define PSR16_OFFSET 600
247 #define PSR17_OFFSET 608
248 #define PSR18_OFFSET 616
249 #define PSR19_OFFSET 624
250 #define PSR20_OFFSET 632
251 #define PSR21_OFFSET 640
252 #define PSR22_OFFSET 648
253 #define PSR23_OFFSET 656
254 #define PSR24_OFFSET 664
255 #define PSR25_OFFSET 672
256 #define PSR26_OFFSET 680
257 #define PSR27_OFFSET 688
258 #define PSR28_OFFSET 696
259 #define PSR29_OFFSET 704
260 #define PSR30_OFFSET 712
261 #define PSR31_OFFSET 720
262 /*
263  * maintain the EABI requested 8 bytes aligment
264  * As SVR4 ABI requires 16, make it 16 (as some
265  * exception may need more registers to be processed...)
266  */
267 #define EXCEPTION_FRAME_END 728
268 
269 #define IBAT0U 528
270 #define IBAT0L 529
271 #define IBAT1U 530
272 #define IBAT1L 531
273 #define IBAT2U 532
274 #define IBAT2L 533
275 #define IBAT3U 534
276 #define IBAT3L 535
277 #define IBAT4U 560
278 #define IBAT4L 561
279 #define IBAT5U 562
280 #define IBAT5L 563
281 #define IBAT6U 564
282 #define IBAT6L 565
283 #define IBAT7U 566
284 #define IBAT7L 567
285 
286 #define DBAT0U 536
287 #define DBAT0L 537
288 #define DBAT1U 538
289 #define DBAT1L 539
290 #define DBAT2U 540
291 #define DBAT2L 541
292 #define DBAT3U 542
293 #define DBAT3L 543
294 #define DBAT4U 568
295 #define DBAT4L 569
296 #define DBAT5U 570
297 #define DBAT5L 571
298 #define DBAT6U 572
299 #define DBAT6L 573
300 #define DBAT7U 574
301 #define DBAT7L 575
302 
303 #define HID0 1008
304 #define HID1 1009
305 #define HID2 920
306 #define HID4 1011
307 
308 #define GQR0 912
309 #define GQR1 913
310 #define GQR2 914
311 #define GQR3 915
312 #define GQR4 916
313 #define GQR5 917
314 #define GQR6 918
315 #define GQR7 919
316 
317 #define L2CR 1017
318 
319 #define WPAR 921
320 
321 #define DMAU 922
322 #define DMAL 923
323 
324 #define MSR_RI 0x00000002
325 #define MSR_DR 0x00000010
326 #define MSR_IR 0x00000020
327 #define MSR_IP 0x00000040
328 #define MSR_SE 0x00000400
329 #define MSR_ME 0x00001000
330 #define MSR_FP 0x00002000
331 #define MSR_POW 0x00004000
332 #define MSR_EE 0x00008000
333 
334 #define PPC_ALIGNMENT 8
335 
336 #define PPC_CACHE_ALIGNMENT 32
337 
338 #endif //__ASM_H__