1 # |
1 # |
2 # Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
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 |
6 # under the terms of the GNU General Public License version 2 only, as |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 # |
18 # |
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
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 |
20 # or visit www.oracle.com if you need additional information or have any |
21 # questions. |
21 # questions. |
22 # |
22 # |
23 |
23 |
24 |
24 |
25 # NOTE WELL! The _Copy functions are called directly |
25 # NOTE WELL! The _Copy functions are called directly |
26 # from server-compiler-generated code via CallLeafNoFP, |
26 # from server-compiler-generated code via CallLeafNoFP, |
27 # which means that they *must* either not use floating |
27 # which means that they *must* either not use floating |
28 # point or use it in the same manner as does the server |
28 # point or use it in the same manner as does the server |
29 # compiler. |
29 # compiler. |
30 |
30 |
31 .globl _Copy_conjoint_bytes |
31 .globl _Copy_conjoint_bytes |
32 .globl _Copy_arrayof_conjoint_bytes |
32 .globl _Copy_arrayof_conjoint_bytes |
33 .globl _Copy_conjoint_jshorts_atomic |
33 .globl _Copy_conjoint_jshorts_atomic |
34 .globl _Copy_arrayof_conjoint_jshorts |
34 .globl _Copy_arrayof_conjoint_jshorts |
35 .globl _Copy_conjoint_jints_atomic |
35 .globl _Copy_conjoint_jints_atomic |
260 movl 8+ 8(%esp),%edi # to |
260 movl 8+ 8(%esp),%edi # to |
261 cmpl %esi,%edi |
261 cmpl %esi,%edi |
262 leal -2(%esi,%ecx,2),%eax # from + count*2 - 2 |
262 leal -2(%esi,%ecx,2),%eax # from + count*2 - 2 |
263 jbe cs_CopyRight |
263 jbe cs_CopyRight |
264 cmpl %eax,%edi |
264 cmpl %eax,%edi |
265 jbe cs_CopyLeft |
265 jbe cs_CopyLeft |
266 # copy from low to high |
266 # copy from low to high |
267 cs_CopyRight: |
267 cs_CopyRight: |
268 # align source address at dword address boundary |
268 # align source address at dword address boundary |
269 movl %esi,%eax # original from |
269 movl %esi,%eax # original from |
270 andl $3,%eax # either 0 or 2 |
270 andl $3,%eax # either 0 or 2 |
281 jz 4f # no dwords to move |
281 jz 4f # no dwords to move |
282 cmpl $32,%ecx |
282 cmpl $32,%ecx |
283 jbe 2f # <= 32 dwords |
283 jbe 2f # <= 32 dwords |
284 # copy aligned dwords |
284 # copy aligned dwords |
285 rep; smovl |
285 rep; smovl |
286 jmp 4f |
286 jmp 4f |
287 # copy aligned dwords |
287 # copy aligned dwords |
288 2: subl %esi,%edi |
288 2: subl %esi,%edi |
289 .p2align 4,,15 |
289 .p2align 4,,15 |
290 3: movl (%esi),%edx |
290 3: movl (%esi),%edx |
291 movl %edx,(%edi,%esi,1) |
291 movl %edx,(%edi,%esi,1) |
347 movl 8+ 8(%esp),%edi # to |
347 movl 8+ 8(%esp),%edi # to |
348 cmpl %esi,%edi |
348 cmpl %esi,%edi |
349 leal -2(%esi,%ecx,2),%eax # from + count*2 - 2 |
349 leal -2(%esi,%ecx,2),%eax # from + count*2 - 2 |
350 jbe acs_CopyRight |
350 jbe acs_CopyRight |
351 cmpl %eax,%edi |
351 cmpl %eax,%edi |
352 jbe acs_CopyLeft |
352 jbe acs_CopyLeft |
353 acs_CopyRight: |
353 acs_CopyRight: |
354 movl %ecx,%eax # word count |
354 movl %ecx,%eax # word count |
355 sarl %ecx # dword count |
355 sarl %ecx # dword count |
356 jz 4f # no dwords to move |
356 jz 4f # no dwords to move |
357 cmpl $32,%ecx |
357 cmpl $32,%ecx |
358 jbe 2f # <= 32 dwords |
358 jbe 2f # <= 32 dwords |
359 # copy aligned dwords |
359 # copy aligned dwords |
360 rep; smovl |
360 rep; smovl |
361 jmp 4f |
361 jmp 4f |
362 # copy aligned dwords |
362 # copy aligned dwords |
363 .space 5 |
363 .space 5 |
364 2: subl %esi,%edi |
364 2: subl %esi,%edi |
365 .p2align 4,,15 |
365 .p2align 4,,15 |
366 3: movl (%esi),%edx |
366 3: movl (%esi),%edx |
367 movl %edx,(%edi,%esi,1) |
367 movl %edx,(%edi,%esi,1) |
368 addl $4,%esi |
368 addl $4,%esi |
369 subl $1,%ecx |
369 subl $1,%ecx |
610 popl %edi |
610 popl %edi |
611 popl %esi |
611 popl %esi |
612 ret |
612 ret |
613 |
613 |
614 |
614 |
615 # Support for jlong Atomic::cmpxchg(jlong exchange_value, |
615 # Support for jlong Atomic::cmpxchg(volatile jlong* dest, |
616 # volatile jlong* dest, |
616 # jlong compare_value, |
617 # jlong compare_value) |
617 # jlong exchange_value) |
618 # |
618 # |
619 .p2align 4,,15 |
619 .p2align 4,,15 |
620 .type _Atomic_cmpxchg_long,@function |
620 .type _Atomic_cmpxchg_long,@function |
621 _Atomic_cmpxchg_long: |
621 _Atomic_cmpxchg_long: |
622 # 8(%esp) : return PC |
622 # 8(%esp) : return PC |