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