1 /* src/vm/jit/x86_64/md-asm.h - assembler defines for x86_64 Linux ABI
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
8 This file is part of CACAO.
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.
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.
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
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
31 $Id: md-asm.h 7839 2007-04-29 22:46:56Z pm $
39 /* register defines ***********************************************************/
67 /* save and restore macros ****************************************************/
69 /* Volatile float registers (all volatile in terms of C abi) */
71 #define LOAD_STORE_VOLATILE_FLOAT_REGISTERS(inst, off) \
72 inst %f0, ((0 * 8) + (off))(sp); \
73 inst %f2, ((1 * 8) + (off))(sp); \
74 inst %f1, ((2 * 8) + (off))(sp); \
75 inst %f3, ((3 * 8) + (off))(sp); \
76 inst %f5, ((4 * 8) + (off))(sp); \
77 inst %f7, ((5 * 8) + (off))(sp); \
78 inst %f8, ((6 * 8) + (off))(sp); \
79 inst %f9, ((7 * 8) + (off))(sp); \
80 inst %f10, ((8 * 8) + (off))(sp); \
81 inst %f11, ((9 * 8) + (off))(sp); \
82 inst %f12, ((10 * 8) + (off))(sp); \
83 inst %f13, ((11 * 8) + (off))(sp); \
84 inst %f14, ((12 * 8) + (off))(sp); \
85 inst %f15, ((13 * 8) + (off))(sp);
87 #define VOLATILE_FLOAT_REGISTERS_SIZE (14 * 8)
89 #define LOAD_VOLATILE_FLOAT_REGISTERS(off) LOAD_STORE_VOLATILE_FLOAT_REGISTERS(ld, off)
90 #define STORE_VOLATILE_FLOAT_REGISTERS(off) LOAD_STORE_VOLATILE_FLOAT_REGISTERS(std, off)
92 /* Volatile integer registers (all volatile in terms of C abi) */
94 #define LOAD_STORE_VOLATILE_INTEGER_REGISTERS(instm, inst, off) \
95 instm %r0, %r5, ((0 * 4) + (off))(sp); \
96 inst %r14, ((6 * 4) + (off))(sp);
98 #define VOLATILE_INTEGER_REGISTERS_SIZE (7 * 4)
100 #define LOAD_VOLATILE_INTEGER_REGISTERS(off) LOAD_STORE_VOLATILE_INTEGER_REGISTERS(lm, l, off)
101 #define STORE_VOLATILE_INTEGER_REGISTERS(off) LOAD_STORE_VOLATILE_INTEGER_REGISTERS(stm, st, off)
103 /* Argument registers (in terms of JAVA an C abi) */
105 #define ARGUMENT_REGISTERS_SIZE ((5 * 4) + (2 * 8))
107 #define LOAD_STORE_ARGUMENT_REGISTERS(iinst, finst, off) \
108 iinst %r2, %r6, (off)(sp) ; \
109 finst %f0, (off + (5 * 4))(sp) ; \
110 finst %f2, (off + (5 * 4) + 8)(sp)
112 #define STORE_ARGUMENT_REGISTERS(off) LOAD_STORE_ARGUMENT_REGISTERS(stm, std, off)
113 #define LOAD_ARGUMENT_REGISTERS(off) LOAD_STORE_ARGUMENT_REGISTERS(lm, ld, off)
115 /* Temporary registers (in terms of JAVA abi) */
117 #define TEMPORARY_REGISTERS_SIZE ((1 * 4) + (12 * 8))
119 #define LOAD_STORE_TEMPORARY_REGISTERS(iinst, finst, off) \
120 finst %f1, ((0 * 8) + (off))(sp); \
121 finst %f3, ((1 * 8) + (off))(sp); \
122 finst %f5, ((2 * 8) + (off))(sp); \
123 finst %f7, ((3 * 8) + (off))(sp); \
124 finst %f8, ((4 * 8) + (off))(sp); \
125 finst %f9, ((5 * 8) + (off))(sp); \
126 finst %f10, ((6 * 8) + (off))(sp); \
127 finst %f11, ((7 * 8) + (off))(sp); \
128 finst %f12, ((8 * 8) + (off))(sp); \
129 finst %f13, ((9 * 8) + (off))(sp); \
130 finst %f14, ((10 * 8) + (off))(sp); \
131 finst %f15, ((11 * 8) + (off))(sp); \
132 iinst %r0, ((12 * 8) + (off))(sp);
134 #define LOAD_TEMPORARY_REGISTERS(off) LOAD_STORE_TEMPORARY_REGISTERS(l, ld, off)
135 #define STORE_TEMPORARY_REGISTERS(off) LOAD_STORE_TEMPORARY_REGISTERS(st, std, off)
137 #endif /* _MD_ASM_H */
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 * ---------------------------------------------------------------------
147 * indent-tabs-mode: t