Mercurial > hg > graal-compiler
annotate agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCOpcodes.java @ 2177:3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
Summary: move symbols from permgen into C heap and reference count them
Reviewed-by: never, acorn, jmasa, stefank
author | coleenp |
---|---|
date | Thu, 27 Jan 2011 16:11:27 -0800 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.asm.sparc; | |
26 | |
27 import sun.jvm.hotspot.asm.*; | |
28 | |
29 // Please refer to "The SPARC Architecture Manual - Version 8" | |
30 | |
31 public interface SPARCOpcodes { | |
32 | |
33 // format type is coded in 2 bits - primary opcode - "op" | |
34 public static final int FORMAT_START_BIT = 30; | |
35 public static final int FORMAT_MASK = 3 << FORMAT_START_BIT; | |
36 | |
37 // sparc instruction formats | |
38 | |
39 // PC Relative CALL | |
40 public static final int FORMAT_1 = 1; | |
41 | |
42 // Bicc, FBfcc, CBccc, SETHI | |
43 public static final int FORMAT_2 = 0; | |
44 | |
45 // memory instructions | |
46 public static final int FORMAT_3 = 3; | |
47 | |
48 // arithmetic, logical, shift and remaining | |
49 public static final int FORMAT_3A = 2; | |
50 | |
51 // disp 30 - used in pc relative call | |
52 public static final int DISP_30_MASK = 0x3FFFFFFF; | |
53 | |
54 // secondary opcode "op2" used in FORMAT_2 instructions - 3 bits. | |
55 public static final int OP_2_START_BIT = 22; | |
56 public static final int OP_2_MASK = 7 << OP_2_START_BIT; | |
57 | |
58 // various "op2" masks | |
59 public static final int OP_2_UNIMP = 0; | |
60 public static final int OP_2_Bicc = 2; | |
61 public static final int OP_2_SETHI = 4; | |
62 public static final int OP_2_FBfcc = 6; | |
63 public static final int OP_2_CBccc = 7; | |
64 | |
65 // condition codes are encoded in 4 bits. | |
66 public static final int CONDITION_CODE_START_BIT = 25; | |
67 public static final int CONDITION_CODE_MASK = 0xF << CONDITION_CODE_START_BIT; | |
68 | |
69 // branch condition codes | |
70 public static final int CONDITION_BN = 0; | |
71 public static final int CONDITION_FBN = CONDITION_BN; | |
72 public static final int CONDITION_CBN = CONDITION_BN; | |
73 public static final int CONDITION_TN = CONDITION_BN; | |
74 | |
75 public static final int CONDITION_BE = 1; | |
76 public static final int CONDITION_FBNE = CONDITION_BE; | |
77 public static final int CONDITION_CB123= CONDITION_BE; | |
78 public static final int CONDITION_TE = CONDITION_BE; | |
79 | |
80 public static final int CONDITION_BLE = 2; | |
81 public static final int CONDITION_FBLG = CONDITION_BLE; | |
82 public static final int CONDITION_CB12 = CONDITION_BLE; | |
83 public static final int CONDITION_TLE = CONDITION_BLE; | |
84 | |
85 public static final int CONDITION_BL = 3; | |
86 public static final int CONDITION_FBUL = CONDITION_BL; | |
87 public static final int CONDITION_CB13 = CONDITION_BL; | |
88 public static final int CONDITION_TL = CONDITION_BL; | |
89 | |
90 public static final int CONDITION_BLEU = 4; | |
91 public static final int CONDITION_FBL = CONDITION_BLEU; | |
92 public static final int CONDITION_CB1 = CONDITION_BLEU; | |
93 public static final int CONDITION_TLEU = CONDITION_BLEU; | |
94 | |
95 public static final int CONDITION_BCS = 5; | |
96 public static final int CONDITION_FBUG = CONDITION_BCS; | |
97 public static final int CONDITION_CB23 = CONDITION_BCS; | |
98 public static final int CONDITION_TCS = CONDITION_BCS; | |
99 | |
100 public static final int CONDITION_BNEG = 6; | |
101 public static final int CONDITION_FBG = CONDITION_BNEG; | |
102 public static final int CONDITION_CB2 = CONDITION_BNEG; | |
103 public static final int CONDITION_TNEG = CONDITION_BNEG; | |
104 | |
105 public static final int CONDITION_BVS = 7; | |
106 public static final int CONDITION_FBU = CONDITION_BVS; | |
107 public static final int CONDITION_CB3 = CONDITION_BVS; | |
108 public static final int CONDITION_TVS = CONDITION_BVS; | |
109 | |
110 public static final int CONDITION_BA = 8; | |
111 public static final int CONDITION_FBA = CONDITION_BA; | |
112 public static final int CONDITION_CBA = CONDITION_BA; | |
113 public static final int CONDITION_TA = CONDITION_BA; | |
114 | |
115 public static final int CONDITION_BNE = 9; | |
116 public static final int CONDITION_FBE = CONDITION_BNE; | |
117 public static final int CONDITION_CB0 = CONDITION_BNE; | |
118 public static final int CONDITION_TNE = CONDITION_BNE; | |
119 | |
120 public static final int CONDITION_BG = 0xA; | |
121 public static final int CONDITION_FBUE = CONDITION_BG; | |
122 public static final int CONDITION_CB03 = CONDITION_BG; | |
123 public static final int CONDITION_TG = CONDITION_BG; | |
124 | |
125 public static final int CONDITION_BGE = 0xB; | |
126 public static final int CONDITION_FBGE = CONDITION_BGE; | |
127 public static final int CONDITION_CB02 = CONDITION_BGE; | |
128 public static final int CONDITION_TGE = CONDITION_BGE; | |
129 | |
130 public static final int CONDITION_BGU = 0xC; | |
131 public static final int CONDITION_FBUGE= CONDITION_BGU; | |
132 public static final int CONDITION_CB023= CONDITION_BGU; | |
133 public static final int CONDITION_TGU = CONDITION_BGU; | |
134 | |
135 public static final int CONDITION_BCC = 0xD; | |
136 public static final int CONDITION_FBLE = CONDITION_BCC; | |
137 public static final int CONDITION_CB01 = CONDITION_BCC; | |
138 public static final int CONDITION_TCC = CONDITION_BCC; | |
139 | |
140 public static final int CONDITION_BPOS = 0xE; | |
141 public static final int CONDITION_FBULE= CONDITION_BPOS; | |
142 public static final int CONDITION_CB013= CONDITION_BPOS; | |
143 public static final int CONDITION_TPOS = CONDITION_BPOS; | |
144 | |
145 public static final int CONDITION_BVC = 0xF; | |
146 public static final int CONDITION_FBO = CONDITION_BVC; | |
147 public static final int CONDITION_CB012= CONDITION_BVC; | |
148 public static final int CONDITION_TVC = CONDITION_BVC; | |
149 | |
150 // annul bit mask | |
151 public static final int ANNUL_MASK = 1 << 29; | |
152 | |
153 // 22 bit displacement or immediate value - used in FORMAT_2 instructions. | |
154 public static final int DISP_22_MASK = 0x3FFFFF; | |
155 public static final int IMM_22_MASK = DISP_22_MASK; | |
156 | |
157 // second operand mask, called "i" bit | |
158 public static final int I_START_BIT = 13; | |
159 public static final int I_MASK = 1 << I_START_BIT; | |
160 | |
161 // address space identifier - "asi" - 8 bits | |
162 public static final int ASI_START_BIT = 5; | |
163 public static final int ASI_MASK = 0xFF << ASI_START_BIT; | |
164 | |
165 // signed immediate value 13 bits - "simm13" | |
166 public static final int SIMM_13_MASK = 0x1FFF; | |
167 | |
168 // co-processor or floating point opcode field - "ocf/opf" - 9 bits | |
169 public static final int OPF_START_BIT = 5; | |
170 public static final int OPF_MASK = 0x1FF << OPF_START_BIT; | |
171 public static final int OPC_MASK = OPF_MASK; | |
172 | |
173 // opcode part 3 - used in FORMAT_3 and FORMAT_3A instructions | |
174 // "op3" - 6 bits | |
175 public static final int OP_3_START_BIT = 19; | |
176 public static final int OP_3_MASK = 0x3F << OP_3_START_BIT; | |
177 | |
178 // register masks | |
179 public static final int RD_START_BIT = 25; | |
180 public static final int RD_MASK = 0x1F << RD_START_BIT; // "rd" | |
181 public static final int RS1_START_BIT = 14; | |
182 public static final int RS1_MASK = 0x1F << RS1_START_BIT; // "rs1" | |
183 public static final int RS2_MASK = 0x1F; // "rs2" | |
184 | |
185 // load/store instructions - op3 values - used with op=3 (FORMAT_3) | |
186 public static final int LD = 0; | |
187 public static final int LDA = (1 << 4); | |
188 public static final int LDF = (2 << 4); | |
189 public static final int LDC = (3 << 4); | |
190 | |
191 public static final int LDUB = 1; | |
192 public static final int LDUBA = (1 << 4) | 1; | |
193 public static final int LDFSR = (2 << 4) | 1; | |
194 public static final int LDCSR = (3 << 4) | 1; | |
195 | |
196 public static final int LDUH = 2; | |
197 public static final int LDUHA = (1 << 4) | 2; | |
198 | |
199 public static final int LDD = 3; | |
200 public static final int LDDA = (1 << 4) | 3; | |
201 public static final int LDDF = (2 << 4) | 3; | |
202 public static final int LDDC = (3 << 4) | 3; | |
203 | |
204 public static final int ST = 4; | |
205 public static final int STA = (1 << 4) | 4; | |
206 public static final int STF = (2 << 4) | 4; | |
207 public static final int STC = (3 << 4) | 4; | |
208 | |
209 public static final int STB = 5; | |
210 public static final int STBA = (1 << 4) | 5; | |
211 public static final int STFSR = (2 << 4) | 5; | |
212 public static final int STCSR = (3 << 4) | 5; | |
213 | |
214 public static final int STH = 6; | |
215 public static final int STHA = (1 << 4) | 6; | |
216 public static final int STDFQ = (2 << 4) | 6; | |
217 public static final int STDCQ = (3 << 4) | 6; | |
218 | |
219 public static final int STD = 7; | |
220 public static final int STDA = (1 << 4) | 7; | |
221 public static final int STDF = (2 << 4) | 7; | |
222 public static final int STDC = (3 << 4) | 7; | |
223 | |
224 public static final int LDSB = 9; | |
225 public static final int LDSBA = (1 << 4) | 9; | |
226 | |
227 public static final int LDSH = 0xA; | |
228 public static final int LDSHA = (1 << 4) | 0xA; | |
229 | |
230 public static final int LDSTUB = 0xD; | |
231 public static final int LDSTUBA = (1 << 4) | 0xD; | |
232 | |
233 public static final int SWAP = 0xF; | |
234 public static final int SWAPA = (1 << 4) | 0xF; | |
235 | |
236 // arithmetic, logic remaining - op3 with op=2 (FORMAT_3A) | |
237 public static final int ADD = 0; | |
238 public static final int ADDcc = (1 << 4); | |
239 public static final int TADDcc = (2 << 4); | |
240 public static final int WRASR = (3 << 4); | |
241 public static final int WRY = WRASR; | |
242 | |
243 public static final int AND = 1; | |
244 public static final int ANDcc = (1 << 4) | 1; | |
245 public static final int TSUBcc = (2 << 4) | 1; | |
246 public static final int WRPSR = (3 << 4) | 1; | |
247 | |
248 public static final int OR = 2; | |
249 public static final int ORcc = (1 << 4) | 2; | |
250 public static final int TADDccTV = (2 << 4) | 2; | |
251 public static final int WRWIM = (3 << 4) | 2; | |
252 | |
253 public static final int XOR = 3; | |
254 public static final int XORcc = (1 << 4) | 3; | |
255 public static final int TSUBccTV = (2 << 4) | 3; | |
256 public static final int WRTBR = (3 << 4) | 3; | |
257 | |
258 public static final int SUB = 4; | |
259 public static final int SUBcc = (1 << 4) | 4; | |
260 public static final int MULScc = (2 << 4) | 4; | |
261 public static final int FPop1 = (3 << 4) | 4; | |
262 | |
263 public static final int ANDN = 5; | |
264 public static final int ANDNcc = (1 << 4) | 5; | |
265 public static final int SLL = (2 << 4) | 5; | |
266 public static final int FPop2 = (3 << 4) | 5; | |
267 | |
268 public static final int ORN = 6; | |
269 public static final int ORNcc = (1 << 4) | 6; | |
270 public static final int SRL = (2 << 4) | 6; | |
271 public static final int CPop1 = (3 << 4) | 6; | |
272 | |
273 public static final int XNOR = 7; | |
274 public static final int XNORcc = (1 << 4) | 7; | |
275 public static final int SRA = (2 << 4) | 7; | |
276 public static final int CPop2 = (3 << 4) | 7; | |
277 | |
278 public static final int ADDX = 8; | |
279 public static final int ADDXcc = (1 << 4) | 8; | |
280 public static final int RDASR = (2 << 4) | 8; | |
281 public static final int RDY = RDASR; | |
282 public static final int STBAR = RDASR; | |
283 public static final int JMPL = (3 << 4) | 8; | |
284 | |
285 public static final int RDPSR = (2 << 4) | 9; | |
286 public static final int RETT = (3 << 4) | 9; | |
287 | |
288 public static final int UMUL = 0xA; | |
289 public static final int UMULcc = (1 << 4) | 0xA; | |
290 public static final int RDWIM = (2 << 4) | 0xA; | |
291 public static final int Ticc = (3 << 4) | 0xA; | |
292 | |
293 public static final int SMUL = 0xB; | |
294 public static final int SMULcc = (1 << 4) | 0xB; | |
295 public static final int RDTBR = (2 << 4) | 0xB; | |
296 public static final int FLUSH = (3 << 4) | 0xB; | |
297 | |
298 public static final int SUBX = 0xC; | |
299 public static final int SUBXcc = (1 << 4) | 0xC; | |
300 public static final int SAVE = (3 << 4) | 0xC; | |
301 | |
302 public static final int RESTORE = (3 << 4) | 0xD; | |
303 | |
304 public static final int UDIV = 0xE; | |
305 public static final int UDIVcc = (1 << 4) | 0xE; | |
306 | |
307 public static final int SDIV = 0xF; | |
308 public static final int SDIVcc = (1 << 4) | 0xF; | |
309 | |
310 // opf - 9 bits (op=2, op3=0x34=FPop1) - floating point arithmetic | |
311 public static final int FMOVs = 0x01; | |
312 public static final int FNEGs = 0x05; | |
313 public static final int FABSs = 0x09; | |
314 public static final int FSQRTs = 0x29; | |
315 public static final int FSQRTd = 0x2A; | |
316 public static final int FSQRTq = 0x2B; | |
317 public static final int FADDs = 0x41; | |
318 public static final int FADDd = 0x42; | |
319 public static final int FADDq = 0x43; | |
320 public static final int FSUBs = 0x45; | |
321 public static final int FSUBd = 0x46; | |
322 public static final int FSUBq = 0x47; | |
323 public static final int FMULs = 0x49; | |
324 public static final int FMULd = 0x4A; | |
325 public static final int FMULq = 0x4B; | |
326 public static final int FDIVs = 0x4D; | |
327 public static final int FDIVd = 0x4E; | |
328 public static final int FDIVq = 0x4F; | |
329 public static final int FsMULd = 0x69; | |
330 public static final int FdMULq = 0x6E; | |
331 public static final int FiTOs = 0xC4; | |
332 public static final int FdTOs = 0xC6; | |
333 public static final int FqTOs = 0xC7; | |
334 public static final int FiTOd = 0xC8; | |
335 public static final int FsTOd = 0xC9; | |
336 public static final int FqTOd = 0xCB; | |
337 public static final int FiTOq = 0xCC; | |
338 public static final int FsTOq = 0xCD; | |
339 public static final int FdTOq = 0xCE; | |
340 public static final int FsTOi = 0xD1; | |
341 public static final int FdTOi = 0xD2; | |
342 public static final int FqTOi = 0xD3; | |
343 | |
344 // opf - 9 bits (op=2, op3=0x35=FPop2) - floating point comparisons | |
345 public static final int FCMPs = 0x51; | |
346 public static final int FCMPd = 0x52; | |
347 public static final int FCMPq = 0x53; | |
348 public static final int FCMPEs = 0x55; | |
349 public static final int FCMPEd = 0x56; | |
350 public static final int FCMPEq = 0x57; | |
351 | |
352 // 5 bit shift count mask | |
353 public static final int SHIFT_COUNT_5_MASK = 0x1F; | |
354 } |