1 /* src/vm/jit/sparc64/md-abi.h - defines for Sparc 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: Alexander Jordan
36 /* preallocated registers *****************************************************/
38 /* integer registers */
40 #define REG_RESULT_CALLEE 24 /* to deliver method results */
41 #define REG_RESULT_CALLER 8 /* to read method results */
43 #define REG_RA_CALLEE 31 /* callee reads return address here */
44 #define REG_RA_CALLER 15 /* caller puts address of call instr here */
46 #define REG_PV_CALLEE 29 /* procedure vector, as found by callee */
47 #define REG_PV_CALLER 13 /* caller provides PV here */
50 #define REG_METHODPTR 2 /* pointer to the place from where the procedure */
51 /* vector has been fetched */
54 #define REG_ITMP1 1 /* temporary register (scratch) */
55 #define REG_ITMP2 2 /* temporary register (application) */
56 #define REG_ITMP3 3 /* temporary register (application) */
58 #define REG_ITMP2_XPTR 2 /* exception pointer = temporary register 2 */
59 #define REG_ITMP3_XPC 3 /* exception pc = temporary register 3 */
61 #define REG_SP 14 /* stack pointer */
62 #define REG_FP 30 /* frame pointer */
63 #define REG_ZERO 0 /* always zero */
65 #define REG_OUT0 8 /* define some argument registers */
70 #define REG_OUT5 13 /* available only when doing a C-call */
72 /* floating point registers */
73 /* only using the lower half of the floating registers for now */
76 #define REG_FRESULT 0 /* to deliver floating point method results */
78 #define REG_FTMP1 1 /* temporary floating point register */
79 #define REG_FTMP2 2 /* temporary floating point register */
80 #define REG_FTMP3 3 /* temporary floating point register */
82 #define REG_IFTMP 1 /* temporary integer and floating point register */
87 #define INT_REG_CNT 32 /* number of integer registers */
88 #define INT_SAV_CNT 13 /* number of int callee saved registers */
89 #define INT_ARG_CNT 5 /* number of int argument registers (-1 for PV) */
90 #define INT_TMP_CNT 0 /* int temp registers (%g4-%g5) */
91 #define INT_RES_CNT 14 /* number of reserved integer registers */
92 /* pv, zero, %g6, %g7, sp, ra */
94 #define FLT_REG_CNT 16 /* number of float registers */
95 #define FLT_SAV_CNT 0 /* number of flt callee saved registers */
96 #define FLT_ARG_CNT 5 /* number of flt argument registers */
97 #define FLT_TMP_CNT 7 /* number of flt temp registers */
98 #define FLT_RES_CNT 3 /* number of reserved float registers */
99 /* the one "missing" register is the return reg */
101 /* different argument counts when following the ABI for native functions */
102 #define INT_NATARG_CNT 6
103 #define FLT_NATARG_CNT 16
105 #define TRACE_ARGS_NUM 6
107 /* helpers for stack addressing and window handling */
109 #define BIAS 2047 /* SPARC V9: stack @ address SP + BIAS */
111 /* SPARC ABI always wants argument slots on the stack, even when not used */
113 #define WINSAVE_CNT 16 /* number of regs that SPARC saves onto stack */
114 #define ABIPARAMS_CNT 6 /* param slots the ABI always requires on stack */
116 #define JITSTACK_CNT (WINSAVE_CNT + ABIPARAMS_CNT)
117 #define CSTACK_CNT (WINSAVE_CNT + ABIPARAMS_CNT)
119 #define JITSTACK ((JITSTACK_CNT) * 8 + BIAS)
120 #define CSTACK ((CSTACK_CNT) * 8 + BIAS)
124 /* applies when the caller's window was saved */
125 #define REG_WINDOW_TRANSPOSE(reg) \
128 #endif /* _MD_ABI_H */
132 * These are local overrides for various environment variables in Emacs.
133 * Please do not remove this and leave it at the end of the file, where
134 * Emacs will automagically detect them.
135 * ---------------------------------------------------------------------
138 * indent-tabs-mode: t
142 * vim:noexpandtab:sw=4:ts=4: