Mercurial > hg > truffle
annotate src/os_cpu/solaris_x86/vm/solaris_x86_32.s @ 5592:d64507a295cc
Merge.
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Wed, 13 Jun 2012 19:11:20 +0200 |
parents | 0a8e0d4345b3 |
children | 980532a806a5 |
rev | line source |
---|---|
0 | 1 // |
2042
0a8e0d4345b3
7010068: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - first pass
trims
parents:
1603
diff
changeset
|
2 // Copyright (c) 2004, 2010, 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 .globl fixcw | |
25 .globl sse_check | |
26 .globl sse_unavailable | |
27 .globl gs_load | |
28 .globl gs_thread | |
29 .globl _Atomic_cmpxchg_long_gcc | |
30 | |
31 // NOTE WELL! The _Copy functions are called directly | |
32 // from server-compiler-generated code via CallLeafNoFP, | |
33 // which means that they *must* either not use floating | |
34 // point or use it in the same manner as does the server | |
35 // compiler. | |
36 | |
37 .globl _Copy_conjoint_bytes | |
38 .globl _Copy_arrayof_conjoint_bytes | |
39 .globl _Copy_conjoint_jshorts_atomic | |
40 .globl _Copy_arrayof_conjoint_jshorts | |
41 .globl _Copy_conjoint_jints_atomic | |
42 .globl _Copy_arrayof_conjoint_jints | |
43 .globl _Copy_conjoint_jlongs_atomic | |
44 .globl _mmx_Copy_arrayof_conjoint_jshorts | |
45 | |
46 .section .text,"ax" | |
47 | |
48 / Support for void os::Solaris::init_thread_fpu_state() in os_solaris_i486.cpp | |
49 / Set fpu to 53 bit precision. This happens too early to use a stub. | |
50 .align 16 | |
51 fixcw: | |
52 pushl $0x27f | |
53 fldcw 0(%esp) | |
54 popl %eax | |
55 ret | |
56 | |
57 .align 16 | |
58 .globl SafeFetch32 | |
59 .globl SafeFetchN | |
60 .globl Fetch32PFI, Fetch32Resume | |
61 SafeFetch32: | |
62 SafeFetchN: | |
63 movl 0x8(%esp), %eax | |
64 movl 0x4(%esp), %ecx | |
65 Fetch32PFI: | |
66 movl (%ecx), %eax | |
67 Fetch32Resume: | |
68 ret | |
69 | |
70 | |
71 .align 16 | |
72 .globl SpinPause | |
73 SpinPause: | |
74 rep | |
75 nop | |
76 movl $1, %eax | |
77 ret | |
78 | |
79 | |
80 / Test SSE availability, used by os_solaris_i486.cpp | |
81 .align 16 | |
82 sse_check: | |
83 / Fault if SSE not available | |
84 xorps %xmm0,%xmm0 | |
85 / No fault | |
86 movl $1,%eax | |
87 ret | |
88 / Signal handler continues here if SSE is not available | |
89 sse_unavailable: | |
90 xorl %eax,%eax | |
91 ret | |
92 | |
93 / Fast thread accessors, used by threadLS_solaris_i486.cpp | |
94 .align 16 | |
95 gs_load: | |
96 movl 4(%esp),%ecx | |
97 movl %gs:(%ecx),%eax | |
98 ret | |
99 | |
100 .align 16 | |
101 gs_thread: | |
102 movl %gs:0x0,%eax | |
103 ret | |
104 | |
105 / Support for void Copy::conjoint_bytes(void* from, | |
106 / void* to, | |
107 / size_t count) | |
108 .align 16 | |
109 _Copy_conjoint_bytes: | |
110 pushl %esi | |
111 movl 4+12(%esp),%ecx / count | |
112 pushl %edi | |
113 movl 8+ 4(%esp),%esi / from | |
114 movl 8+ 8(%esp),%edi / to | |
115 cmpl %esi,%edi | |
116 leal -1(%esi,%ecx),%eax / from + count - 1 | |
117 jbe cb_CopyRight | |
118 cmpl %eax,%edi | |
119 jbe cb_CopyLeft | |
120 / copy from low to high | |
121 cb_CopyRight: | |
122 cmpl $3,%ecx | |
123 jbe 5f / <= 3 bytes | |
124 / align source address at dword address boundary | |
125 movl %ecx,%eax / original count | |
126 movl $4,%ecx | |
127 subl %esi,%ecx | |
128 andl $3,%ecx / prefix byte count | |
129 jz 1f / no prefix | |
130 subl %ecx,%eax / byte count less prefix | |
131 / copy prefix | |
132 subl %esi,%edi | |
133 0: movb (%esi),%dl | |
134 movb %dl,(%edi,%esi,1) | |
135 addl $1,%esi | |
136 subl $1,%ecx | |
137 jnz 0b | |
138 addl %esi,%edi | |
139 1: movl %eax,%ecx / byte count less prefix | |
140 shrl $2,%ecx / dword count | |
141 jz 4f / no dwords to move | |
142 cmpl $32,%ecx | |
143 jbe 2f / <= 32 dwords | |
144 / copy aligned dwords | |
145 rep; smovl | |
146 jmp 4f | |
147 / copy aligned dwords | |
148 2: subl %esi,%edi | |
149 .align 16 | |
150 3: movl (%esi),%edx | |
151 movl %edx,(%edi,%esi,1) | |
152 addl $4,%esi | |
153 subl $1,%ecx | |
154 jnz 3b | |
155 addl %esi,%edi | |
156 4: movl %eax,%ecx / byte count less prefix | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
157 5: andl $3,%ecx / suffix byte count |
0 | 158 jz 7f / no suffix |
159 / copy suffix | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
160 xorl %eax,%eax |
0 | 161 6: movb (%esi,%eax,1),%dl |
162 movb %dl,(%edi,%eax,1) | |
163 addl $1,%eax | |
164 subl $1,%ecx | |
165 jnz 6b | |
166 7: popl %edi | |
167 popl %esi | |
168 ret | |
169 / copy from high to low | |
170 cb_CopyLeft: | |
171 std | |
172 leal -4(%edi,%ecx),%edi / to + count - 4 | |
173 movl %eax,%esi / from + count - 1 | |
174 movl %ecx,%eax | |
175 subl $3,%esi / from + count - 4 | |
176 cmpl $3,%ecx | |
177 jbe 5f / <= 3 bytes | |
178 1: shrl $2,%ecx / dword count | |
179 jz 4f / no dwords to move | |
180 cmpl $32,%ecx | |
181 ja 3f / > 32 dwords | |
182 / copy dwords, aligned or not | |
183 subl %esi,%edi | |
184 .align 16 | |
185 2: movl (%esi),%edx | |
186 movl %edx,(%edi,%esi,1) | |
187 subl $4,%esi | |
188 subl $1,%ecx | |
189 jnz 2b | |
190 addl %esi,%edi | |
191 jmp 4f | |
192 / copy dwords, aligned or not | |
193 3: rep; smovl | |
194 4: movl %eax,%ecx / byte count | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
195 5: andl $3,%ecx / suffix byte count |
0 | 196 jz 7f / no suffix |
197 / copy suffix | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
198 subl %esi,%edi |
0 | 199 addl $3,%esi |
200 6: movb (%esi),%dl | |
201 movb %dl,(%edi,%esi,1) | |
202 subl $1,%esi | |
203 subl $1,%ecx | |
204 jnz 6b | |
205 7: cld | |
206 popl %edi | |
207 popl %esi | |
208 ret | |
209 | |
210 / Support for void Copy::arrayof_conjoint_bytes(void* from, | |
211 / void* to, | |
212 / size_t count) | |
213 / | |
214 / Same as _Copy_conjoint_bytes, except no source alignment check. | |
215 .align 16 | |
216 _Copy_arrayof_conjoint_bytes: | |
217 pushl %esi | |
218 movl 4+12(%esp),%ecx / count | |
219 pushl %edi | |
220 movl 8+ 4(%esp),%esi / from | |
221 movl 8+ 8(%esp),%edi / to | |
222 cmpl %esi,%edi | |
223 leal -1(%esi,%ecx),%eax / from + count - 1 | |
224 jbe acb_CopyRight | |
225 cmpl %eax,%edi | |
226 jbe acb_CopyLeft | |
227 / copy from low to high | |
228 acb_CopyRight: | |
229 cmpl $3,%ecx | |
230 jbe 5f | |
231 1: movl %ecx,%eax | |
232 shrl $2,%ecx | |
233 jz 4f | |
234 cmpl $32,%ecx | |
235 ja 3f | |
236 / copy aligned dwords | |
237 subl %esi,%edi | |
238 .align 16 | |
239 2: movl (%esi),%edx | |
240 movl %edx,(%edi,%esi,1) | |
241 addl $4,%esi | |
242 subl $1,%ecx | |
243 jnz 2b | |
244 addl %esi,%edi | |
245 jmp 4f | |
246 / copy aligned dwords | |
247 3: rep; smovl | |
248 4: movl %eax,%ecx | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
249 5: andl $3,%ecx |
0 | 250 jz 7f |
251 / copy suffix | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
252 xorl %eax,%eax |
0 | 253 6: movb (%esi,%eax,1),%dl |
254 movb %dl,(%edi,%eax,1) | |
255 addl $1,%eax | |
256 subl $1,%ecx | |
257 jnz 6b | |
258 7: popl %edi | |
259 popl %esi | |
260 ret | |
261 acb_CopyLeft: | |
262 std | |
263 leal -4(%edi,%ecx),%edi / to + count - 4 | |
264 movl %eax,%esi / from + count - 1 | |
265 movl %ecx,%eax | |
266 subl $3,%esi / from + count - 4 | |
267 cmpl $3,%ecx | |
268 jbe 5f | |
269 1: shrl $2,%ecx | |
270 jz 4f | |
271 cmpl $32,%ecx | |
272 jbe 2f / <= 32 dwords | |
273 rep; smovl | |
274 jmp 4f | |
275 .=.+8 | |
276 2: subl %esi,%edi | |
277 .align 16 | |
278 3: movl (%esi),%edx | |
279 movl %edx,(%edi,%esi,1) | |
280 subl $4,%esi | |
281 subl $1,%ecx | |
282 jnz 3b | |
283 addl %esi,%edi | |
284 4: movl %eax,%ecx | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
285 5: andl $3,%ecx |
0 | 286 jz 7f |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
287 subl %esi,%edi |
0 | 288 addl $3,%esi |
289 6: movb (%esi),%dl | |
290 movb %dl,(%edi,%esi,1) | |
291 subl $1,%esi | |
292 subl $1,%ecx | |
293 jnz 6b | |
294 7: cld | |
295 popl %edi | |
296 popl %esi | |
297 ret | |
298 | |
299 / Support for void Copy::conjoint_jshorts_atomic(void* from, | |
300 / void* to, | |
301 / size_t count) | |
302 .align 16 | |
303 _Copy_conjoint_jshorts_atomic: | |
304 pushl %esi | |
305 movl 4+12(%esp),%ecx / count | |
306 pushl %edi | |
307 movl 8+ 4(%esp),%esi / from | |
308 movl 8+ 8(%esp),%edi / to | |
309 cmpl %esi,%edi | |
310 leal -2(%esi,%ecx,2),%eax / from + count*2 - 2 | |
311 jbe cs_CopyRight | |
312 cmpl %eax,%edi | |
313 jbe cs_CopyLeft | |
314 / copy from low to high | |
315 cs_CopyRight: | |
316 / align source address at dword address boundary | |
317 movl %esi,%eax / original from | |
318 andl $3,%eax / either 0 or 2 | |
319 jz 1f / no prefix | |
320 / copy prefix | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
321 subl $1,%ecx |
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
322 jl 5f / zero count |
0 | 323 movw (%esi),%dx |
324 movw %dx,(%edi) | |
325 addl %eax,%esi / %eax == 2 | |
326 addl %eax,%edi | |
327 1: movl %ecx,%eax / word count less prefix | |
328 sarl %ecx / dword count | |
329 jz 4f / no dwords to move | |
330 cmpl $32,%ecx | |
331 jbe 2f / <= 32 dwords | |
332 / copy aligned dwords | |
333 rep; smovl | |
334 jmp 4f | |
335 / copy aligned dwords | |
336 2: subl %esi,%edi | |
337 .align 16 | |
338 3: movl (%esi),%edx | |
339 movl %edx,(%edi,%esi,1) | |
340 addl $4,%esi | |
341 subl $1,%ecx | |
342 jnz 3b | |
343 addl %esi,%edi | |
344 4: andl $1,%eax / suffix count | |
345 jz 5f / no suffix | |
346 / copy suffix | |
347 movw (%esi),%dx | |
348 movw %dx,(%edi) | |
349 5: popl %edi | |
350 popl %esi | |
351 ret | |
352 / copy from high to low | |
353 cs_CopyLeft: | |
354 std | |
355 leal -4(%edi,%ecx,2),%edi / to + count*2 - 4 | |
356 movl %eax,%esi / from + count*2 - 2 | |
357 movl %ecx,%eax | |
358 subl $2,%esi / from + count*2 - 4 | |
359 1: sarl %ecx / dword count | |
360 jz 4f / no dwords to move | |
361 cmpl $32,%ecx | |
362 ja 3f / > 32 dwords | |
363 subl %esi,%edi | |
364 .align 16 | |
365 2: movl (%esi),%edx | |
366 movl %edx,(%edi,%esi,1) | |
367 subl $4,%esi | |
368 subl $1,%ecx | |
369 jnz 2b | |
370 addl %esi,%edi | |
371 jmp 4f | |
372 3: rep; smovl | |
373 4: andl $1,%eax / suffix count | |
374 jz 5f / no suffix | |
375 / copy suffix | |
376 addl $2,%esi | |
377 addl $2,%edi | |
378 movw (%esi),%dx | |
379 movw %dx,(%edi) | |
380 5: cld | |
381 popl %edi | |
382 popl %esi | |
383 ret | |
384 | |
385 / Support for void Copy::arrayof_conjoint_jshorts(void* from, | |
386 / void* to, | |
387 / size_t count) | |
388 .align 16 | |
389 _Copy_arrayof_conjoint_jshorts: | |
390 pushl %esi | |
391 movl 4+12(%esp),%ecx / count | |
392 pushl %edi | |
393 movl 8+ 4(%esp),%esi / from | |
394 movl 8+ 8(%esp),%edi / to | |
395 cmpl %esi,%edi | |
396 leal -2(%esi,%ecx,2),%eax / from + count*2 - 2 | |
397 jbe acs_CopyRight | |
398 cmpl %eax,%edi | |
399 jbe acs_CopyLeft | |
400 acs_CopyRight: | |
401 movl %ecx,%eax / word count | |
402 sarl %ecx / dword count | |
403 jz 4f / no dwords to move | |
404 cmpl $32,%ecx | |
405 jbe 2f / <= 32 dwords | |
406 / copy aligned dwords | |
407 rep; smovl | |
408 jmp 4f | |
409 / copy aligned dwords | |
410 .=.+5 | |
411 2: subl %esi,%edi | |
412 .align 16 | |
413 3: movl (%esi),%edx | |
414 movl %edx,(%edi,%esi,1) | |
415 addl $4,%esi | |
416 subl $1,%ecx | |
417 jnz 3b | |
418 addl %esi,%edi | |
419 4: andl $1,%eax / suffix count | |
420 jz 5f / no suffix | |
421 / copy suffix | |
422 movw (%esi),%dx | |
423 movw %dx,(%edi) | |
424 5: popl %edi | |
425 popl %esi | |
426 ret | |
427 acs_CopyLeft: | |
428 std | |
429 leal -4(%edi,%ecx,2),%edi / to + count*2 - 4 | |
430 movl %eax,%esi / from + count*2 - 2 | |
431 movl %ecx,%eax | |
432 subl $2,%esi / from + count*2 - 4 | |
433 sarl %ecx / dword count | |
434 jz 4f / no dwords to move | |
435 cmpl $32,%ecx | |
436 ja 3f / > 32 dwords | |
437 subl %esi,%edi | |
438 .align 16 | |
439 2: movl (%esi),%edx | |
440 movl %edx,(%edi,%esi,1) | |
441 subl $4,%esi | |
442 subl $1,%ecx | |
443 jnz 2b | |
444 addl %esi,%edi | |
445 jmp 4f | |
446 3: rep; smovl | |
447 4: andl $1,%eax / suffix count | |
448 jz 5f / no suffix | |
449 / copy suffix | |
450 addl $2,%esi | |
451 addl $2,%edi | |
452 movw (%esi),%dx | |
453 movw %dx,(%edi) | |
454 5: cld | |
455 popl %edi | |
456 popl %esi | |
457 ret | |
458 | |
459 / Support for void Copy::conjoint_jints_atomic(void* from, | |
460 / void* to, | |
461 / size_t count) | |
462 / Equivalent to | |
463 / arrayof_conjoint_jints | |
464 .align 16 | |
465 _Copy_conjoint_jints_atomic: | |
466 _Copy_arrayof_conjoint_jints: | |
467 pushl %esi | |
468 movl 4+12(%esp),%ecx / count | |
469 pushl %edi | |
470 movl 8+ 4(%esp),%esi / from | |
471 movl 8+ 8(%esp),%edi / to | |
472 cmpl %esi,%edi | |
473 leal -4(%esi,%ecx,4),%eax / from + count*4 - 4 | |
474 jbe ci_CopyRight | |
475 cmpl %eax,%edi | |
476 jbe ci_CopyLeft | |
477 ci_CopyRight: | |
478 cmpl $32,%ecx | |
479 jbe 2f / <= 32 dwords | |
480 rep; smovl | |
481 popl %edi | |
482 popl %esi | |
483 ret | |
484 .=.+10 | |
485 2: subl %esi,%edi | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
486 jmp 4f |
0 | 487 .align 16 |
488 3: movl (%esi),%edx | |
489 movl %edx,(%edi,%esi,1) | |
490 addl $4,%esi | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
491 4: subl $1,%ecx |
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
492 jge 3b |
0 | 493 popl %edi |
494 popl %esi | |
495 ret | |
496 ci_CopyLeft: | |
497 std | |
498 leal -4(%edi,%ecx,4),%edi / to + count*4 - 4 | |
499 cmpl $32,%ecx | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
500 ja 4f / > 32 dwords |
0 | 501 subl %eax,%edi / eax == from + count*4 - 4 |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
502 jmp 3f |
0 | 503 .align 16 |
504 2: movl (%eax),%edx | |
505 movl %edx,(%edi,%eax,1) | |
506 subl $4,%eax | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
507 3: subl $1,%ecx |
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
508 jge 2b |
0 | 509 cld |
510 popl %edi | |
511 popl %esi | |
512 ret | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
513 4: movl %eax,%esi / from + count*4 - 4 |
0 | 514 rep; smovl |
515 cld | |
516 popl %edi | |
517 popl %esi | |
518 ret | |
519 | |
520 / Support for void Copy::conjoint_jlongs_atomic(jlong* from, | |
521 / jlong* to, | |
522 / size_t count) | |
523 / | |
524 / 32-bit | |
525 / | |
526 / count treated as signed | |
527 / | |
528 / if (from > to) { | |
529 / while (--count >= 0) { | |
530 / *to++ = *from++; | |
531 / } | |
532 / } else { | |
533 / while (--count >= 0) { | |
534 / to[count] = from[count]; | |
535 / } | |
536 / } | |
537 .align 16 | |
538 _Copy_conjoint_jlongs_atomic: | |
539 movl 4+8(%esp),%ecx / count | |
540 movl 4+0(%esp),%eax / from | |
541 movl 4+4(%esp),%edx / to | |
542 cmpl %eax,%edx | |
543 jae cla_CopyLeft | |
544 cla_CopyRight: | |
545 subl %eax,%edx | |
546 jmp 2f | |
547 .align 16 | |
548 1: fildll (%eax) | |
549 fistpll (%edx,%eax,1) | |
550 addl $8,%eax | |
551 2: subl $1,%ecx | |
552 jge 1b | |
553 ret | |
554 .align 16 | |
555 3: fildll (%eax,%ecx,8) | |
556 fistpll (%edx,%ecx,8) | |
557 cla_CopyLeft: | |
558 subl $1,%ecx | |
559 jge 3b | |
560 ret | |
561 | |
562 / Support for void Copy::arrayof_conjoint_jshorts(void* from, | |
563 / void* to, | |
564 / size_t count) | |
565 .align 16 | |
566 _mmx_Copy_arrayof_conjoint_jshorts: | |
567 pushl %esi | |
568 movl 4+12(%esp),%ecx | |
569 pushl %edi | |
570 movl 8+ 4(%esp),%esi | |
571 movl 8+ 8(%esp),%edi | |
572 cmpl %esi,%edi | |
573 leal -2(%esi,%ecx,2),%eax | |
574 jbe mmx_acs_CopyRight | |
575 cmpl %eax,%edi | |
576 jbe mmx_acs_CopyLeft | |
577 mmx_acs_CopyRight: | |
578 movl %ecx,%eax | |
579 sarl %ecx | |
580 je 5f | |
581 cmpl $33,%ecx | |
582 jae 3f | |
583 1: subl %esi,%edi | |
584 .align 16 | |
585 2: movl (%esi),%edx | |
586 movl %edx,(%edi,%esi,1) | |
587 addl $4,%esi | |
588 subl $1,%ecx | |
589 jnz 2b | |
590 addl %esi,%edi | |
591 jmp 5f | |
592 3: smovl / align to 8 bytes, we know we are 4 byte aligned to start | |
593 subl $1,%ecx | |
594 4: .align 16 | |
595 movq 0(%esi),%mm0 | |
596 addl $64,%edi | |
597 movq 8(%esi),%mm1 | |
598 subl $16,%ecx | |
599 movq 16(%esi),%mm2 | |
600 movq %mm0,-64(%edi) | |
601 movq 24(%esi),%mm0 | |
602 movq %mm1,-56(%edi) | |
603 movq 32(%esi),%mm1 | |
604 movq %mm2,-48(%edi) | |
605 movq 40(%esi),%mm2 | |
606 movq %mm0,-40(%edi) | |
607 movq 48(%esi),%mm0 | |
608 movq %mm1,-32(%edi) | |
609 movq 56(%esi),%mm1 | |
610 movq %mm2,-24(%edi) | |
611 movq %mm0,-16(%edi) | |
612 addl $64,%esi | |
613 movq %mm1,-8(%edi) | |
614 cmpl $16,%ecx | |
615 jge 4b | |
616 emms | |
617 testl %ecx,%ecx | |
618 ja 1b | |
619 5: andl $1,%eax | |
620 je 7f | |
621 6: movw (%esi),%dx | |
622 movw %dx,(%edi) | |
623 7: popl %edi | |
624 popl %esi | |
625 ret | |
626 mmx_acs_CopyLeft: | |
627 std | |
628 leal -4(%edi,%ecx,2),%edi | |
629 movl %eax,%esi | |
630 movl %ecx,%eax | |
631 subl $2,%esi | |
632 sarl %ecx | |
633 je 4f | |
634 cmpl $32,%ecx | |
635 ja 3f | |
636 subl %esi,%edi | |
637 .align 16 | |
638 2: movl (%esi),%edx | |
639 movl %edx,(%edi,%esi,1) | |
640 subl $4,%esi | |
641 subl $1,%ecx | |
642 jnz 2b | |
643 addl %esi,%edi | |
644 jmp 4f | |
645 3: rep; smovl | |
646 4: andl $1,%eax | |
647 je 6f | |
648 addl $2,%esi | |
649 addl $2,%edi | |
650 5: movw (%esi),%dx | |
651 movw %dx,(%edi) | |
652 6: cld | |
653 popl %edi | |
654 popl %esi | |
655 ret | |
656 | |
657 | |
658 / Support for jlong Atomic::cmpxchg(jlong exchange_value, | |
659 / volatile jlong* dest, | |
660 / jlong compare_value, | |
661 / bool is_MP) | |
662 / Used only for Solaris/gcc builds | |
663 .align 16 | |
664 _Atomic_cmpxchg_long_gcc: | |
665 / 8(%esp) : return PC | |
666 pushl %ebx / 4(%esp) : old %ebx | |
667 pushl %edi / 0(%esp) : old %edi | |
668 movl 12(%esp), %ebx / 12(%esp) : exchange_value (low) | |
669 movl 16(%esp), %ecx / 16(%esp) : exchange_value (high) | |
670 movl 24(%esp), %eax / 24(%esp) : compare_value (low) | |
671 movl 28(%esp), %edx / 28(%esp) : compare_value (high) | |
672 movl 20(%esp), %edi / 20(%esp) : dest | |
673 cmpl $0, 32(%esp) / 32(%esp) : is_MP | |
674 je 1f | |
675 lock | |
676 1: cmpxchg8b (%edi) | |
677 popl %edi | |
678 popl %ebx | |
679 ret |