1 /* src/vm/jit/mips/md-asm.h - assembler defines for MIPS ABI
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 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., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Christian Thalinger
31 $Id: md-asm.h 3928 2005-12-09 14:30:12Z twisti $
42 /* register defines ***********************************************************/
44 #if SIZEOF_VOID_P == 8
135 #else /* SIZEOF_VOID_P == 8 */
202 #endif /* SIZEOF_VOID_P == 8 */
204 #if SIZEOF_VOID_P == 8
209 #define aaddiu daddiu
235 /* save and restore macros ****************************************************/
237 #if SIZEOF_VOID_P == 8
239 #define SAVE_RETURN_REGISTERS(off) \
240 sd v0,(0+(off))*8(sp) ; \
241 sdc1 fv0,(1+(off))*8(sp) ;
243 #define RESTORE_RETURN_REGISTERS(off) \
244 ld v0,(0+(off))*8(sp) ; \
245 ldc1 fv0,(1+(off))*8(sp) ;
248 #define SAVE_ARGUMENT_REGISTERS(off) \
249 sd a0,(0+(off))*8(sp) ; \
250 sd a1,(1+(off))*8(sp) ; \
251 sd a2,(2+(off))*8(sp) ; \
252 sd a3,(3+(off))*8(sp) ; \
253 sd a4,(4+(off))*8(sp) ; \
254 sd a5,(5+(off))*8(sp) ; \
255 sd a6,(6+(off))*8(sp) ; \
256 sd a7,(7+(off))*8(sp) ; \
258 sdc1 fa0,(8+(off))*8(sp) ; \
259 sdc1 fa1,(9+(off))*8(sp) ; \
260 sdc1 fa2,(10+(off))*8(sp); \
261 sdc1 fa3,(11+(off))*8(sp); \
262 sdc1 fa4,(12+(off))*8(sp); \
263 sdc1 fa5,(13+(off))*8(sp); \
264 sdc1 fa6,(14+(off))*8(sp); \
265 sdc1 fa7,(15+(off))*8(sp);
267 #define RESTORE_ARGUMENT_REGISTERS(off) \
268 ld a0,(0+(off))*8(sp) ; \
269 ld a1,(1+(off))*8(sp) ; \
270 ld a2,(2+(off))*8(sp) ; \
271 ld a3,(3+(off))*8(sp) ; \
272 ld a4,(4+(off))*8(sp) ; \
273 ld a5,(5+(off))*8(sp) ; \
274 ld a6,(6+(off))*8(sp) ; \
275 ld a7,(7+(off))*8(sp) ; \
277 ldc1 fa0,(8+(off))*8(sp); \
278 ldc1 fa1,(9+(off))*8(sp); \
279 ldc1 fa2,(10+(off))*8(sp); \
280 ldc1 fa3,(11+(off))*8(sp); \
281 ldc1 fa4,(12+(off))*8(sp); \
282 ldc1 fa5,(13+(off))*8(sp); \
283 ldc1 fa6,(14+(off))*8(sp); \
284 ldc1 fa7,(15+(off))*8(sp);
287 #define SAVE_TEMPORARY_REGISTERS(off) \
288 sd t0,(0+(off))*8(sp) ; \
289 sd t1,(1+(off))*8(sp) ; \
290 sd t2,(2+(off))*8(sp) ; \
291 sd t3,(3+(off))*8(sp) ; \
292 sd t8,(4+(off))*8(sp) ; \
294 sdc1 ft3,(5+(off))*8(sp) ; \
295 sdc1 ft4,(6+(off))*8(sp) ; \
296 sdc1 ft5,(7+(off))*8(sp) ; \
297 sdc1 ft6,(8+(off))*8(sp) ; \
298 sdc1 ft7,(9+(off))*8(sp) ; \
299 sdc1 ft8,(10+(off))*8(sp) ; \
300 sdc1 ft9,(11+(off))*8(sp) ; \
301 sdc1 ft10,(12+(off))*8(sp) ; \
302 sdc1 ft11,(13+(off))*8(sp) ; \
303 sdc1 ft12,(14+(off))*8(sp) ; \
304 sdc1 ft13,(15+(off))*8(sp) ; \
305 sdc1 ft14,(16+(off))*8(sp) ; \
306 sdc1 ft15,(17+(off))*8(sp) ; \
307 sdc1 ft16,(18+(off))*8(sp) ; \
308 sdc1 ft17,(19+(off))*8(sp) ; \
309 sdc1 ft18,(20+(off))*8(sp) ;
311 #define RESTORE_TEMPORARY_REGISTERS(off) \
312 ld t0,(0+(off))*8(sp) ; \
313 ld t1,(1+(off))*8(sp) ; \
314 ld t2,(2+(off))*8(sp) ; \
315 ld t3,(3+(off))*8(sp) ; \
316 ld t8,(4+(off))*8(sp) ; \
318 ldc1 ft3,(5+(off))*8(sp) ; \
319 ldc1 ft4,(6+(off))*8(sp) ; \
320 ldc1 ft5,(7+(off))*8(sp) ; \
321 ldc1 ft6,(8+(off))*8(sp) ; \
322 ldc1 ft7,(9+(off))*8(sp) ; \
323 ldc1 ft8,(10+(off))*8(sp) ; \
324 ldc1 ft9,(11+(off))*8(sp) ; \
325 ldc1 ft10,(12+(off))*8(sp) ; \
326 ldc1 ft11,(13+(off))*8(sp) ; \
327 ldc1 ft12,(14+(off))*8(sp) ; \
328 ldc1 ft13,(15+(off))*8(sp) ; \
329 ldc1 ft14,(16+(off))*8(sp) ; \
330 ldc1 ft15,(17+(off))*8(sp) ; \
331 ldc1 ft16,(18+(off))*8(sp) ; \
332 ldc1 ft17,(19+(off))*8(sp) ; \
333 ldc1 ft18,(20+(off))*8(sp) ;
335 #else /* SIZEOF_VOID_P == 8 */
337 #define SAVE_RETURN_REGISTERS(off) \
338 sw v0,(0+(off))*4(sp) ; \
339 sw v1,(1+(off))*4(sp) ; \
340 sdc1 fv0,(2+(off))*4(sp) ;
342 #define RESTORE_RETURN_REGISTERS(off) \
343 lw v0,(0+(off))*4(sp) ; \
344 lw v1,(1+(off))*4(sp) ; \
345 ldc1 fv0,(2+(off))*4(sp) ;
348 #define SAVE_ARGUMENT_REGISTERS(off) \
349 sw a0,(0+(off))*4(sp) ; \
350 sw a1,(1+(off))*4(sp) ; \
351 sw a2,(2+(off))*4(sp) ; \
352 sw a3,(3+(off))*4(sp) ;
354 #define RESTORE_ARGUMENT_REGISTERS(off) \
355 lw a0,(0+(off))*4(sp) ; \
356 lw a1,(1+(off))*4(sp) ; \
357 lw a2,(2+(off))*4(sp) ; \
358 lw a3,(3+(off))*4(sp) ;
361 #define SAVE_TEMPORARY_REGISTERS(off) \
362 sw t0,(0+(off))*4(sp) ; \
363 sw t1,(1+(off))*4(sp) ; \
364 sw t2,(2+(off))*4(sp) ; \
365 sw t3,(3+(off))*4(sp) ; \
366 sw t4,(4+(off))*4(sp) ; \
367 sw t5,(5+(off))*4(sp) ; \
368 sw t6,(6+(off))*4(sp) ; \
369 sw t7,(7+(off))*4(sp) ;
371 #define RESTORE_TEMPORARY_REGISTERS(off) \
372 lw t0,(0+(off))*4(sp) ; \
373 lw t1,(1+(off))*4(sp) ; \
374 lw t2,(2+(off))*4(sp) ; \
375 lw t3,(3+(off))*4(sp) ; \
376 lw t4,(4+(off))*4(sp) ; \
377 lw t5,(5+(off))*4(sp) ; \
378 lw t6,(6+(off))*4(sp) ; \
379 lw t7,(7+(off))*4(sp) ;
381 #endif /* SIZEOF_VOID_P == 8 */
383 #endif /* _MD_ASM_H */
387 * These are local overrides for various environment variables in Emacs.
388 * Please do not remove this and leave it at the end of the file, where
389 * Emacs will automagically detect them.
390 * ---------------------------------------------------------------------
393 * indent-tabs-mode: t