1 /* |
|
2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. |
|
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 * |
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 * or visit www.oracle.com if you need additional information or have any |
|
21 * questions. |
|
22 * |
|
23 */ |
|
24 |
|
25 package sun.jvm.hotspot.asm.ia64; |
|
26 |
|
27 import sun.jvm.hotspot.utilities.*; |
|
28 |
|
29 public class IA64Registers { |
|
30 |
|
31 public static final IA64Register GR0; |
|
32 public static final IA64Register GR1; |
|
33 public static final IA64Register GR2; |
|
34 public static final IA64Register GR3; |
|
35 public static final IA64Register GR4; |
|
36 public static final IA64Register GR5; |
|
37 public static final IA64Register GR6; |
|
38 public static final IA64Register GR7; |
|
39 public static final IA64Register GR8; |
|
40 public static final IA64Register GR9; |
|
41 public static final IA64Register GR10; |
|
42 public static final IA64Register GR11; |
|
43 public static final IA64Register GR12; |
|
44 public static final IA64Register GR13; |
|
45 public static final IA64Register GR14; |
|
46 public static final IA64Register GR15; |
|
47 public static final IA64Register GR16; |
|
48 public static final IA64Register GR17; |
|
49 public static final IA64Register GR18; |
|
50 public static final IA64Register GR19; |
|
51 public static final IA64Register GR20; |
|
52 public static final IA64Register GR21; |
|
53 public static final IA64Register GR22; |
|
54 public static final IA64Register GR23; |
|
55 public static final IA64Register GR24; |
|
56 public static final IA64Register GR25; |
|
57 public static final IA64Register GR26; |
|
58 public static final IA64Register GR27; |
|
59 public static final IA64Register GR28; |
|
60 public static final IA64Register GR29; |
|
61 public static final IA64Register GR30; |
|
62 public static final IA64Register GR31; |
|
63 public static final IA64Register GR32; |
|
64 public static final IA64Register GR33; |
|
65 public static final IA64Register GR34; |
|
66 public static final IA64Register GR35; |
|
67 public static final IA64Register GR36; |
|
68 public static final IA64Register GR37; |
|
69 public static final IA64Register GR38; |
|
70 public static final IA64Register GR39; |
|
71 public static final IA64Register GR40; |
|
72 public static final IA64Register GR41; |
|
73 public static final IA64Register GR42; |
|
74 public static final IA64Register GR43; |
|
75 public static final IA64Register GR44; |
|
76 public static final IA64Register GR45; |
|
77 public static final IA64Register GR46; |
|
78 public static final IA64Register GR47; |
|
79 public static final IA64Register GR48; |
|
80 public static final IA64Register GR49; |
|
81 public static final IA64Register GR50; |
|
82 public static final IA64Register GR51; |
|
83 public static final IA64Register GR52; |
|
84 public static final IA64Register GR53; |
|
85 public static final IA64Register GR54; |
|
86 public static final IA64Register GR55; |
|
87 public static final IA64Register GR56; |
|
88 public static final IA64Register GR57; |
|
89 public static final IA64Register GR58; |
|
90 public static final IA64Register GR59; |
|
91 public static final IA64Register GR60; |
|
92 public static final IA64Register GR61; |
|
93 public static final IA64Register GR62; |
|
94 public static final IA64Register GR63; |
|
95 public static final IA64Register GR64; |
|
96 public static final IA64Register GR65; |
|
97 public static final IA64Register GR66; |
|
98 public static final IA64Register GR67; |
|
99 public static final IA64Register GR68; |
|
100 public static final IA64Register GR69; |
|
101 public static final IA64Register GR70; |
|
102 public static final IA64Register GR71; |
|
103 public static final IA64Register GR72; |
|
104 public static final IA64Register GR73; |
|
105 public static final IA64Register GR74; |
|
106 public static final IA64Register GR75; |
|
107 public static final IA64Register GR76; |
|
108 public static final IA64Register GR77; |
|
109 public static final IA64Register GR78; |
|
110 public static final IA64Register GR79; |
|
111 public static final IA64Register GR80; |
|
112 public static final IA64Register GR81; |
|
113 public static final IA64Register GR82; |
|
114 public static final IA64Register GR83; |
|
115 public static final IA64Register GR84; |
|
116 public static final IA64Register GR85; |
|
117 public static final IA64Register GR86; |
|
118 public static final IA64Register GR87; |
|
119 public static final IA64Register GR88; |
|
120 public static final IA64Register GR89; |
|
121 public static final IA64Register GR90; |
|
122 public static final IA64Register GR91; |
|
123 public static final IA64Register GR92; |
|
124 public static final IA64Register GR93; |
|
125 public static final IA64Register GR94; |
|
126 public static final IA64Register GR95; |
|
127 public static final IA64Register GR96; |
|
128 public static final IA64Register GR97; |
|
129 public static final IA64Register GR98; |
|
130 public static final IA64Register GR99; |
|
131 public static final IA64Register GR100; |
|
132 public static final IA64Register GR101; |
|
133 public static final IA64Register GR102; |
|
134 public static final IA64Register GR103; |
|
135 public static final IA64Register GR104; |
|
136 public static final IA64Register GR105; |
|
137 public static final IA64Register GR106; |
|
138 public static final IA64Register GR107; |
|
139 public static final IA64Register GR108; |
|
140 public static final IA64Register GR109; |
|
141 public static final IA64Register GR110; |
|
142 public static final IA64Register GR111; |
|
143 public static final IA64Register GR112; |
|
144 public static final IA64Register GR113; |
|
145 public static final IA64Register GR114; |
|
146 public static final IA64Register GR115; |
|
147 public static final IA64Register GR116; |
|
148 public static final IA64Register GR117; |
|
149 public static final IA64Register GR118; |
|
150 public static final IA64Register GR119; |
|
151 public static final IA64Register GR120; |
|
152 public static final IA64Register GR121; |
|
153 public static final IA64Register GR122; |
|
154 public static final IA64Register GR123; |
|
155 public static final IA64Register GR124; |
|
156 public static final IA64Register GR125; |
|
157 public static final IA64Register GR126; |
|
158 public static final IA64Register GR127; |
|
159 |
|
160 public static final IA64Register AR_BSP; |
|
161 |
|
162 public static final int NUM_REGISTERS = 129; |
|
163 private static final IA64Register registers[]; |
|
164 |
|
165 static { |
|
166 GR0 = new IA64Register(0); |
|
167 GR1 = new IA64Register(1); |
|
168 GR2 = new IA64Register(2); |
|
169 GR3 = new IA64Register(3); |
|
170 GR4 = new IA64Register(4); |
|
171 GR5 = new IA64Register(5); |
|
172 GR6 = new IA64Register(6); |
|
173 GR7 = new IA64Register(7); |
|
174 GR8 = new IA64Register(8); |
|
175 GR9 = new IA64Register(9); |
|
176 GR10 = new IA64Register(10); |
|
177 GR11 = new IA64Register(11); |
|
178 GR12 = new IA64Register(12); |
|
179 GR13 = new IA64Register(13); |
|
180 GR14 = new IA64Register(14); |
|
181 GR15 = new IA64Register(15); |
|
182 GR16 = new IA64Register(16); |
|
183 GR17 = new IA64Register(17); |
|
184 GR18 = new IA64Register(18); |
|
185 GR19 = new IA64Register(19); |
|
186 GR20 = new IA64Register(20); |
|
187 GR21 = new IA64Register(21); |
|
188 GR22 = new IA64Register(22); |
|
189 GR23 = new IA64Register(23); |
|
190 GR24 = new IA64Register(24); |
|
191 GR25 = new IA64Register(25); |
|
192 GR26 = new IA64Register(26); |
|
193 GR27 = new IA64Register(27); |
|
194 GR28 = new IA64Register(28); |
|
195 GR29 = new IA64Register(29); |
|
196 GR30 = new IA64Register(30); |
|
197 GR31 = new IA64Register(31); |
|
198 GR32 = new IA64Register(32); |
|
199 GR33 = new IA64Register(33); |
|
200 GR34 = new IA64Register(34); |
|
201 GR35 = new IA64Register(35); |
|
202 GR36 = new IA64Register(36); |
|
203 GR37 = new IA64Register(37); |
|
204 GR38 = new IA64Register(38); |
|
205 GR39 = new IA64Register(39); |
|
206 GR40 = new IA64Register(40); |
|
207 GR41 = new IA64Register(41); |
|
208 GR42 = new IA64Register(42); |
|
209 GR43 = new IA64Register(43); |
|
210 GR44 = new IA64Register(44); |
|
211 GR45 = new IA64Register(45); |
|
212 GR46 = new IA64Register(46); |
|
213 GR47 = new IA64Register(47); |
|
214 GR48 = new IA64Register(48); |
|
215 GR49 = new IA64Register(49); |
|
216 GR50 = new IA64Register(50); |
|
217 GR51 = new IA64Register(51); |
|
218 GR52 = new IA64Register(52); |
|
219 GR53 = new IA64Register(53); |
|
220 GR54 = new IA64Register(54); |
|
221 GR55 = new IA64Register(55); |
|
222 GR56 = new IA64Register(56); |
|
223 GR57 = new IA64Register(57); |
|
224 GR58 = new IA64Register(58); |
|
225 GR59 = new IA64Register(59); |
|
226 GR60 = new IA64Register(60); |
|
227 GR61 = new IA64Register(61); |
|
228 GR62 = new IA64Register(62); |
|
229 GR63 = new IA64Register(63); |
|
230 GR64 = new IA64Register(64); |
|
231 GR65 = new IA64Register(65); |
|
232 GR66 = new IA64Register(66); |
|
233 GR67 = new IA64Register(67); |
|
234 GR68 = new IA64Register(68); |
|
235 GR69 = new IA64Register(69); |
|
236 GR70 = new IA64Register(70); |
|
237 GR71 = new IA64Register(71); |
|
238 GR72 = new IA64Register(72); |
|
239 GR73 = new IA64Register(73); |
|
240 GR74 = new IA64Register(74); |
|
241 GR75 = new IA64Register(75); |
|
242 GR76 = new IA64Register(76); |
|
243 GR77 = new IA64Register(77); |
|
244 GR78 = new IA64Register(78); |
|
245 GR79 = new IA64Register(79); |
|
246 GR80 = new IA64Register(80); |
|
247 GR81 = new IA64Register(81); |
|
248 GR82 = new IA64Register(82); |
|
249 GR83 = new IA64Register(83); |
|
250 GR84 = new IA64Register(84); |
|
251 GR85 = new IA64Register(85); |
|
252 GR86 = new IA64Register(86); |
|
253 GR87 = new IA64Register(87); |
|
254 GR88 = new IA64Register(88); |
|
255 GR89 = new IA64Register(89); |
|
256 GR90 = new IA64Register(90); |
|
257 GR91 = new IA64Register(91); |
|
258 GR92 = new IA64Register(92); |
|
259 GR93 = new IA64Register(93); |
|
260 GR94 = new IA64Register(94); |
|
261 GR95 = new IA64Register(95); |
|
262 GR96 = new IA64Register(96); |
|
263 GR97 = new IA64Register(97); |
|
264 GR98 = new IA64Register(98); |
|
265 GR99 = new IA64Register(99); |
|
266 GR100 = new IA64Register(100); |
|
267 GR101 = new IA64Register(101); |
|
268 GR102 = new IA64Register(102); |
|
269 GR103 = new IA64Register(103); |
|
270 GR104 = new IA64Register(104); |
|
271 GR105 = new IA64Register(105); |
|
272 GR106 = new IA64Register(106); |
|
273 GR107 = new IA64Register(107); |
|
274 GR108 = new IA64Register(108); |
|
275 GR109 = new IA64Register(109); |
|
276 GR110 = new IA64Register(110); |
|
277 GR111 = new IA64Register(111); |
|
278 GR112 = new IA64Register(112); |
|
279 GR113 = new IA64Register(113); |
|
280 GR114 = new IA64Register(114); |
|
281 GR115 = new IA64Register(115); |
|
282 GR116 = new IA64Register(116); |
|
283 GR117 = new IA64Register(117); |
|
284 GR118 = new IA64Register(118); |
|
285 GR119 = new IA64Register(119); |
|
286 GR120 = new IA64Register(120); |
|
287 GR121 = new IA64Register(121); |
|
288 GR122 = new IA64Register(122); |
|
289 GR123 = new IA64Register(123); |
|
290 GR124 = new IA64Register(124); |
|
291 GR125 = new IA64Register(125); |
|
292 GR126 = new IA64Register(126); |
|
293 GR127 = new IA64Register(127); |
|
294 |
|
295 AR_BSP = new IA64Register(128); |
|
296 |
|
297 registers = (new IA64Register[] { |
|
298 GR0, GR1, GR2, GR3, GR4, GR5, GR6, GR7, GR8, GR9, |
|
299 GR10, GR11, GR12, GR13, GR14, GR15, GR16, GR17, GR18, GR19, |
|
300 GR20, GR21, GR22, GR23, GR24, GR25, GR26, GR27, GR28, GR29, |
|
301 GR30, GR31, GR32, GR33, GR34, GR35, GR36, GR37, GR38, GR39, |
|
302 GR40, GR41, GR42, GR43, GR44, GR45, GR46, GR47, GR48, GR49, |
|
303 GR50, GR51, GR52, GR53, GR54, GR55, GR56, GR57, GR58, GR59, |
|
304 GR60, GR61, GR62, GR63, GR64, GR65, GR66, GR67, GR68, GR69, |
|
305 GR70, GR71, GR72, GR73, GR74, GR75, GR76, GR77, GR78, GR79, |
|
306 GR80, GR81, GR82, GR83, GR84, GR85, GR86, GR87, GR88, GR89, |
|
307 GR90, GR91, GR92, GR93, GR94, GR95, GR96, GR97, GR98, GR99, |
|
308 GR100, GR101, GR102, GR103, GR104, GR105, GR106, GR107, GR108, GR109, |
|
309 GR110, GR111, GR112, GR113, GR114, GR115, GR116, GR117, GR118, GR119, |
|
310 GR120, GR121, GR122, GR123, GR124, GR125, GR126, GR127, AR_BSP |
|
311 }); |
|
312 |
|
313 } |
|
314 |
|
315 public static final IA64Register FP = AR_BSP; |
|
316 public static final IA64Register SP = GR12; |
|
317 |
|
318 |
|
319 /** Prefer to use this instead of the constant above */ |
|
320 public static int getNumRegisters() { |
|
321 return NUM_REGISTERS; |
|
322 } |
|
323 |
|
324 |
|
325 public static String getRegisterName(int regNum) { |
|
326 if (regNum < 0 || regNum >= NUM_REGISTERS) { |
|
327 return "[Illegal register " + regNum + "]"; |
|
328 } |
|
329 |
|
330 if (Assert.ASSERTS_ENABLED) { |
|
331 Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!"); |
|
332 } |
|
333 |
|
334 if (regNum == 128 ) { |
|
335 return "BSP"; |
|
336 } |
|
337 |
|
338 if (regNum == 12) { |
|
339 return "SP"; |
|
340 } |
|
341 |
|
342 return "R" + regNum; |
|
343 |
|
344 } |
|
345 |
|
346 public static IA64Register getRegister(int regNum) { |
|
347 if (Assert.ASSERTS_ENABLED) { |
|
348 Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid register number!"); |
|
349 } |
|
350 |
|
351 return registers[regNum]; |
|
352 } |
|
353 } |
|