Initial import of s390 codegen, codebase is copyed from x86_64.
[cacao.git] / src / vm / jit / s390 / md-asm.h
1 /* src/vm/jit/x86_64/md-asm.h - assembler defines for x86_64 Linux 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: Christian Thalinger
28
29    Changes:
30
31    $Id: md-asm.h 7219 2007-01-16 22:18:57Z pm $
32
33 */
34
35
36 #ifndef _MD_ASM_H
37 #define _MD_ASM_H
38
39 /* register defines ***********************************************************/
40
41 #if 0
42
43 #define v0       %rax
44 #define v0l      %eax
45 #define itmp1    v0
46
47 #define a3       %rcx
48 #define a2       %rdx
49
50 #define t0       %rbx
51 #define t0l      %ebx
52
53 #define sp       %rsp
54 #define s0       %rbp
55
56 #define a1       %rsi
57 #define a0       %rdi
58 #define a0l      %edi
59
60 #define a4       %r8
61 #define a5       %r9
62
63 #define itmp2    %r10
64 #define itmp3    %r14
65
66 #define s1       %r12
67 #define s2       %r13
68 #define s3       %r14
69 #define s4       %r15
70
71
72 #define bp       s0
73
74 #define itmp1l   %eax
75 #define itmp2l   %r10d
76 #define itmp3l   %r11d
77
78 #define xptr     itmp1
79 #define xpc      itmp2
80 #define mptr     itmp2
81
82
83 #define fa0      %xmm0
84 #define fa1      %xmm1
85 #define fa2      %xmm2
86 #define fa3      %xmm3
87 #define fa4      %xmm4
88 #define fa5      %xmm5
89 #define fa6      %xmm6
90 #define fa7      %xmm7
91
92 #define ftmp1    %xmm8
93 #define ftmp2    %xmm9
94 #define ftmp3    %xmm10
95
96 #define ft0      %xmm11
97 #define ft1      %xmm12
98 #define ft2      %xmm13
99 #define ft3      %xmm14
100 #define ft4      %xmm15
101
102 #endif
103
104 #define a0       %r2
105 #define a1       %r3
106 #define a2       %r4
107 #define a3       %r5
108 #define a4       %r6
109
110 #define sp       %r15
111 #define itmp1    %r0
112 #define itmp2    %r1
113 #define itmp3    %r14
114 #define v0       %r2
115 #define pv       %r13
116
117 #define mptr     itmp2
118
119 #define s0 %r7
120 #define s1 %r8
121 #define s2 %r9
122 #define s3 %r10
123 #define s4 %r11
124 #define s5 %r12
125
126 #define fa0 %f0
127 #define fa1 %f2
128
129 /* save and restore macros ****************************************************/
130
131 #define SAVE_ARGUMENT_REGISTERS(off) \
132         mov     a0,(0+(off))*8(sp)   ; \
133         mov     a1,(1+(off))*8(sp)   ; \
134         mov     a2,(2+(off))*8(sp)   ; \
135         mov     a3,(3+(off))*8(sp)   ; \
136         mov     a4,(4+(off))*8(sp)   ; \
137         mov     a5,(5+(off))*8(sp)   ; \
138         \
139         movq    fa0,(6+(off))*8(sp)  ; \
140         movq    fa1,(7+(off))*8(sp)  ; \
141         movq    fa2,(8+(off))*8(sp)  ; \
142         movq    fa3,(9+(off))*8(sp)  ; \
143         movq    fa4,(10+(off))*8(sp) ; \
144         movq    fa5,(11+(off))*8(sp) ; \
145         movq    fa6,(12+(off))*8(sp) ; \
146         movq    fa7,(13+(off))*8(sp) ;
147
148
149 #define RESTORE_ARGUMENT_REGISTERS(off) \
150         mov     (0+(off))*8(sp),a0   ; \
151         mov     (1+(off))*8(sp),a1   ; \
152         mov     (2+(off))*8(sp),a2   ; \
153         mov     (3+(off))*8(sp),a3   ; \
154         mov     (4+(off))*8(sp),a4   ; \
155         mov     (5+(off))*8(sp),a5   ; \
156         \
157         movq    (6+(off))*8(sp),fa0  ; \
158         movq    (7+(off))*8(sp),fa1  ; \
159         movq    (8+(off))*8(sp),fa2  ; \
160         movq    (9+(off))*8(sp),fa3  ; \
161         movq    (10+(off))*8(sp),fa4 ; \
162         movq    (11+(off))*8(sp),fa5 ; \
163         movq    (12+(off))*8(sp),fa6 ; \
164         movq    (13+(off))*8(sp),fa7 ;
165
166
167 #define SAVE_TEMPORARY_REGISTERS(off) \
168         mov     t0,(0+(off))*8(sp)   ; \
169         movq    ft0,(1+(off))*8(sp)  ; \
170         movq    ft1,(2+(off))*8(sp)  ; \
171         movq    ft2,(3+(off))*8(sp)  ; \
172         movq    ft3,(4+(off))*8(sp)  ;
173
174
175 #define RESTORE_TEMPORARY_REGISTERS(off) \
176         mov     (0+(off))*8(sp),t0   ; \
177         movq    (1+(off))*8(sp),ft0  ; \
178         movq    (2+(off))*8(sp),ft1  ; \
179         movq    (3+(off))*8(sp),ft2  ; \
180         movq    (4+(off))*8(sp),ft3  ;
181
182 #endif /* _MD_ASM_H */
183
184
185 /*
186  * These are local overrides for various environment variables in Emacs.
187  * Please do not remove this and leave it at the end of the file, where
188  * Emacs will automagically detect them.
189  * ---------------------------------------------------------------------
190  * Local variables:
191  * mode: c
192  * indent-tabs-mode: t
193  * c-basic-offset: 4
194  * tab-width: 4
195  * End:
196  */