Added and changed some SUPPORT 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 2039 2005-03-20 11:24:19Z 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_ARG_CNT      6   /* number of int argument registers              */
106 #define INT_SAV_CNT      5   /* number of int callee saved registers          */
107
108 #define FLT_ARG_CNT      8   /* number of flt argument registers              */
109 #define FLT_SAV_CNT      0   /* number of flt callee saved registers          */
110
111 #define TRACE_ARGS_NUM   6
112
113
114 /* define architecture features ***********************************************/
115
116 #define POINTERSIZE                      8
117 #define WORDS_BIGENDIAN                  0
118
119 #define U8_AVAILABLE                     1
120
121 #define USE_CODEMMAP                     1
122
123 /* #define USEBUILTINTABLE */
124
125 #define SUPPORT_DIVISION                 1
126 #define SUPPORT_LONG                     1
127 #define SUPPORT_FLOAT                    1
128 #define SUPPORT_DOUBLE                   1
129 /* #define SUPPORT_FMOD                    1 */
130 /* #define SUPPORT_IFCVT                   1 */
131 /* #define SUPPORT_FICVT                   1 */
132
133 #define SUPPORT_LONG_ADD                 1
134 #define SUPPORT_LONG_CMP                 1
135 #define SUPPORT_LONG_LOGICAL             1
136 #define SUPPORT_LONG_SHIFT               1
137 #define SUPPORT_LONG_MUL                 1
138 #define SUPPORT_LONG_DIV                 1
139 #define SUPPORT_LONG_ICVT                1
140 #define SUPPORT_LONG_FCVT                1
141
142 #define SUPPORT_CONST_LOGICAL            1  /* AND, OR, XOR with immediates   */
143 #define SUPPORT_CONST_MUL                1  /* mutiply with immediate         */
144
145 #define SUPPORT_CONST_STORE              1  /* do we support const stores     */
146 #define SUPPORT_CONST_STORE_ZERO_ONLY    0  /* on some risc machines we can   */
147                                             /* only store REG_ZERO            */
148
149 #define CONDITIONAL_LOADCONST            1
150
151 #define CONSECUTIVE_INTARGS
152 #define CONSECUTIVE_FLOATARGS
153
154 #endif /* _ARCH_H */
155
156
157 /*
158  * These are local overrides for various environment variables in Emacs.
159  * Please do not remove this and leave it at the end of the file, where
160  * Emacs will automagically detect them.
161  * ---------------------------------------------------------------------
162  * Local variables:
163  * mode: c
164  * indent-tabs-mode: t
165  * c-basic-offset: 4
166  * tab-width: 4
167  * End:
168  */