* Removed all Id tags.
[cacao.git] / src / vm / jit / arm / md-asm.h
1 /* src/vm/jit/arm/md-asm.h - assembler defines for arm ABI
2
3    Copyright (C) 1996-2005, 2006, 2007 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
7
8    This file is part of CACAO.
9
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.
14
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.
19
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
23    02110-1301, USA.
24
25    Contact: cacao@cacaojvm.org
26
27    Authors: Michael Starzinger
28             Christian Thalinger
29
30 */
31
32
33 #ifndef _MD_ASM_H
34 #define _MD_ASM_H
35
36 #include "config.h"
37
38
39 /* register defines ***********************************************************/
40
41 #define res1    r0  /* result registers         */
42 #define res2    r1
43
44 #define a0      r0  /* argument registers       */
45 #define a1      r1
46 #define a2      r2
47 #define a3      r3
48
49 #define v1      r4  /* variable registers       */
50 #define v2      r5
51 #define v3      r6
52 #define v4      r7
53 #define v5      r8
54 #define v6      r9
55 #define v7      r10
56 #define v8      r11
57
58 #define pc      r15 /* program counter          */
59 #define lr      r14 /* return address           */
60 #define sp      r13 /* stack pointer            */
61 #define ip      r12 /* something like pv        */
62 #define fp      r11 /* frame pointer (not used) */
63
64 #define itmp1   v7  /* temporary scratch regs   */
65 #define itmp2   v8
66 #define itmp3   v6
67
68 #define mptr    v8
69
70 #define xptr  itmp1 /* exception registers      */
71 #define xpc   itmp2
72
73
74 /* save and restore macros ****************************************************/
75
76 #define SAVE_ARGUMENT_REGISTERS \
77         stmfd   sp!, {a0,a1,a2,a3,lr}
78
79 #define SAVE_ARGUMENT_REGISTERS_IP \
80         stmfd   sp!, {a0,a1,a2,a3,ip,lr}
81
82 #if defined(ENABLE_SOFTFLOAT)
83 # define SAVE_FLOAT_REGISTERS
84 #else
85 # define SAVE_FLOAT_REGISTERS \
86         sfmfd   f0, 4, [sp]!; \
87         sfmfd   f4, 4, [sp]!
88 #endif
89
90 #define SAVE_SCRATCH_REGISTERS \
91         stmfd   sp!, {itmp3,itmp1,itmp2,lr}
92
93
94 #define RESTORE_ARGUMENT_REGISTERS \
95         ldmfd   sp!, {a0,a1,a2,a3,lr}
96
97 #define RESTORE_ARGUMENT_REGISTERS_IP \
98         ldmfd   sp!, {a0,a1,a2,a3,ip,lr}
99
100 #if defined(ENABLE_SOFTFLOAT)
101 # define RESTORE_FLOAT_REGISTERS
102 #else
103 # define RESTORE_FLOAT_REGISTERS \
104         lfmfd   f4, 4, [sp]!; \
105         lfmfd   f0, 4, [sp]!
106 #endif
107
108 #define RESTORE_SCRATCH_REGS_AND_RETURN \
109         ldmfd   sp!, {itmp3,itmp1,itmp2,pc}
110
111 #endif /* _MD_ASM_H */
112
113
114 /*
115  * These are local overrides for various environment variables in Emacs.
116  * Please do not remove this and leave it at the end of the file, where
117  * Emacs will automagically detect them.
118  * ---------------------------------------------------------------------
119  * Local variables:
120  * mode: c
121  * indent-tabs-mode: t
122  * c-basic-offset: 4
123  * tab-width: 4
124  * End:
125  * vim:noexpandtab:sw=4:ts=4:
126  */