author | prr |
Wed, 15 Apr 2015 14:28:43 -0700 | |
changeset 30465 | a77083748efc |
parent 25715 | d5a8dbdc5150 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
22234
diff
changeset
|
2 |
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef CPU_SPARC_VM_REGISTER_SPARC_HPP |
26 |
#define CPU_SPARC_VM_REGISTER_SPARC_HPP |
|
27 |
||
28 |
#include "asm/register.hpp" |
|
29 |
||
1 | 30 |
// forward declaration |
31 |
class Address; |
|
32 |
class VMRegImpl; |
|
33 |
typedef VMRegImpl* VMReg; |
|
34 |
||
35 |
||
36 |
// Use Register as shortcut |
|
37 |
class RegisterImpl; |
|
38 |
typedef RegisterImpl* Register; |
|
39 |
||
40 |
||
41 |
inline Register as_Register(int encoding) { |
|
42 |
return (Register)(intptr_t) encoding; |
|
43 |
} |
|
44 |
||
45 |
// The implementation of integer registers for the SPARC architecture |
|
46 |
class RegisterImpl: public AbstractRegisterImpl { |
|
47 |
public: |
|
48 |
enum { |
|
49 |
log_set_size = 3, // the number of bits to encode the set register number |
|
50 |
number_of_sets = 4, // the number of registers sets (in, local, out, global) |
|
51 |
number_of_registers = number_of_sets << log_set_size, |
|
52 |
||
53 |
iset_no = 3, ibase = iset_no << log_set_size, // the in register set |
|
54 |
lset_no = 2, lbase = lset_no << log_set_size, // the local register set |
|
55 |
oset_no = 1, obase = oset_no << log_set_size, // the output register set |
|
56 |
gset_no = 0, gbase = gset_no << log_set_size // the global register set |
|
57 |
}; |
|
58 |
||
59 |
||
60 |
friend Register as_Register(int encoding); |
|
61 |
// set specific construction |
|
62 |
friend Register as_iRegister(int number); |
|
63 |
friend Register as_lRegister(int number); |
|
64 |
friend Register as_oRegister(int number); |
|
65 |
friend Register as_gRegister(int number); |
|
66 |
||
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
22234
diff
changeset
|
67 |
inline VMReg as_VMReg(); |
1 | 68 |
|
69 |
// accessors |
|
70 |
int encoding() const { assert(is_valid(), "invalid register"); return value(); } |
|
71 |
const char* name() const; |
|
72 |
||
73 |
// testers |
|
74 |
bool is_valid() const { return (0 <= (value()&0x7F) && (value()&0x7F) < number_of_registers); } |
|
75 |
bool is_even() const { return (encoding() & 1) == 0; } |
|
76 |
bool is_in() const { return (encoding() >> log_set_size) == iset_no; } |
|
77 |
bool is_local() const { return (encoding() >> log_set_size) == lset_no; } |
|
78 |
bool is_out() const { return (encoding() >> log_set_size) == oset_no; } |
|
79 |
bool is_global() const { return (encoding() >> log_set_size) == gset_no; } |
|
80 |
||
81 |
// derived registers, offsets, and addresses |
|
82 |
Register successor() const { return as_Register(encoding() + 1); } |
|
83 |
||
84 |
int input_number() const { |
|
85 |
assert(is_in(), "must be input register"); |
|
86 |
return encoding() - ibase; |
|
87 |
} |
|
88 |
||
89 |
Register after_save() const { |
|
90 |
assert(is_out() || is_global(), "register not visible after save"); |
|
91 |
return is_out() ? as_Register(encoding() + (ibase - obase)) : (const Register)this; |
|
92 |
} |
|
93 |
||
94 |
Register after_restore() const { |
|
95 |
assert(is_in() || is_global(), "register not visible after restore"); |
|
96 |
return is_in() ? as_Register(encoding() + (obase - ibase)) : (const Register)this; |
|
97 |
} |
|
98 |
||
99 |
int sp_offset_in_saved_window() const { |
|
100 |
assert(is_in() || is_local(), "only i and l registers are saved in frame"); |
|
101 |
return encoding() - lbase; |
|
102 |
} |
|
103 |
||
104 |
inline Address address_in_saved_window() const; // implemented in assembler_sparc.hpp |
|
105 |
}; |
|
106 |
||
107 |
||
108 |
// set specific construction |
|
109 |
inline Register as_iRegister(int number) { return as_Register(RegisterImpl::ibase + number); } |
|
110 |
inline Register as_lRegister(int number) { return as_Register(RegisterImpl::lbase + number); } |
|
111 |
inline Register as_oRegister(int number) { return as_Register(RegisterImpl::obase + number); } |
|
112 |
inline Register as_gRegister(int number) { return as_Register(RegisterImpl::gbase + number); } |
|
113 |
||
114 |
// The integer registers of the SPARC architecture |
|
115 |
||
116 |
CONSTANT_REGISTER_DECLARATION(Register, noreg , (-1)); |
|
117 |
||
118 |
CONSTANT_REGISTER_DECLARATION(Register, G0 , (RegisterImpl::gbase + 0)); |
|
119 |
CONSTANT_REGISTER_DECLARATION(Register, G1 , (RegisterImpl::gbase + 1)); |
|
120 |
CONSTANT_REGISTER_DECLARATION(Register, G2 , (RegisterImpl::gbase + 2)); |
|
121 |
CONSTANT_REGISTER_DECLARATION(Register, G3 , (RegisterImpl::gbase + 3)); |
|
122 |
CONSTANT_REGISTER_DECLARATION(Register, G4 , (RegisterImpl::gbase + 4)); |
|
123 |
CONSTANT_REGISTER_DECLARATION(Register, G5 , (RegisterImpl::gbase + 5)); |
|
124 |
CONSTANT_REGISTER_DECLARATION(Register, G6 , (RegisterImpl::gbase + 6)); |
|
125 |
CONSTANT_REGISTER_DECLARATION(Register, G7 , (RegisterImpl::gbase + 7)); |
|
126 |
||
127 |
CONSTANT_REGISTER_DECLARATION(Register, O0 , (RegisterImpl::obase + 0)); |
|
128 |
CONSTANT_REGISTER_DECLARATION(Register, O1 , (RegisterImpl::obase + 1)); |
|
129 |
CONSTANT_REGISTER_DECLARATION(Register, O2 , (RegisterImpl::obase + 2)); |
|
130 |
CONSTANT_REGISTER_DECLARATION(Register, O3 , (RegisterImpl::obase + 3)); |
|
131 |
CONSTANT_REGISTER_DECLARATION(Register, O4 , (RegisterImpl::obase + 4)); |
|
132 |
CONSTANT_REGISTER_DECLARATION(Register, O5 , (RegisterImpl::obase + 5)); |
|
133 |
CONSTANT_REGISTER_DECLARATION(Register, O6 , (RegisterImpl::obase + 6)); |
|
134 |
CONSTANT_REGISTER_DECLARATION(Register, O7 , (RegisterImpl::obase + 7)); |
|
135 |
||
136 |
CONSTANT_REGISTER_DECLARATION(Register, L0 , (RegisterImpl::lbase + 0)); |
|
137 |
CONSTANT_REGISTER_DECLARATION(Register, L1 , (RegisterImpl::lbase + 1)); |
|
138 |
CONSTANT_REGISTER_DECLARATION(Register, L2 , (RegisterImpl::lbase + 2)); |
|
139 |
CONSTANT_REGISTER_DECLARATION(Register, L3 , (RegisterImpl::lbase + 3)); |
|
140 |
CONSTANT_REGISTER_DECLARATION(Register, L4 , (RegisterImpl::lbase + 4)); |
|
141 |
CONSTANT_REGISTER_DECLARATION(Register, L5 , (RegisterImpl::lbase + 5)); |
|
142 |
CONSTANT_REGISTER_DECLARATION(Register, L6 , (RegisterImpl::lbase + 6)); |
|
143 |
CONSTANT_REGISTER_DECLARATION(Register, L7 , (RegisterImpl::lbase + 7)); |
|
144 |
||
145 |
CONSTANT_REGISTER_DECLARATION(Register, I0 , (RegisterImpl::ibase + 0)); |
|
146 |
CONSTANT_REGISTER_DECLARATION(Register, I1 , (RegisterImpl::ibase + 1)); |
|
147 |
CONSTANT_REGISTER_DECLARATION(Register, I2 , (RegisterImpl::ibase + 2)); |
|
148 |
CONSTANT_REGISTER_DECLARATION(Register, I3 , (RegisterImpl::ibase + 3)); |
|
149 |
CONSTANT_REGISTER_DECLARATION(Register, I4 , (RegisterImpl::ibase + 4)); |
|
150 |
CONSTANT_REGISTER_DECLARATION(Register, I5 , (RegisterImpl::ibase + 5)); |
|
151 |
CONSTANT_REGISTER_DECLARATION(Register, I6 , (RegisterImpl::ibase + 6)); |
|
152 |
CONSTANT_REGISTER_DECLARATION(Register, I7 , (RegisterImpl::ibase + 7)); |
|
153 |
||
154 |
CONSTANT_REGISTER_DECLARATION(Register, FP , (RegisterImpl::ibase + 6)); |
|
155 |
CONSTANT_REGISTER_DECLARATION(Register, SP , (RegisterImpl::obase + 6)); |
|
156 |
||
157 |
// |
|
158 |
// Because sparc has so many registers, #define'ing values for the is |
|
159 |
// beneficial in code size and the cost of some of the dangers of |
|
160 |
// defines. We don't use them on Intel because win32 uses asm |
|
161 |
// directives which use the same names for registers as Hotspot does, |
|
162 |
// so #defines would screw up the inline assembly. If a particular |
|
163 |
// file has a problem with these defines then it's possible to turn |
|
164 |
// them off in that file by defining DONT_USE_REGISTER_DEFINES. |
|
165 |
// register_definition_sparc.cpp does that so that it's able to |
|
166 |
// provide real definitions of these registers for use in debuggers |
|
167 |
// and such. |
|
168 |
// |
|
169 |
||
170 |
#ifndef DONT_USE_REGISTER_DEFINES |
|
171 |
#define noreg ((Register)(noreg_RegisterEnumValue)) |
|
172 |
||
173 |
#define G0 ((Register)(G0_RegisterEnumValue)) |
|
174 |
#define G1 ((Register)(G1_RegisterEnumValue)) |
|
175 |
#define G2 ((Register)(G2_RegisterEnumValue)) |
|
176 |
#define G3 ((Register)(G3_RegisterEnumValue)) |
|
177 |
#define G4 ((Register)(G4_RegisterEnumValue)) |
|
178 |
#define G5 ((Register)(G5_RegisterEnumValue)) |
|
179 |
#define G6 ((Register)(G6_RegisterEnumValue)) |
|
180 |
#define G7 ((Register)(G7_RegisterEnumValue)) |
|
181 |
||
182 |
#define O0 ((Register)(O0_RegisterEnumValue)) |
|
183 |
#define O1 ((Register)(O1_RegisterEnumValue)) |
|
184 |
#define O2 ((Register)(O2_RegisterEnumValue)) |
|
185 |
#define O3 ((Register)(O3_RegisterEnumValue)) |
|
186 |
#define O4 ((Register)(O4_RegisterEnumValue)) |
|
187 |
#define O5 ((Register)(O5_RegisterEnumValue)) |
|
188 |
#define O6 ((Register)(O6_RegisterEnumValue)) |
|
189 |
#define O7 ((Register)(O7_RegisterEnumValue)) |
|
190 |
||
191 |
#define L0 ((Register)(L0_RegisterEnumValue)) |
|
192 |
#define L1 ((Register)(L1_RegisterEnumValue)) |
|
193 |
#define L2 ((Register)(L2_RegisterEnumValue)) |
|
194 |
#define L3 ((Register)(L3_RegisterEnumValue)) |
|
195 |
#define L4 ((Register)(L4_RegisterEnumValue)) |
|
196 |
#define L5 ((Register)(L5_RegisterEnumValue)) |
|
197 |
#define L6 ((Register)(L6_RegisterEnumValue)) |
|
198 |
#define L7 ((Register)(L7_RegisterEnumValue)) |
|
199 |
||
200 |
#define I0 ((Register)(I0_RegisterEnumValue)) |
|
201 |
#define I1 ((Register)(I1_RegisterEnumValue)) |
|
202 |
#define I2 ((Register)(I2_RegisterEnumValue)) |
|
203 |
#define I3 ((Register)(I3_RegisterEnumValue)) |
|
204 |
#define I4 ((Register)(I4_RegisterEnumValue)) |
|
205 |
#define I5 ((Register)(I5_RegisterEnumValue)) |
|
206 |
#define I6 ((Register)(I6_RegisterEnumValue)) |
|
207 |
#define I7 ((Register)(I7_RegisterEnumValue)) |
|
208 |
||
209 |
#define FP ((Register)(FP_RegisterEnumValue)) |
|
210 |
#define SP ((Register)(SP_RegisterEnumValue)) |
|
211 |
#endif // DONT_USE_REGISTER_DEFINES |
|
212 |
||
213 |
// Use FloatRegister as shortcut |
|
214 |
class FloatRegisterImpl; |
|
215 |
typedef FloatRegisterImpl* FloatRegister; |
|
216 |
||
217 |
||
218 |
// construction |
|
219 |
inline FloatRegister as_FloatRegister(int encoding) { |
|
220 |
return (FloatRegister)(intptr_t)encoding; |
|
221 |
} |
|
222 |
||
223 |
// The implementation of float registers for the SPARC architecture |
|
224 |
||
225 |
class FloatRegisterImpl: public AbstractRegisterImpl { |
|
226 |
public: |
|
227 |
enum { |
|
228 |
number_of_registers = 64 |
|
229 |
}; |
|
230 |
||
231 |
enum Width { |
|
232 |
S = 1, D = 2, Q = 3 |
|
233 |
}; |
|
234 |
||
235 |
// construction |
|
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
22234
diff
changeset
|
236 |
inline VMReg as_VMReg( ); |
1 | 237 |
|
238 |
// accessors |
|
239 |
int encoding() const { assert(is_valid(), "invalid register"); return value(); } |
|
240 |
||
241 |
public: |
|
242 |
int encoding(Width w) const { |
|
243 |
const int c = encoding(); |
|
244 |
switch (w) { |
|
245 |
case S: |
|
246 |
assert(c < 32, "bad single float register"); |
|
247 |
return c; |
|
248 |
||
249 |
case D: |
|
250 |
assert(c < 64 && (c & 1) == 0, "bad double float register"); |
|
251 |
return (c & 0x1e) | ((c & 0x20) >> 5); |
|
252 |
||
253 |
case Q: |
|
254 |
assert(c < 64 && (c & 3) == 0, "bad quad float register"); |
|
255 |
return (c & 0x1c) | ((c & 0x20) >> 5); |
|
256 |
} |
|
257 |
ShouldNotReachHere(); |
|
258 |
return -1; |
|
259 |
} |
|
260 |
||
261 |
bool is_valid() const { return 0 <= value() && value() < number_of_registers; } |
|
262 |
const char* name() const; |
|
263 |
||
264 |
FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } |
|
265 |
}; |
|
266 |
||
267 |
||
268 |
// The float registers of the SPARC architecture |
|
269 |
||
270 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, fnoreg , (-1)); |
|
271 |
||
272 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F0 , ( 0)); |
|
273 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F1 , ( 1)); |
|
274 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F2 , ( 2)); |
|
275 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F3 , ( 3)); |
|
276 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F4 , ( 4)); |
|
277 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F5 , ( 5)); |
|
278 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F6 , ( 6)); |
|
279 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F7 , ( 7)); |
|
280 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F8 , ( 8)); |
|
281 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F9 , ( 9)); |
|
282 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F10 , (10)); |
|
283 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F11 , (11)); |
|
284 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F12 , (12)); |
|
285 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F13 , (13)); |
|
286 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F14 , (14)); |
|
287 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F15 , (15)); |
|
288 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F16 , (16)); |
|
289 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F17 , (17)); |
|
290 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F18 , (18)); |
|
291 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F19 , (19)); |
|
292 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F20 , (20)); |
|
293 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F21 , (21)); |
|
294 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F22 , (22)); |
|
295 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F23 , (23)); |
|
296 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F24 , (24)); |
|
297 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F25 , (25)); |
|
298 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F26 , (26)); |
|
299 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F27 , (27)); |
|
300 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F28 , (28)); |
|
301 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F29 , (29)); |
|
302 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F30 , (30)); |
|
303 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F31 , (31)); |
|
304 |
||
305 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F32 , (32)); |
|
306 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F34 , (34)); |
|
307 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F36 , (36)); |
|
308 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F38 , (38)); |
|
309 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F40 , (40)); |
|
310 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F42 , (42)); |
|
311 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F44 , (44)); |
|
312 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F46 , (46)); |
|
313 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F48 , (48)); |
|
314 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F50 , (50)); |
|
315 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F52 , (52)); |
|
316 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F54 , (54)); |
|
317 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F56 , (56)); |
|
318 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F58 , (58)); |
|
319 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F60 , (60)); |
|
320 |
CONSTANT_REGISTER_DECLARATION(FloatRegister, F62 , (62)); |
|
321 |
||
322 |
||
323 |
#ifndef DONT_USE_REGISTER_DEFINES |
|
324 |
#define fnoreg ((FloatRegister)(fnoreg_FloatRegisterEnumValue)) |
|
325 |
#define F0 ((FloatRegister)( F0_FloatRegisterEnumValue)) |
|
326 |
#define F1 ((FloatRegister)( F1_FloatRegisterEnumValue)) |
|
327 |
#define F2 ((FloatRegister)( F2_FloatRegisterEnumValue)) |
|
328 |
#define F3 ((FloatRegister)( F3_FloatRegisterEnumValue)) |
|
329 |
#define F4 ((FloatRegister)( F4_FloatRegisterEnumValue)) |
|
330 |
#define F5 ((FloatRegister)( F5_FloatRegisterEnumValue)) |
|
331 |
#define F6 ((FloatRegister)( F6_FloatRegisterEnumValue)) |
|
332 |
#define F7 ((FloatRegister)( F7_FloatRegisterEnumValue)) |
|
333 |
#define F8 ((FloatRegister)( F8_FloatRegisterEnumValue)) |
|
334 |
#define F9 ((FloatRegister)( F9_FloatRegisterEnumValue)) |
|
335 |
#define F10 ((FloatRegister)( F10_FloatRegisterEnumValue)) |
|
336 |
#define F11 ((FloatRegister)( F11_FloatRegisterEnumValue)) |
|
337 |
#define F12 ((FloatRegister)( F12_FloatRegisterEnumValue)) |
|
338 |
#define F13 ((FloatRegister)( F13_FloatRegisterEnumValue)) |
|
339 |
#define F14 ((FloatRegister)( F14_FloatRegisterEnumValue)) |
|
340 |
#define F15 ((FloatRegister)( F15_FloatRegisterEnumValue)) |
|
341 |
#define F16 ((FloatRegister)( F16_FloatRegisterEnumValue)) |
|
342 |
#define F17 ((FloatRegister)( F17_FloatRegisterEnumValue)) |
|
343 |
#define F18 ((FloatRegister)( F18_FloatRegisterEnumValue)) |
|
344 |
#define F19 ((FloatRegister)( F19_FloatRegisterEnumValue)) |
|
345 |
#define F20 ((FloatRegister)( F20_FloatRegisterEnumValue)) |
|
346 |
#define F21 ((FloatRegister)( F21_FloatRegisterEnumValue)) |
|
347 |
#define F22 ((FloatRegister)( F22_FloatRegisterEnumValue)) |
|
348 |
#define F23 ((FloatRegister)( F23_FloatRegisterEnumValue)) |
|
349 |
#define F24 ((FloatRegister)( F24_FloatRegisterEnumValue)) |
|
350 |
#define F25 ((FloatRegister)( F25_FloatRegisterEnumValue)) |
|
351 |
#define F26 ((FloatRegister)( F26_FloatRegisterEnumValue)) |
|
352 |
#define F27 ((FloatRegister)( F27_FloatRegisterEnumValue)) |
|
353 |
#define F28 ((FloatRegister)( F28_FloatRegisterEnumValue)) |
|
354 |
#define F29 ((FloatRegister)( F29_FloatRegisterEnumValue)) |
|
355 |
#define F30 ((FloatRegister)( F30_FloatRegisterEnumValue)) |
|
356 |
#define F31 ((FloatRegister)( F31_FloatRegisterEnumValue)) |
|
357 |
#define F32 ((FloatRegister)( F32_FloatRegisterEnumValue)) |
|
358 |
#define F34 ((FloatRegister)( F34_FloatRegisterEnumValue)) |
|
359 |
#define F36 ((FloatRegister)( F36_FloatRegisterEnumValue)) |
|
360 |
#define F38 ((FloatRegister)( F38_FloatRegisterEnumValue)) |
|
361 |
#define F40 ((FloatRegister)( F40_FloatRegisterEnumValue)) |
|
362 |
#define F42 ((FloatRegister)( F42_FloatRegisterEnumValue)) |
|
363 |
#define F44 ((FloatRegister)( F44_FloatRegisterEnumValue)) |
|
364 |
#define F46 ((FloatRegister)( F46_FloatRegisterEnumValue)) |
|
365 |
#define F48 ((FloatRegister)( F48_FloatRegisterEnumValue)) |
|
366 |
#define F50 ((FloatRegister)( F50_FloatRegisterEnumValue)) |
|
367 |
#define F52 ((FloatRegister)( F52_FloatRegisterEnumValue)) |
|
368 |
#define F54 ((FloatRegister)( F54_FloatRegisterEnumValue)) |
|
369 |
#define F56 ((FloatRegister)( F56_FloatRegisterEnumValue)) |
|
370 |
#define F58 ((FloatRegister)( F58_FloatRegisterEnumValue)) |
|
371 |
#define F60 ((FloatRegister)( F60_FloatRegisterEnumValue)) |
|
372 |
#define F62 ((FloatRegister)( F62_FloatRegisterEnumValue)) |
|
373 |
#endif // DONT_USE_REGISTER_DEFINES |
|
374 |
||
375 |
// Maximum number of incoming arguments that can be passed in i registers. |
|
376 |
const int SPARC_ARGS_IN_REGS_NUM = 6; |
|
377 |
||
378 |
class ConcreteRegisterImpl : public AbstractRegisterImpl { |
|
379 |
public: |
|
380 |
enum { |
|
381 |
// This number must be large enough to cover REG_COUNT (defined by c2) registers. |
|
382 |
// There is no requirement that any ordering here matches any ordering c2 gives |
|
383 |
// it's optoregs. |
|
384 |
number_of_registers = 2*RegisterImpl::number_of_registers + |
|
385 |
FloatRegisterImpl::number_of_registers + |
|
386 |
1 + // ccr |
|
387 |
4 // fcc |
|
388 |
}; |
|
389 |
static const int max_gpr; |
|
390 |
static const int max_fpr; |
|
391 |
||
392 |
}; |
|
393 |
||
394 |
// Single, Double and Quad fp reg classes. These exist to map the ADLC |
|
395 |
// encoding for a floating point register, to the FloatRegister number |
|
396 |
// desired by the macroassembler. A FloatRegister is a number between |
|
397 |
// 0 and 63 passed around as a pointer. For ADLC, an fp register encoding |
|
398 |
// is the actual bit encoding used by the sparc hardware. When ADLC used |
|
399 |
// the macroassembler to generate an instruction that references, e.g., a |
|
400 |
// double fp reg, it passed the bit encoding to the macroassembler via |
|
401 |
// as_FloatRegister, which, for double regs > 30, returns an illegal |
|
402 |
// register number. |
|
403 |
// |
|
404 |
// Therefore we provide the following classes for use by ADLC. Their |
|
405 |
// sole purpose is to convert from sparc register encodings to FloatRegisters. |
|
406 |
// At some future time, we might replace FloatRegister with these classes, |
|
407 |
// hence the definitions of as_xxxFloatRegister as class methods rather |
|
408 |
// than as external inline routines. |
|
409 |
||
410 |
class SingleFloatRegisterImpl; |
|
411 |
typedef SingleFloatRegisterImpl *SingleFloatRegister; |
|
412 |
||
413 |
inline FloatRegister as_SingleFloatRegister(int encoding); |
|
414 |
class SingleFloatRegisterImpl { |
|
415 |
public: |
|
416 |
friend inline FloatRegister as_SingleFloatRegister(int encoding) { |
|
417 |
assert(encoding < 32, "bad single float register encoding"); |
|
418 |
return as_FloatRegister(encoding); |
|
419 |
} |
|
420 |
}; |
|
421 |
||
422 |
||
423 |
class DoubleFloatRegisterImpl; |
|
424 |
typedef DoubleFloatRegisterImpl *DoubleFloatRegister; |
|
425 |
||
426 |
inline FloatRegister as_DoubleFloatRegister(int encoding); |
|
427 |
class DoubleFloatRegisterImpl { |
|
428 |
public: |
|
429 |
friend inline FloatRegister as_DoubleFloatRegister(int encoding) { |
|
430 |
assert(encoding < 32, "bad double float register encoding"); |
|
431 |
return as_FloatRegister( ((encoding & 1) << 5) | (encoding & 0x1e) ); |
|
432 |
} |
|
433 |
}; |
|
434 |
||
435 |
||
436 |
class QuadFloatRegisterImpl; |
|
437 |
typedef QuadFloatRegisterImpl *QuadFloatRegister; |
|
438 |
||
439 |
class QuadFloatRegisterImpl { |
|
440 |
public: |
|
441 |
friend FloatRegister as_QuadFloatRegister(int encoding) { |
|
442 |
assert(encoding < 32 && ((encoding & 2) == 0), "bad quad float register encoding"); |
|
443 |
return as_FloatRegister( ((encoding & 1) << 5) | (encoding & 0x1c) ); |
|
444 |
} |
|
445 |
}; |
|
7397 | 446 |
|
447 |
#endif // CPU_SPARC_VM_REGISTER_SPARC_HPP |