CACAO
md-asm.hpp
Go to the documentation of this file.
1 /* src/vm/jit/powerpc/darwin/md-asm.hpp - assembler defines for PowerPC Darwin ABI
2 
3  Copyright (C) 1996-2013
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
25 
26 #ifndef MD_ASM_HPP_
27 #define MD_ASM_HPP_ 1
28 
29 /* define register names compatible with Linux names **************************/
30 
31 #define fr0 f0
32 #define fr1 f1
33 #define fr2 f2
34 #define fr3 f3
35 #define fr4 f4
36 #define fr5 f5
37 #define fr6 f6
38 #define fr7 f7
39 #define fr8 f8
40 #define fr9 f9
41 #define fr10 f10
42 #define fr11 f11
43 #define fr12 f12
44 #define fr13 f13
45 #define fr14 f14
46 #define fr15 f15
47 #define fr16 f16
48 #define fr17 f17
49 #define fr18 f18
50 #define fr19 f19
51 #define fr20 f20
52 #define fr21 f21
53 #define fr22 f22
54 #define fr23 f23
55 #define fr24 f24
56 #define fr25 f25
57 #define fr26 f26
58 #define fr27 f27
59 #define fr28 f28
60 #define fr29 f29
61 #define fr30 f30
62 #define fr31 f31
63 
64 
65 /* register defines ***********************************************************/
66 
67 #define zero r0
68 #define sp r1
69 
70 #define t0 r2
71 
72 #define a0 r3
73 #define a1 r4
74 #define a2 r5
75 #define a3 r6
76 #define a4 r7
77 #define a5 r8
78 #define a6 r9
79 #define a7 r10
80 
81 #define itmp1 r11
82 #define itmp2 r12
83 #define pv r13
84 
85 #define s0 r14
86 #define s1 r15
87 
88 #define itmp3 r16
89 #define t1 r17
90 #define t2 r18
91 #define t3 r19
92 #define t4 r20
93 #define t5 r21
94 #define t6 r22
95 #define t7 r23
96 
97 #define s2 r24
98 #define s3 r25
99 #define s4 r26
100 #define s5 r27
101 #define s6 r28
102 #define s7 r29
103 #define s8 r30
104 #define s9 r31
105 
106 #define v0 a0
107 #define v1 a1
108 
109 #define xptr itmp1
110 #define xpc itmp2
111 
112 #define mptr itmp2
113 #define mptrn 12
114 
115 
116 #define ftmp3 f0
117 
118 #define fa0 f1
119 #define fa1 f2
120 #define fa2 f3
121 #define fa3 f4
122 #define fa4 f5
123 #define fa5 f6
124 #define fa6 f7
125 
126 #define fa7 f8
127 #define fa8 f9
128 #define fa9 f10
129 #define fa10 f11
130 #define fa11 f12
131 #define fa12 f13
132 
133 #define fs0 f14
134 #define fs1 f15
135 
136 #define ftmp1 f16
137 #define ftmp2 f17
138 
139 #define ft0 f18
140 #define ft1 f19
141 #define ft2 f20
142 #define ft3 f21
143 #define ft4 f22
144 #define ft5 f23
145 
146 #define fs2 f24
147 #define fs3 f25
148 #define fs4 f26
149 #define fs5 f27
150 #define fs6 f28
151 #define fs7 f29
152 #define fs8 f30
153 #define fs9 f31
154 
155 #define fv0 fa0
156 
157 
158 /* save and restore macros ****************************************************/
159 
160 #define SAVE_ARGUMENT_REGISTERS(off) \
161  stw a0,(0+(off))*4(sp); \
162  stw a1,(1+(off))*4(sp); \
163  stw a2,(2+(off))*4(sp); \
164  stw a3,(3+(off))*4(sp); \
165  stw a4,(4+(off))*4(sp); \
166  stw a5,(5+(off))*4(sp); \
167  stw a6,(6+(off))*4(sp); \
168  stw a7,(7+(off))*4(sp); \
169  \
170  stfd fa0,(8+(off))*4)(sp); \
171  stfd fa1,(10+(off))*4)(sp); \
172  stfd fa2,(12+(off))*4)(sp); \
173  stfd fa3,(14+(off))*4)(sp); \
174  stfd fa4,(16+(off))*4)(sp); \
175  stfd fa5,(18+(off))*4)(sp); \
176  stfd fa6,(20+(off))*4)(sp); \
177  stfd fa7,(22+(off))*4)(sp); \
178  stfd fa8,(24+(off))*4)(sp); \
179  stfd fa9,(26+(off))*4)(sp); \
180  stfd fa10,(28+(off))*4)(sp); \
181  stfd fa11,(30+(off))*4)(sp); \
182  stfd fa12,(32+(off))*4)(sp);
183 
184 #define RESTORE_ARGUMENT_REGISTERS(off) \
185  lwz a0,(0+(off))*4(sp); \
186  lwz a1,(1+(off))*4(sp); \
187  lwz a2,(2+(off))*4(sp); \
188  lwz a3,(3+(off))*4(sp); \
189  lwz a4,(4+(off))*4(sp); \
190  lwz a5,(5+(off))*4(sp); \
191  lwz a6,(6+(off))*4(sp); \
192  lwz a7,(7+(off))*4(sp); \
193  \
194  lfd fa0,(8+(off))*4)(sp); \
195  lfd fa1,(10+(off))*4)(sp); \
196  lfd fa2,(12+(off))*4)(sp); \
197  lfd fa3,(14+(off))*4)(sp); \
198  lfd fa4,(16+(off))*4)(sp); \
199  lfd fa5,(18+(off))*4)(sp); \
200  lfd fa6,(20+(off))*4)(sp); \
201  lfd fa7,(22+(off))*4)(sp); \
202  lfd fa8,(24+(off))*4)(sp); \
203  lfd fa9,(26+(off))*4)(sp); \
204  lfd fa10,(28+(off))*4)(sp); \
205  lfd fa11,(30+(off))*4)(sp); \
206  lfd fa12,(32+(off))*4)(sp);
207 
208 
209 /* Defines for darwin's old gnu assembler *************************************/
210 
211 /* internal defines ***********************************************************/
212 
213 #define asm_vm_call_method _asm_vm_call_method
214 #define asm_vm_call_method_int _asm_vm_call_method_int
215 #define asm_vm_call_method_long _asm_vm_call_method_long
216 #define asm_vm_call_method_float _asm_vm_call_method_float
217 #define asm_vm_call_method_double _asm_vm_call_method_double
218 #define asm_vm_call_method_end _asm_vm_call_method_end
219 
220 #define asm_vm_call_method_exception_handler _asm_vm_call_method_exception_handler
221 
222 #define asm_handle_nat_exception _asm_handle_nat_exception
223 #define asm_handle_exception _asm_handle_exception
224 
225 #define asm_abstractmethoderror _asm_abstractmethoderror
226 
227 #define asm_cacheflush _asm_cacheflush
228 
229 
230 /* external defines ***********************************************************/
231 
232 #define builtin_throw_exception L_builtin_throw_exception$stub
233 
234 #define md_asm_codegen_get_pv_from_pc L_md_asm_codegen_get_pv_from_pc$stub
235 #define exceptions_handle_exception L_exceptions_handle_exception$stub
236 
237 #define exceptions_asm_new_abstractmethoderror \
238  L_exceptions_asm_new_abstractmethoderror$stub
239 
240 #endif // MD_ASM_HPP_
241 
242 
243 /*
244  * These are local overrides for various environment variables in Emacs.
245  * Please do not remove this and leave it at the end of the file, where
246  * Emacs will automagically detect them.
247  * ---------------------------------------------------------------------
248  * Local variables:
249  * mode: c++
250  * indent-tabs-mode: t
251  * c-basic-offset: 4
252  * tab-width: 4
253  * End:
254  */