1 /* src/vm/jit/mips/md-asm.h - assembler defines for MIPS ABI
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
31 $Id: md-asm.h 7224 2007-01-18 11:43:03Z twisti $
42 /* register defines ***********************************************************/
44 #if SIZEOF_VOID_P == 8
134 #else /* SIZEOF_VOID_P == 8 */
201 #endif /* SIZEOF_VOID_P == 8 */
203 #if SIZEOF_VOID_P == 8
208 #define aaddiu daddiu
234 /* save and restore macros ****************************************************/
236 #if SIZEOF_VOID_P == 8
238 #define SAVE_RETURN_REGISTERS(off) \
239 sd v0,(0+(off))*8(sp) ; \
240 sdc1 fv0,(1+(off))*8(sp) ;
242 #define RESTORE_RETURN_REGISTERS(off) \
243 ld v0,(0+(off))*8(sp) ; \
244 ldc1 fv0,(1+(off))*8(sp) ;
247 #define SAVE_ARGUMENT_REGISTERS(off) \
248 sd a0,(0+(off))*8(sp) ; \
249 sd a1,(1+(off))*8(sp) ; \
250 sd a2,(2+(off))*8(sp) ; \
251 sd a3,(3+(off))*8(sp) ; \
252 sd a4,(4+(off))*8(sp) ; \
253 sd a5,(5+(off))*8(sp) ; \
254 sd a6,(6+(off))*8(sp) ; \
255 sd a7,(7+(off))*8(sp) ; \
257 sdc1 fa0,(8+(off))*8(sp) ; \
258 sdc1 fa1,(9+(off))*8(sp) ; \
259 sdc1 fa2,(10+(off))*8(sp); \
260 sdc1 fa3,(11+(off))*8(sp); \
261 sdc1 fa4,(12+(off))*8(sp); \
262 sdc1 fa5,(13+(off))*8(sp); \
263 sdc1 fa6,(14+(off))*8(sp); \
264 sdc1 fa7,(15+(off))*8(sp);
266 #define RESTORE_ARGUMENT_REGISTERS(off) \
267 ld a0,(0+(off))*8(sp) ; \
268 ld a1,(1+(off))*8(sp) ; \
269 ld a2,(2+(off))*8(sp) ; \
270 ld a3,(3+(off))*8(sp) ; \
271 ld a4,(4+(off))*8(sp) ; \
272 ld a5,(5+(off))*8(sp) ; \
273 ld a6,(6+(off))*8(sp) ; \
274 ld a7,(7+(off))*8(sp) ; \
276 ldc1 fa0,(8+(off))*8(sp); \
277 ldc1 fa1,(9+(off))*8(sp); \
278 ldc1 fa2,(10+(off))*8(sp); \
279 ldc1 fa3,(11+(off))*8(sp); \
280 ldc1 fa4,(12+(off))*8(sp); \
281 ldc1 fa5,(13+(off))*8(sp); \
282 ldc1 fa6,(14+(off))*8(sp); \
283 ldc1 fa7,(15+(off))*8(sp);
286 #define SAVE_TEMPORARY_REGISTERS(off) \
287 sd t0,(0+(off))*8(sp) ; \
288 sd t1,(1+(off))*8(sp) ; \
289 sd t2,(2+(off))*8(sp) ; \
290 sd t3,(3+(off))*8(sp) ; \
291 sd t4,(4+(off))*8(sp) ; \
293 sdc1 ft3,(5+(off))*8(sp) ; \
294 sdc1 ft4,(6+(off))*8(sp) ; \
295 sdc1 ft5,(7+(off))*8(sp) ; \
296 sdc1 ft6,(8+(off))*8(sp) ; \
297 sdc1 ft7,(9+(off))*8(sp) ; \
298 sdc1 ft8,(10+(off))*8(sp) ; \
299 sdc1 ft9,(11+(off))*8(sp) ; \
300 sdc1 ft10,(12+(off))*8(sp) ; \
301 sdc1 ft11,(13+(off))*8(sp) ; \
302 sdc1 ft12,(14+(off))*8(sp) ; \
303 sdc1 ft13,(15+(off))*8(sp) ; \
304 sdc1 ft14,(16+(off))*8(sp) ; \
305 sdc1 ft15,(17+(off))*8(sp) ; \
306 sdc1 ft16,(18+(off))*8(sp) ; \
307 sdc1 ft17,(19+(off))*8(sp) ; \
308 sdc1 ft18,(20+(off))*8(sp) ;
310 #define RESTORE_TEMPORARY_REGISTERS(off) \
311 ld t0,(0+(off))*8(sp) ; \
312 ld t1,(1+(off))*8(sp) ; \
313 ld t2,(2+(off))*8(sp) ; \
314 ld t3,(3+(off))*8(sp) ; \
315 ld t4,(4+(off))*8(sp) ; \
317 ldc1 ft3,(5+(off))*8(sp) ; \
318 ldc1 ft4,(6+(off))*8(sp) ; \
319 ldc1 ft5,(7+(off))*8(sp) ; \
320 ldc1 ft6,(8+(off))*8(sp) ; \
321 ldc1 ft7,(9+(off))*8(sp) ; \
322 ldc1 ft8,(10+(off))*8(sp) ; \
323 ldc1 ft9,(11+(off))*8(sp) ; \
324 ldc1 ft10,(12+(off))*8(sp) ; \
325 ldc1 ft11,(13+(off))*8(sp) ; \
326 ldc1 ft12,(14+(off))*8(sp) ; \
327 ldc1 ft13,(15+(off))*8(sp) ; \
328 ldc1 ft14,(16+(off))*8(sp) ; \
329 ldc1 ft15,(17+(off))*8(sp) ; \
330 ldc1 ft16,(18+(off))*8(sp) ; \
331 ldc1 ft17,(19+(off))*8(sp) ; \
332 ldc1 ft18,(20+(off))*8(sp) ;
334 #else /* SIZEOF_VOID_P == 8 */
336 #define SAVE_RETURN_REGISTERS(off) \
337 sw v0,(0+(off))*4(sp) ; \
338 sw v1,(1+(off))*4(sp) ; \
339 sdc1 fv0,(2+(off))*4(sp) ;
341 #define RESTORE_RETURN_REGISTERS(off) \
342 lw v0,(0+(off))*4(sp) ; \
343 lw v1,(1+(off))*4(sp) ; \
344 ldc1 fv0,(2+(off))*4(sp) ;
347 #define SAVE_ARGUMENT_REGISTERS(off) \
348 sw a0,(0+(off))*4(sp) ; \
349 sw a1,(1+(off))*4(sp) ; \
350 sw a2,(2+(off))*4(sp) ; \
351 sw a3,(3+(off))*4(sp) ; \
352 sdc1 fa0,(4+(off))*4(sp) ; \
353 sdc1 fa1,(6+(off))*4(sp) ;
355 #define RESTORE_ARGUMENT_REGISTERS(off) \
356 lw a0,(0+(off))*4(sp) ; \
357 lw a1,(1+(off))*4(sp) ; \
358 lw a2,(2+(off))*4(sp) ; \
359 lw a3,(3+(off))*4(sp) ; \
360 ldc1 fa0,(4+(off))*4(sp) ; \
361 ldc1 fa1,(6+(off))*4(sp) ;
364 #define SAVE_TEMPORARY_REGISTERS(off) \
365 sw t0,(0+(off))*4(sp) ; \
366 sw t1,(1+(off))*4(sp) ; \
367 sw t2,(2+(off))*4(sp) ; \
368 sw t3,(3+(off))*4(sp) ; \
369 sw t4,(4+(off))*4(sp) ; \
370 sw t5,(5+(off))*4(sp) ; \
371 sw t6,(6+(off))*4(sp) ; \
372 sw t7,(7+(off))*4(sp) ; \
373 sdc1 ft0,(8+(off))*4(sp) ; \
374 sdc1 ft1,(10+(off))*4(sp) ; \
375 sdc1 ft2,(12+(off))*4(sp) ; \
376 sdc1 ft3,(14+(off))*4(sp) ;
378 #define RESTORE_TEMPORARY_REGISTERS(off) \
379 lw t0,(0+(off))*4(sp) ; \
380 lw t1,(1+(off))*4(sp) ; \
381 lw t2,(2+(off))*4(sp) ; \
382 lw t3,(3+(off))*4(sp) ; \
383 lw t4,(4+(off))*4(sp) ; \
384 lw t5,(5+(off))*4(sp) ; \
385 lw t6,(6+(off))*4(sp) ; \
386 lw t7,(7+(off))*4(sp) ; \
387 ldc1 ft0,(8+(off))*4(sp) ; \
388 ldc1 ft1,(10+(off))*4(sp) ; \
389 ldc1 ft2,(12+(off))*4(sp) ; \
390 ldc1 ft3,(14+(off))*4(sp) ;
392 #endif /* SIZEOF_VOID_P == 8 */
394 #endif /* _MD_ASM_H */
398 * These are local overrides for various environment variables in Emacs.
399 * Please do not remove this and leave it at the end of the file, where
400 * Emacs will automagically detect them.
401 * ---------------------------------------------------------------------
404 * indent-tabs-mode: t