PR148 - support for LCMP bytecode
[cacao.git] / src / vm / jit / i386 / arch.h
1 /* src/vm/jit/i386/arch.h - architecture defines for i386
2
3    Copyright (C) 1996-2010
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _ARCH_H
27 #define _ARCH_H
28
29 #define JIT_COMPILER_VIA_SIGNAL
30
31 #include "config.h"
32
33
34 /* define x86 register numbers ************************************************/
35
36 #if !defined(__SOLARIS__) || !defined(SKIP_REG_DEFS)
37
38 #if defined(__SOLARIS__)
39
40 #undef EAX
41 #undef ECX
42 #undef EDX
43 #undef EBX
44 #undef ESP
45 #undef EBP
46 #undef ESI
47 #undef EDI
48
49 #endif
50
51 #define EAX    0
52 #define ECX    1
53 #define EDX    2
54 #define EBX    3
55 #define ESP    4
56 #define EBP    5
57 #define ESI    6
58 #define EDI    7
59
60 #endif
61
62 /* define architecture features ***********************************************/
63
64 #define SUPPORT_DIVISION                 1
65 #define SUPPORT_LONG                     1
66
67 #define SUPPORT_I2F                      1
68 #define SUPPORT_I2D                      1
69 #define SUPPORT_L2F                      1
70 #define SUPPORT_L2D                      1
71
72 /* ATTENTION: i386 architectures support these conversions, but we
73    need the builtin functions in corner cases */
74 #define SUPPORT_F2I                      0
75 #define SUPPORT_F2L                      0
76 #define SUPPORT_D2I                      0
77 #define SUPPORT_D2L                      0
78
79 #define SUPPORT_LONG_ADD                 1
80 #define SUPPORT_LONG_CMP                 0
81 #define SUPPORT_LONG_CMP_CONST           1
82 #define SUPPORT_LONG_LOGICAL             1
83 #define SUPPORT_LONG_SHIFT               1
84 #define SUPPORT_LONG_MUL                 1
85 #define SUPPORT_LONG_DIV                 0
86
87 #define SUPPORT_LONG_DIV_POW2            1
88 #define SUPPORT_LONG_REM_POW2            0
89
90 #define SUPPORT_CONST_LOGICAL            1  /* AND, OR, XOR with immediates   */
91 #define SUPPORT_CONST_MUL                1  /* mutiply with immediate         */
92
93 #define SUPPORT_CONST_STORE              1  /* do we support const stores     */
94 #define SUPPORT_CONST_STORE_ZERO_ONLY    0  /* on some risc machines we can   */
95                                             /* only store REG_ZERO            */
96
97
98 /* float **********************************************************************/
99
100 #define SUPPORT_FLOAT                    1
101
102 #if defined(ENABLE_SOFT_FLOAT_CMP)
103 # define SUPPORT_FLOAT_CMP               0
104 #else
105 # define SUPPORT_FLOAT_CMP               1
106 #endif
107
108
109 /* double *********************************************************************/
110
111 #define SUPPORT_DOUBLE                   1
112
113 #if defined(ENABLE_SOFT_FLOAT_CMP)
114 # define SUPPORT_DOUBLE_CMP              0
115 #else
116 # define SUPPORT_DOUBLE_CMP              1
117 #endif
118
119
120 /* define SUPPORT_COMBINE_INTEGER_REGISTERS */
121
122
123 /* branches *******************************************************************/
124
125 #define SUPPORT_BRANCH_CONDITIONAL_CONDITION_REGISTER       1
126 #define SUPPORT_BRANCH_CONDITIONAL_ONE_INTEGER_REGISTER     0
127 #define SUPPORT_BRANCH_CONDITIONAL_TWO_INTEGER_REGISTERS    0
128 #define SUPPORT_BRANCH_CONDITIONAL_UNSIGNED_CONDITIONS      1
129
130
131 /* exceptions *****************************************************************/
132
133 #define SUPPORT_HARDWARE_DIVIDE_BY_ZERO  1
134
135
136 /* stackframe *****************************************************************/
137
138 #define STACKFRMAE_RA_BETWEEN_FRAMES              1
139 #define STACKFRAME_RA_TOP_OF_FRAME                0
140 #define STACKFRAME_RA_LINKAGE_AREA                0
141 #define STACKFRAME_LEAFMETHODS_RA_REGISTER        0
142 #define STACKFRAME_SYNC_NEEDS_TWO_SLOTS           0
143
144
145 /* replacement ****************************************************************/
146
147 #define REPLACEMENT_PATCH_SIZE           2       /* bytes */
148
149 /* subtype ********************************************************************/
150
151 #define USES_NEW_SUBTYPE                 1
152
153 /* memory barriers ************************************************************/
154
155 #define CAS_PROVIDES_FULL_BARRIER        1
156
157 #endif /* _ARCH_H */
158
159
160 /*
161  * These are local overrides for various environment variables in Emacs.
162  * Please do not remove this and leave it at the end of the file, where
163  * Emacs will automagically detect them.
164  * ---------------------------------------------------------------------
165  * Local variables:
166  * mode: c
167  * indent-tabs-mode: t
168  * c-basic-offset: 4
169  * tab-width: 4
170  * End:
171  */