Added additional {INT,FLT}_*_CNT defines.
[cacao.git] / src / vm / jit / x86_64 / arch.h
1 /* src/vm/jit/x86_64/arch.h - architecture defines for x86_64
2
3    Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4    R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5    C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6    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., 59 Temple Place - Suite 330, Boston, MA
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Christian Thalinger
28
29    Changes:
30
31    $Id: arch.h 2413 2005-04-29 18:54:31Z twisti $
32
33 */
34
35
36 #ifndef _ARCH_H
37 #define _ARCH_H
38
39
40 /* define registers ***********************************************************/
41
42 #define RIP    -1
43 #define RAX    0
44 #define RCX    1
45 #define RDX    2
46 #define RBX    3
47 #define RSP    4
48 #define RBP    5
49 #define RSI    6
50 #define RDI    7
51 #define R8     8
52 #define R9     9
53 #define R10    10
54 #define R11    11
55 #define R12    12
56 #define R13    13
57 #define R14    14
58 #define R15    15
59
60
61 #define XMM0   0
62 #define XMM1   1
63 #define XMM2   2
64 #define XMM3   3
65 #define XMM4   4
66 #define XMM5   5
67 #define XMM6   6
68 #define XMM7   7
69 #define XMM8   8
70 #define XMM9   9
71 #define XMM10  10
72 #define XMM11  11
73 #define XMM12  12
74 #define XMM13  13
75 #define XMM14  14
76 #define XMM15  15
77
78
79 /* preallocated registers *****************************************************/
80
81 /* integer registers */
82   
83 #define REG_RESULT      RAX      /* to deliver method results                 */
84
85 #define REG_ITMP1       RAX      /* temporary register                        */
86 #define REG_ITMP2       R10      /* temporary register and method pointer     */
87 #define REG_ITMP3       R11      /* temporary register                        */
88
89 #define REG_NULL        -1       /* used for reg_of_var where d is not needed */
90
91 #define REG_ITMP1_XPTR  RAX      /* exception pointer = temporary register 1  */
92 #define REG_ITMP2_XPC   R10      /* exception pc = temporary register 2       */
93
94 #define REG_SP          RSP      /* stack pointer                             */
95
96 /* floating point registers */
97
98 #define REG_FRESULT     XMM0     /* to deliver floating point method results  */
99
100 #define REG_FTMP1       XMM8     /* temporary floating point register         */
101 #define REG_FTMP2       XMM9     /* temporary floating point register         */
102 #define REG_FTMP3       XMM10    /* temporary floating point register         */
103
104
105 #define INT_REG_CNT     16       /* number of integer registers               */
106 #define INT_SAV_CNT     5        /* number of integer callee saved registers  */
107 #define INT_ARG_CNT     6        /* number of integer argument registers      */
108 #define INT_TMP_CNT     1        /* number of integer temporary registers     */
109 #define INT_RES_CNT     3        /* number of integer reserved registers      */
110
111 #define FLT_REG_CNT     16       /* number of float registers                 */
112 #define FLT_SAV_CNT     0        /* number of float callee saved registers    */
113 #define FLT_ARG_CNT     8        /* number of float argument registers        */
114 #define FLT_TMP_CNT     5        /* number of float temporary registers       */
115 #define FLT_RES_CNT     3        /* number of float reserved registers        */
116
117 #define TRACE_ARGS_NUM   6
118
119
120 /* define architecture features ***********************************************/
121
122 #define POINTERSIZE                      8
123 #define WORDS_BIGENDIAN                  0
124
125 #define U8_AVAILABLE                     1
126
127 #define USE_CODEMMAP                     1
128
129 /* #define USEBUILTINTABLE */
130
131 #define SUPPORT_DIVISION                 1
132 #define SUPPORT_LONG                     1
133 #define SUPPORT_FLOAT                    1
134 #define SUPPORT_DOUBLE                   1
135 /* #define SUPPORT_FMOD                    1 */
136 /* #define SUPPORT_IFCVT                   1 */
137 /* #define SUPPORT_FICVT                   1 */
138
139 #define SUPPORT_LONG_ADD                 1
140 #define SUPPORT_LONG_CMP                 1
141 #define SUPPORT_LONG_LOGICAL             1
142 #define SUPPORT_LONG_SHIFT               1
143 #define SUPPORT_LONG_MUL                 1
144 #define SUPPORT_LONG_DIV                 1
145 #define SUPPORT_LONG_ICVT                1
146 #define SUPPORT_LONG_FCVT                1
147
148 #define SUPPORT_CONST_LOGICAL            1  /* AND, OR, XOR with immediates   */
149 #define SUPPORT_CONST_MUL                1  /* mutiply with immediate         */
150
151 #define SUPPORT_CONST_STORE              0  /* do we support const stores     */
152 #define SUPPORT_CONST_STORE_ZERO_ONLY    0  /* on some risc machines we can   */
153                                             /* only store REG_ZERO            */
154
155 #define CONDITIONAL_LOADCONST            1
156
157 #define CONSECUTIVE_INTEGER_ARGS
158 #define CONSECUTIVE_FLOAT_ARGS
159
160 #endif /* _ARCH_H */
161
162
163 /*
164  * These are local overrides for various environment variables in Emacs.
165  * Please do not remove this and leave it at the end of the file, where
166  * Emacs will automagically detect them.
167  * ---------------------------------------------------------------------
168  * Local variables:
169  * mode: c
170  * indent-tabs-mode: t
171  * c-basic-offset: 4
172  * tab-width: 4
173  * End:
174  */