CACAO
md-asm.hpp
Go to the documentation of this file.
1 /* src/vm/jit/sparc64/md-asm.hpp - assembler defines for Sparc 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: Christian Thalinger
26  Alexander Jordan
27 
28  Changes:
29 
30 */
31 
32 #ifndef MD_ASM_HPP_
33 #define MD_ASM_HPP_ 1
34 
35 
36 /* register defines
37  * ***********************************************************/
38 
39 #define zero %g0
40 #define itmp1 %g1
41 #define itmp2 %g2
42 #define itmp3 %g3
43 
44 /* PLT unsafe temp regs */
45 #define temp4 %g4
46 #define temp5 %g5
47 
48 #define mptr_itmp2 itmp2
49 
50 #define xptr_itmp2 itmp2
51 #define xpc_itmp3 itmp3
52 
53 #define ra_caller %o7
54 #define ra_callee %i7
55 
56 #define pv_caller %o5
57 #define pv_callee %i5
58 
59 
60 #define fv0 %f0
61 #define ft0 %f2
62 #define ft1 %f4
63 #define ft2 %f6
64 #define ft3 %f8
65 #define ft4 %f10
66 #define ft5 %f12
67 #define ft6 %f14
68 
69 #define fa0 %f16
70 #define fa0f %f17
71 #define fa1 %f18
72 #define fa1f %f19
73 #define fa2 %f20
74 #define fa2f %f21
75 #define fa3 %f22
76 #define fa3f %f23
77 #define fa4 %f24
78 #define fa4f %f25
79 #define ft7 %f26
80 #define ft8 %f28
81 #define ft9 %f30
82 
83 
84 #define bias 2047
85 
86 
87 /* save and restore macros ****************************************************/
88 
89 #define SAVE_FLOAT_RETURN_REGISTER(off) \
90  std fv0,[%sp + bias + ((off)*8)] ;
91 
92 #define RESTORE_FLOAT_RETURN_REGISTER(off) \
93  ldd [%sp + bias + ((off)*8)],fv0 ;
94 
95 
96 #define SAVE_FLOAT_ARGUMENT_REGISTERS(off) \
97  std fa0,[%sp + bias + ((0+(off))*8)] ; \
98  std fa1,[%sp + bias + ((1+(off))*8)] ; \
99  std fa2,[%sp + bias + ((2+(off))*8)] ; \
100  std fa3,[%sp + bias + ((3+(off))*8)] ; \
101  std fa4,[%sp + bias + ((4+(off))*8)] ;
102 
103 
104 #define RESTORE_FLOAT_ARGUMENT_REGISTERS(off) \
105  ldd [%sp + bias + ((0+(off))*8)],fa0 ; \
106  ldd [%sp + bias + ((1+(off))*8)],fa1 ; \
107  ldd [%sp + bias + ((2+(off))*8)],fa2 ; \
108  ldd [%sp + bias + ((3+(off))*8)],fa3 ; \
109  ldd [%sp + bias + ((4+(off))*8)],fa4 ;
110 
111 #define SAVE_FLOAT_TEMPORARY_REGISTERS(off) \
112  std ft0,[%sp + bias + ((0+(off))*8)] ; \
113  std ft1,[%sp + bias + ((1+(off))*8)] ; \
114  std ft2,[%sp + bias + ((2+(off))*8)] ; \
115  std ft3,[%sp + bias + ((3+(off))*8)] ; \
116  std ft4,[%sp + bias + ((4+(off))*8)] ; \
117  std ft5,[%sp + bias + ((5+(off))*8)] ; \
118  std ft6,[%sp + bias + ((6+(off))*8)] ; \
119  std ft7,[%sp + bias + ((7+(off))*8)] ; \
120  std ft8,[%sp + bias + ((8+(off))*8)] ; \
121  std ft9,[%sp + bias + ((9+(off))*8)] ; \
122 
123 #define RESTORE_FLOAT_TEMPORARY_REGISTERS(off) \
124  ldd [%sp + bias + ((0+(off))*8)],ft0 ; \
125  ldd [%sp + bias + ((1+(off))*8)],ft1 ; \
126  ldd [%sp + bias + ((2+(off))*8)],ft2 ; \
127  ldd [%sp + bias + ((3+(off))*8)],ft3 ; \
128  ldd [%sp + bias + ((4+(off))*8)],ft4 ; \
129  ldd [%sp + bias + ((5+(off))*8)],ft5 ; \
130  ldd [%sp + bias + ((6+(off))*8)],ft6 ; \
131  ldd [%sp + bias + ((7+(off))*8)],ft7 ; \
132  ldd [%sp + bias + ((8+(off))*8)],ft8 ; \
133  ldd [%sp + bias + ((9+(off))*8)],ft9 ; \
134 
135 
136 
137 #endif // MD_ASM_HPP_
138 
139 
140 /*
141  * These are local overrides for various environment variables in Emacs.
142  * Please do not remove this and leave it at the end of the file, where
143  * Emacs will automagically detect them.
144  *
145  * ---------------------------------------------------------------------
146  * Local variables:
147  * mode: c++
148  * indent-tabs-mode: t
149  * c-basic-offset: 4
150  * tab-width: 4
151  * End:
152  */
153