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