Mercurial > hg > truffle
annotate src/os_cpu/solaris_sparc/vm/solaris_sparc.il @ 7700:627c284671b7
Use java.nio.ByteOrder instead of our own ByteOrder enumeration
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Mon, 04 Feb 2013 07:36:35 -0800 |
parents | 85c73c0edb06 |
children | 46c544b8fbfc |
rev | line source |
---|---|
0 | 1 // |
2140
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
2 // Copyright (c) 2002, 2011, 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 // Get the raw thread ID from %g7 | |
26 | |
27 .inline _raw_thread_id, 0 | |
28 .register %g7,#scratch | |
29 .volatile | |
30 mov %g7, %o0 | |
31 .nonvolatile | |
32 .end | |
33 | |
34 | |
35 // Clear SPARC fprs.FEF DU and DL bits -- | |
36 // allows the kernel to avoid saving FPU state at context-switch time. | |
37 // Use for state-transition points (into _thread_blocked) or when | |
38 // parking. | |
39 | |
40 .inline _mark_fpu_nosave, 0 | |
41 .volatile | |
42 wr %g0, 0, %fprs | |
43 .nonvolatile | |
44 .end | |
45 | |
46 // Support for jint Atomic::xchg(jint exchange_value, volatile jint* dest). | |
47 // | |
48 // Arguments: | |
49 // exchange_value: O0 | |
50 // dest: O1 | |
51 // | |
52 // Results: | |
53 // O0: the value previously stored in dest | |
54 | |
55 .inline _Atomic_swap32, 2 | |
56 .volatile | |
57 swap [%o1],%o0 | |
58 .nonvolatile | |
59 .end | |
60 | |
61 | |
62 // Support for intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t * dest). | |
63 // | |
64 // 64-bit | |
65 // | |
66 // Arguments: | |
67 // exchange_value: O0 | |
68 // dest: O1 | |
69 // | |
70 // Results: | |
71 // O0: the value previously stored in dest | |
72 | |
73 .inline _Atomic_swap64, 2 | |
74 .volatile | |
75 1: | |
76 mov %o0, %o3 | |
77 ldx [%o1], %o2 | |
78 casx [%o1], %o2, %o3 | |
79 cmp %o2, %o3 | |
80 bne %xcc, 1b | |
81 nop | |
82 mov %o2, %o0 | |
83 .nonvolatile | |
84 .end | |
85 | |
86 | |
87 // Support for jint Atomic::cmpxchg(jint exchange_value, | |
88 // volatile jint* dest, | |
89 // jint compare_value) | |
90 // | |
91 // Arguments: | |
92 // exchange_value: O0 | |
93 // dest: O1 | |
94 // compare_value: O2 | |
95 // | |
96 // Results: | |
97 // O0: the value previously stored in dest | |
98 | |
99 .inline _Atomic_cas32, 3 | |
100 .volatile | |
101 cas [%o1], %o2, %o0 | |
102 .nonvolatile | |
103 .end | |
104 | |
105 | |
106 // Support for intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, | |
107 // volatile intptr_t* dest, | |
108 // intptr_t compare_value) | |
109 // | |
110 // 64-bit | |
111 // | |
112 // Arguments: | |
113 // exchange_value: O0 | |
114 // dest: O1 | |
115 // compare_value: O2 | |
116 // | |
117 // Results: | |
118 // O0: the value previously stored in dest | |
119 | |
120 .inline _Atomic_cas64, 3 | |
121 .volatile | |
122 casx [%o1], %o2, %o0 | |
123 .nonvolatile | |
124 .end | |
125 | |
126 | |
127 // Support for jlong Atomic::cmpxchg(jlong exchange_value, | |
128 // volatile jlong* dest, | |
129 // jlong compare_value) | |
130 // | |
131 // 32-bit calling conventions | |
132 // | |
133 // Arguments: | |
134 // exchange_value: O1:O0 | |
135 // dest: O2 | |
136 // compare_value: O4:O3 | |
137 // | |
138 // Results: | |
139 // O1:O0: the value previously stored in dest | |
140 | |
141 .inline _Atomic_casl, 3 | |
142 .volatile | |
143 sllx %o0, 32, %o0 | |
144 srl %o1, 0, %o1 | |
145 or %o0,%o1,%o0 | |
146 sllx %o3, 32, %o3 | |
147 srl %o4, 0, %o4 | |
148 or %o3,%o4,%o3 | |
149 casx [%o2], %o3, %o0 | |
150 srl %o0, 0, %o1 | |
151 srlx %o0, 32, %o0 | |
152 .nonvolatile | |
153 .end | |
154 | |
2140
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
155 // Support for jlong Atomic::load and Atomic::store on v8. |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
156 // |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
157 // void _Atomic_move_long_v8(volatile jlong* src, volatile jlong* dst) |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
158 // |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
159 // Arguments: |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
160 // src: O0 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
161 // dest: O1 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
162 // |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
163 // Overwrites O2 and O3 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
164 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
165 .inline _Atomic_move_long_v8,2 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
166 .volatile |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
167 ldd [%o0], %o2 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
168 std %o2, [%o1] |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
169 .nonvolatile |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
170 .end |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
171 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
172 // Support for jlong Atomic::load and Atomic::store on v9. |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
173 // |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
174 // void _Atomic_move_long_v9(volatile jlong* src, volatile jlong* dst) |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
175 // |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
176 // Arguments: |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
177 // src: O0 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
178 // dest: O1 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
179 // |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
180 // Overwrites O2 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
181 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
182 .inline _Atomic_move_long_v9,2 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
183 .volatile |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
184 ldx [%o0], %o2 |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
185 stx %o2, [%o1] |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
186 .nonvolatile |
85c73c0edb06
7012965: Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
kvn
parents:
1552
diff
changeset
|
187 .end |
0 | 188 |
189 // Support for jint Atomic::add(jint add_value, volatile jint* dest). | |
190 // | |
191 // Arguments: | |
192 // add_value: O0 (e.g., +1 or -1) | |
193 // dest: O1 | |
194 // | |
195 // Results: | |
196 // O0: the new value stored in dest | |
197 // | |
198 // Overwrites O3 | |
199 | |
200 .inline _Atomic_add32, 2 | |
201 .volatile | |
202 2: | |
203 ld [%o1], %o2 | |
204 add %o0, %o2, %o3 | |
205 cas [%o1], %o2, %o3 | |
206 cmp %o2, %o3 | |
207 bne 2b | |
208 nop | |
209 add %o0, %o2, %o0 | |
210 .nonvolatile | |
211 .end | |
212 | |
213 | |
214 // Support for intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) | |
215 // | |
216 // 64-bit | |
217 // | |
218 // Arguments: | |
219 // add_value: O0 (e.g., +1 or -1) | |
220 // dest: O1 | |
221 // | |
222 // Results: | |
223 // O0: the new value stored in dest | |
224 // | |
225 // Overwrites O3 | |
226 | |
227 .inline _Atomic_add64, 2 | |
228 .volatile | |
229 3: | |
230 ldx [%o1], %o2 | |
231 add %o0, %o2, %o3 | |
232 casx [%o1], %o2, %o3 | |
233 cmp %o2, %o3 | |
234 bne %xcc, 3b | |
235 nop | |
236 add %o0, %o2, %o0 | |
237 .nonvolatile | |
238 .end | |
239 | |
240 | |
241 // Support for void OrderAccess::acquire() | |
242 // The method is intentionally empty. | |
243 // It exists for the sole purpose of generating | |
244 // a C/C++ sequence point over which the compiler won't | |
245 // reorder code. | |
246 | |
247 .inline _OrderAccess_acquire,0 | |
248 .volatile | |
249 .nonvolatile | |
250 .end | |
251 | |
252 | |
253 // Support for void OrderAccess::fence() | |
254 | |
255 .inline _OrderAccess_fence,0 | |
256 .volatile | |
257 membar #StoreLoad | |
258 .nonvolatile | |
259 .end | |
260 | |
261 | |
262 // Support for void Prefetch::read(void *loc, intx interval) | |
263 // | |
264 // Prefetch for several reads. | |
265 | |
266 .inline _Prefetch_read, 2 | |
267 .volatile | |
268 prefetch [%o0+%o1], 0 | |
269 .nonvolatile | |
270 .end | |
271 | |
272 | |
273 // Support for void Prefetch::write(void *loc, intx interval) | |
274 // | |
275 // Prefetch for several writes. | |
276 | |
277 .inline _Prefetch_write, 2 | |
278 .volatile | |
279 prefetch [%o0+%o1], 2 | |
280 .nonvolatile | |
281 .end | |
282 | |
283 | |
284 // Support for void Copy::conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) | |
285 // | |
286 // 32-bit | |
287 // | |
288 // Arguments: | |
289 // from: O0 | |
290 // to: O1 | |
291 // count: O2 treated as signed | |
292 // | |
293 // Clobbers: | |
294 // long_value: O2, O3 | |
295 // count: O4 | |
296 // | |
297 // if (from > to) { | |
298 // while (--count >= 0) { | |
299 // *to++ = *from++; | |
300 // } | |
301 // } else { | |
302 // while (--count >= 0) { | |
303 // to[count] = from[count]; | |
304 // } | |
305 // } | |
306 .inline _Copy_conjoint_jlongs_atomic, 3 | |
307 .volatile | |
308 cmp %o0, %o1 | |
309 bleu 4f | |
310 sll %o2, 3, %o4 | |
311 ba 2f | |
312 1: | |
313 subcc %o4, 8, %o4 | |
314 std %o2, [%o1] | |
315 add %o0, 8, %o0 | |
316 add %o1, 8, %o1 | |
317 2: | |
318 bge,a 1b | |
319 ldd [%o0], %o2 | |
320 ba 5f | |
321 nop | |
322 3: | |
323 std %o2, [%o1+%o4] | |
324 4: | |
325 subcc %o4, 8, %o4 | |
326 bge,a 3b | |
327 ldd [%o0+%o4], %o2 | |
328 5: | |
329 .nonvolatile | |
330 .end |