1cde57b07c630d5f9d5ac26bdd18e4a4c4f1f6c0
[cacao.git] / src / vm / jit / x86_64 / arch.h
1 /* jit/x86_64/arch.h - architecture defines for x86_64
2
3    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4    R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5    M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6    P. Tomsich, J. Wenninger
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    $Id: arch.h 1667 2004-12-03 16:38:55Z twisti $
30
31 */
32
33
34 #ifndef _ARCH_H
35 #define _ARCH_H
36
37
38 /* define registers ***********************************************************/
39
40 #define RIP    -1
41 #define RAX    0
42 #define RCX    1
43 #define RDX    2
44 #define RBX    3
45 #define RSP    4
46 #define RBP    5
47 #define RSI    6
48 #define RDI    7
49 #define R8     8
50 #define R9     9
51 #define R10    10
52 #define R11    11
53 #define R12    12
54 #define R13    13
55 #define R14    14
56 #define R15    15
57
58
59 #define XMM0   0
60 #define XMM1   1
61 #define XMM2   2
62 #define XMM3   3
63 #define XMM4   4
64 #define XMM5   5
65 #define XMM6   6
66 #define XMM7   7
67 #define XMM8   8
68 #define XMM9   9
69 #define XMM10  10
70 #define XMM11  11
71 #define XMM12  12
72 #define XMM13  13
73 #define XMM14  14
74 #define XMM15  15
75
76
77 /* preallocated registers *****************************************************/
78
79 /* integer registers */
80   
81 #define REG_RESULT      RAX      /* to deliver method results                 */
82
83 #define REG_ITMP1       RAX      /* temporary register                        */
84 #define REG_ITMP2       R10      /* temporary register and method pointer     */
85 #define REG_ITMP3       R11      /* temporary register                        */
86
87 #define REG_NULL        -1       /* used for reg_of_var where d is not needed */
88
89 #define REG_ITMP1_XPTR  RAX      /* exception pointer = temporary register 1  */
90 #define REG_ITMP2_XPC   R10      /* exception pc = temporary register 2       */
91
92 #define REG_SP          RSP      /* stack pointer                             */
93
94 /* floating point registers */
95
96 #define REG_FRESULT     XMM0     /* to deliver floating point method results  */
97
98 #define REG_FTMP1       XMM8     /* temporary floating point register         */
99 #define REG_FTMP2       XMM9     /* temporary floating point register         */
100 #define REG_FTMP3       XMM10    /* temporary floating point register         */
101
102
103 #define INT_ARG_CNT      6   /* number of int argument registers              */
104 #define INT_SAV_CNT      5   /* number of int callee saved registers          */
105
106 #define FLT_ARG_CNT      4   /* number of flt argument registers              */
107 #define FLT_SAV_CNT      0   /* number of flt callee saved registers          */
108
109 #define TRACE_ARGS_NUM   6
110
111
112 /* define architecture features ***********************************************/
113
114 #define POINTERSIZE              8
115 #define WORDS_BIGENDIAN          0
116
117 #define U8_AVAILABLE             1
118
119 #define USE_CODEMMAP             1
120
121 #define SUPPORT_DIVISION         1
122 #define SUPPORT_LONG             1
123 #define SUPPORT_FLOAT            1
124 #define SUPPORT_DOUBLE           1
125 /* #define SUPPORT_FMOD             1 */
126 /* #define SUPPORT_IFCVT            1 */
127 /* #define SUPPORT_FICVT            1 */
128
129 #define SUPPORT_LONG_ADD         1
130 #define SUPPORT_LONG_CMP         1
131 #define SUPPORT_LONG_LOG         1
132 #define SUPPORT_LONG_SHIFT       1
133 #define SUPPORT_LONG_MUL         1
134 #define SUPPORT_LONG_DIV         1
135 #define SUPPORT_LONG_ICVT        1
136 #define SUPPORT_LONG_FCVT        1
137
138 #define SUPPORT_CONST_ASTORE     1      /* do we support const astores        */
139 #define SUPPORT_ONLY_ZERO_ASTORE 0      /* on risc machines we can only store */
140                                         /* REG_ZERO                           */
141
142 /* #define USEBUILTINTABLE */
143
144 #define CONDITIONAL_LOADCONST
145
146 #define CONSECUTIVE_INTARGS
147 #define CONSECUTIVE_FLOATARGS
148
149 #endif /* _ARCH_H */
150
151
152 /*
153  * These are local overrides for various environment variables in Emacs.
154  * Please do not remove this and leave it at the end of the file, where
155  * Emacs will automagically detect them.
156  * ---------------------------------------------------------------------
157  * Local variables:
158  * mode: c
159  * indent-tabs-mode: t
160  * c-basic-offset: 4
161  * tab-width: 4
162  * End:
163  */