annotate src/os_cpu/linux_x86/vm/linux_x86_32.s @ 4710:41406797186b

7113012: G1: rename not-fully-young GCs as "mixed" Summary: Renamed partially-young GCs as mixed and fully-young GCs as young. Change all external output that includes those terms (GC log and GC ergo log) as well as any comments, fields, methods, etc. The changeset also includes very minor code tidying up (added some curly brackets). Reviewed-by: johnc, brutisso
author tonyp
date Fri, 16 Dec 2011 02:14:27 -0500
parents bb8e3b66bde6
children 2cb5d5f6d5e5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 #
2114
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
2 # Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 #
a61af66fc99e Initial load
duke
parents:
diff changeset
5 # This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 # under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 # published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 #
a61af66fc99e Initial load
duke
parents:
diff changeset
9 # This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 # version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 # accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 #
a61af66fc99e Initial load
duke
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 # 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
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
a61af66fc99e Initial load
duke
parents:
diff changeset
22 #
a61af66fc99e Initial load
duke
parents:
diff changeset
23
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 # NOTE WELL! The _Copy functions are called directly
a61af66fc99e Initial load
duke
parents:
diff changeset
26 # from server-compiler-generated code via CallLeafNoFP,
a61af66fc99e Initial load
duke
parents:
diff changeset
27 # which means that they *must* either not use floating
a61af66fc99e Initial load
duke
parents:
diff changeset
28 # point or use it in the same manner as does the server
a61af66fc99e Initial load
duke
parents:
diff changeset
29 # compiler.
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 .globl _Copy_conjoint_bytes
a61af66fc99e Initial load
duke
parents:
diff changeset
32 .globl _Copy_arrayof_conjoint_bytes
a61af66fc99e Initial load
duke
parents:
diff changeset
33 .globl _Copy_conjoint_jshorts_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
34 .globl _Copy_arrayof_conjoint_jshorts
a61af66fc99e Initial load
duke
parents:
diff changeset
35 .globl _Copy_conjoint_jints_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
36 .globl _Copy_arrayof_conjoint_jints
a61af66fc99e Initial load
duke
parents:
diff changeset
37 .globl _Copy_conjoint_jlongs_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
38 .globl _mmx_Copy_arrayof_conjoint_jshorts
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 .globl _Atomic_cmpxchg_long
2114
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
41 .globl _Atomic_move_long
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 .text
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 .globl SafeFetch32, Fetch32PFI, Fetch32Resume
a61af66fc99e Initial load
duke
parents:
diff changeset
46 .globl SafeFetchN
a61af66fc99e Initial load
duke
parents:
diff changeset
47 ## TODO: avoid exposing Fetch32PFI and Fetch32Resume.
a61af66fc99e Initial load
duke
parents:
diff changeset
48 ## Instead, the signal handler would call a new SafeFetchTriage(FaultingEIP)
a61af66fc99e Initial load
duke
parents:
diff changeset
49 ## routine to vet the address. If the address is the faulting LD then
a61af66fc99e Initial load
duke
parents:
diff changeset
50 ## SafeFetchTriage() would return the resume-at EIP, otherwise null.
a61af66fc99e Initial load
duke
parents:
diff changeset
51 .type SafeFetch32,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
52 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
53 SafeFetch32:
a61af66fc99e Initial load
duke
parents:
diff changeset
54 SafeFetchN:
a61af66fc99e Initial load
duke
parents:
diff changeset
55 movl 0x8(%esp), %eax
a61af66fc99e Initial load
duke
parents:
diff changeset
56 movl 0x4(%esp), %ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
57 Fetch32PFI:
a61af66fc99e Initial load
duke
parents:
diff changeset
58 movl (%ecx), %eax
a61af66fc99e Initial load
duke
parents:
diff changeset
59 Fetch32Resume:
a61af66fc99e Initial load
duke
parents:
diff changeset
60 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 .globl SpinPause
a61af66fc99e Initial load
duke
parents:
diff changeset
64 .type SpinPause,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
65 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
66 SpinPause:
a61af66fc99e Initial load
duke
parents:
diff changeset
67 rep
a61af66fc99e Initial load
duke
parents:
diff changeset
68 nop
a61af66fc99e Initial load
duke
parents:
diff changeset
69 movl $1, %eax
a61af66fc99e Initial load
duke
parents:
diff changeset
70 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 # Support for void Copy::conjoint_bytes(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
73 # void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
74 # size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
75 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
76 .type _Copy_conjoint_bytes,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
77 _Copy_conjoint_bytes:
a61af66fc99e Initial load
duke
parents:
diff changeset
78 pushl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
79 movl 4+12(%esp),%ecx # count
a61af66fc99e Initial load
duke
parents:
diff changeset
80 pushl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
81 movl 8+ 4(%esp),%esi # from
a61af66fc99e Initial load
duke
parents:
diff changeset
82 movl 8+ 8(%esp),%edi # to
a61af66fc99e Initial load
duke
parents:
diff changeset
83 cmpl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
84 leal -1(%esi,%ecx),%eax # from + count - 1
a61af66fc99e Initial load
duke
parents:
diff changeset
85 jbe cb_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
86 cmpl %eax,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
87 jbe cb_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
88 # copy from low to high
a61af66fc99e Initial load
duke
parents:
diff changeset
89 cb_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
90 cmpl $3,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
91 jbe 5f # <= 3 bytes
a61af66fc99e Initial load
duke
parents:
diff changeset
92 # align source address at dword address boundary
a61af66fc99e Initial load
duke
parents:
diff changeset
93 movl %ecx,%eax # original count
a61af66fc99e Initial load
duke
parents:
diff changeset
94 movl $4,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
95 subl %esi,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
96 andl $3,%ecx # prefix byte count
a61af66fc99e Initial load
duke
parents:
diff changeset
97 jz 1f # no prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
98 subl %ecx,%eax # byte count less prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
99 # copy prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
100 subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
101 0: movb (%esi),%dl
a61af66fc99e Initial load
duke
parents:
diff changeset
102 movb %dl,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
103 addl $1,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
104 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
105 jnz 0b
a61af66fc99e Initial load
duke
parents:
diff changeset
106 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
107 1: movl %eax,%ecx # byte count less prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
108 shrl $2,%ecx # dword count
a61af66fc99e Initial load
duke
parents:
diff changeset
109 jz 4f # no dwords to move
a61af66fc99e Initial load
duke
parents:
diff changeset
110 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
111 jbe 2f # <= 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
112 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
113 rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
114 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
115 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
116 2: subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
117 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
118 3: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
119 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
120 addl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
121 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
122 jnz 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
123 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
124 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
125 5: andl $3,%ecx # suffix byte count
0
a61af66fc99e Initial load
duke
parents:
diff changeset
126 jz 7f # no suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
127 # copy suffix
1603
d93949c5bdcc 6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents: 1552
diff changeset
128 xorl %eax,%eax
0
a61af66fc99e Initial load
duke
parents:
diff changeset
129 6: movb (%esi,%eax,1),%dl
a61af66fc99e Initial load
duke
parents:
diff changeset
130 movb %dl,(%edi,%eax,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
131 addl $1,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
132 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
133 jnz 6b
a61af66fc99e Initial load
duke
parents:
diff changeset
134 7: popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
135 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
136 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
137 # copy from high to low
a61af66fc99e Initial load
duke
parents:
diff changeset
138 cb_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
139 std
a61af66fc99e Initial load
duke
parents:
diff changeset
140 leal -4(%edi,%ecx),%edi # to + count - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
141 movl %eax,%esi # from + count - 1
a61af66fc99e Initial load
duke
parents:
diff changeset
142 movl %ecx,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
143 subl $3,%esi # from + count - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
144 cmpl $3,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
145 jbe 5f # <= 3 bytes
a61af66fc99e Initial load
duke
parents:
diff changeset
146 1: shrl $2,%ecx # dword count
a61af66fc99e Initial load
duke
parents:
diff changeset
147 jz 4f # no dwords to move
a61af66fc99e Initial load
duke
parents:
diff changeset
148 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
149 ja 3f # > 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
150 # copy dwords, aligned or not
a61af66fc99e Initial load
duke
parents:
diff changeset
151 subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
152 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
153 2: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
154 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
155 subl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
156 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
157 jnz 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
158 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
159 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
160 # copy dwords, aligned or not
a61af66fc99e Initial load
duke
parents:
diff changeset
161 3: rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
162 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
163 5: andl $3,%ecx # suffix byte count
0
a61af66fc99e Initial load
duke
parents:
diff changeset
164 jz 7f # no suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
165 # copy suffix
1603
d93949c5bdcc 6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents: 1552
diff changeset
166 subl %esi,%edi
0
a61af66fc99e Initial load
duke
parents:
diff changeset
167 addl $3,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
168 6: movb (%esi),%dl
a61af66fc99e Initial load
duke
parents:
diff changeset
169 movb %dl,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
170 subl $1,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
171 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
172 jnz 6b
a61af66fc99e Initial load
duke
parents:
diff changeset
173 7: cld
a61af66fc99e Initial load
duke
parents:
diff changeset
174 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
175 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
176 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178 # Support for void Copy::arrayof_conjoint_bytes(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
179 # void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
180 # size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
181 #
a61af66fc99e Initial load
duke
parents:
diff changeset
182 # Same as _Copy_conjoint_bytes, except no source alignment check.
a61af66fc99e Initial load
duke
parents:
diff changeset
183 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
184 .type _Copy_arrayof_conjoint_bytes,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
185 _Copy_arrayof_conjoint_bytes:
a61af66fc99e Initial load
duke
parents:
diff changeset
186 pushl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
187 movl 4+12(%esp),%ecx # count
a61af66fc99e Initial load
duke
parents:
diff changeset
188 pushl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
189 movl 8+ 4(%esp),%esi # from
a61af66fc99e Initial load
duke
parents:
diff changeset
190 movl 8+ 8(%esp),%edi # to
a61af66fc99e Initial load
duke
parents:
diff changeset
191 cmpl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
192 leal -1(%esi,%ecx),%eax # from + count - 1
a61af66fc99e Initial load
duke
parents:
diff changeset
193 jbe acb_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
194 cmpl %eax,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
195 jbe acb_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
196 # copy from low to high
a61af66fc99e Initial load
duke
parents:
diff changeset
197 acb_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
198 cmpl $3,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
199 jbe 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
200 1: movl %ecx,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
201 shrl $2,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
202 jz 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
203 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
204 ja 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
205 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
206 subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
207 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
208 2: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
209 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
210 addl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
211 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
212 jnz 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
213 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
214 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
215 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
216 3: rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
217 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
218 5: andl $3,%ecx
0
a61af66fc99e Initial load
duke
parents:
diff changeset
219 jz 7f
a61af66fc99e Initial load
duke
parents:
diff changeset
220 # copy suffix
1603
d93949c5bdcc 6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents: 1552
diff changeset
221 xorl %eax,%eax
0
a61af66fc99e Initial load
duke
parents:
diff changeset
222 6: movb (%esi,%eax,1),%dl
a61af66fc99e Initial load
duke
parents:
diff changeset
223 movb %dl,(%edi,%eax,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
224 addl $1,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
225 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
226 jnz 6b
a61af66fc99e Initial load
duke
parents:
diff changeset
227 7: popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
228 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
229 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
230 acb_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
231 std
a61af66fc99e Initial load
duke
parents:
diff changeset
232 leal -4(%edi,%ecx),%edi # to + count - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
233 movl %eax,%esi # from + count - 1
a61af66fc99e Initial load
duke
parents:
diff changeset
234 movl %ecx,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
235 subl $3,%esi # from + count - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
236 cmpl $3,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
237 jbe 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
238 1: shrl $2,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
239 jz 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
240 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
241 jbe 2f # <= 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
242 rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
243 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
244 .=.+8
a61af66fc99e Initial load
duke
parents:
diff changeset
245 2: subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
246 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
247 3: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
248 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
249 subl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
250 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
251 jnz 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
252 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
253 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
254 5: andl $3,%ecx
0
a61af66fc99e Initial load
duke
parents:
diff changeset
255 jz 7f
1603
d93949c5bdcc 6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents: 1552
diff changeset
256 subl %esi,%edi
0
a61af66fc99e Initial load
duke
parents:
diff changeset
257 addl $3,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
258 6: movb (%esi),%dl
a61af66fc99e Initial load
duke
parents:
diff changeset
259 movb %dl,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
260 subl $1,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
261 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
262 jnz 6b
a61af66fc99e Initial load
duke
parents:
diff changeset
263 7: cld
a61af66fc99e Initial load
duke
parents:
diff changeset
264 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
265 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
266 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
267
a61af66fc99e Initial load
duke
parents:
diff changeset
268 # Support for void Copy::conjoint_jshorts_atomic(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
269 # void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
270 # size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
271 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
272 .type _Copy_conjoint_jshorts_atomic,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
273 _Copy_conjoint_jshorts_atomic:
a61af66fc99e Initial load
duke
parents:
diff changeset
274 pushl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
275 movl 4+12(%esp),%ecx # count
a61af66fc99e Initial load
duke
parents:
diff changeset
276 pushl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
277 movl 8+ 4(%esp),%esi # from
a61af66fc99e Initial load
duke
parents:
diff changeset
278 movl 8+ 8(%esp),%edi # to
a61af66fc99e Initial load
duke
parents:
diff changeset
279 cmpl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
280 leal -2(%esi,%ecx,2),%eax # from + count*2 - 2
a61af66fc99e Initial load
duke
parents:
diff changeset
281 jbe cs_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
282 cmpl %eax,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
283 jbe cs_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
284 # copy from low to high
a61af66fc99e Initial load
duke
parents:
diff changeset
285 cs_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
286 # align source address at dword address boundary
a61af66fc99e Initial load
duke
parents:
diff changeset
287 movl %esi,%eax # original from
a61af66fc99e Initial load
duke
parents:
diff changeset
288 andl $3,%eax # either 0 or 2
a61af66fc99e Initial load
duke
parents:
diff changeset
289 jz 1f # no prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
290 # copy prefix
1603
d93949c5bdcc 6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents: 1552
diff changeset
291 subl $1,%ecx
d93949c5bdcc 6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents: 1552
diff changeset
292 jl 5f # zero count
0
a61af66fc99e Initial load
duke
parents:
diff changeset
293 movw (%esi),%dx
a61af66fc99e Initial load
duke
parents:
diff changeset
294 movw %dx,(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
295 addl %eax,%esi # %eax == 2
a61af66fc99e Initial load
duke
parents:
diff changeset
296 addl %eax,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
297 1: movl %ecx,%eax # word count less prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
298 sarl %ecx # dword count
a61af66fc99e Initial load
duke
parents:
diff changeset
299 jz 4f # no dwords to move
a61af66fc99e Initial load
duke
parents:
diff changeset
300 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
301 jbe 2f # <= 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
302 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
303 rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
304 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
305 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
306 2: subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
307 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
308 3: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
309 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
310 addl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
311 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
312 jnz 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
313 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
314 4: andl $1,%eax # suffix count
a61af66fc99e Initial load
duke
parents:
diff changeset
315 jz 5f # no suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
316 # copy suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
317 movw (%esi),%dx
a61af66fc99e Initial load
duke
parents:
diff changeset
318 movw %dx,(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
319 5: popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
320 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
321 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
322 # copy from high to low
a61af66fc99e Initial load
duke
parents:
diff changeset
323 cs_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
324 std
a61af66fc99e Initial load
duke
parents:
diff changeset
325 leal -4(%edi,%ecx,2),%edi # to + count*2 - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
326 movl %eax,%esi # from + count*2 - 2
a61af66fc99e Initial load
duke
parents:
diff changeset
327 movl %ecx,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
328 subl $2,%esi # from + count*2 - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
329 1: sarl %ecx # dword count
a61af66fc99e Initial load
duke
parents:
diff changeset
330 jz 4f # no dwords to move
a61af66fc99e Initial load
duke
parents:
diff changeset
331 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
332 ja 3f # > 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
333 subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
334 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
335 2: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
336 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
337 subl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
338 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
339 jnz 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
340 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
341 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
342 3: rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
343 4: andl $1,%eax # suffix count
a61af66fc99e Initial load
duke
parents:
diff changeset
344 jz 5f # no suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
345 # copy suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
346 addl $2,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
347 addl $2,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
348 movw (%esi),%dx
a61af66fc99e Initial load
duke
parents:
diff changeset
349 movw %dx,(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
350 5: cld
a61af66fc99e Initial load
duke
parents:
diff changeset
351 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
352 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
353 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
354
a61af66fc99e Initial load
duke
parents:
diff changeset
355 # Support for void Copy::arrayof_conjoint_jshorts(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
356 # void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
357 # size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
358 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
359 .type _Copy_arrayof_conjoint_jshorts,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
360 _Copy_arrayof_conjoint_jshorts:
a61af66fc99e Initial load
duke
parents:
diff changeset
361 pushl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
362 movl 4+12(%esp),%ecx # count
a61af66fc99e Initial load
duke
parents:
diff changeset
363 pushl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
364 movl 8+ 4(%esp),%esi # from
a61af66fc99e Initial load
duke
parents:
diff changeset
365 movl 8+ 8(%esp),%edi # to
a61af66fc99e Initial load
duke
parents:
diff changeset
366 cmpl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
367 leal -2(%esi,%ecx,2),%eax # from + count*2 - 2
a61af66fc99e Initial load
duke
parents:
diff changeset
368 jbe acs_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
369 cmpl %eax,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
370 jbe acs_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
371 acs_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
372 movl %ecx,%eax # word count
a61af66fc99e Initial load
duke
parents:
diff changeset
373 sarl %ecx # dword count
a61af66fc99e Initial load
duke
parents:
diff changeset
374 jz 4f # no dwords to move
a61af66fc99e Initial load
duke
parents:
diff changeset
375 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
376 jbe 2f # <= 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
377 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
378 rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
379 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
380 # copy aligned dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
381 .=.+5
a61af66fc99e Initial load
duke
parents:
diff changeset
382 2: subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
383 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
384 3: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
385 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
386 addl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
387 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
388 jnz 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
389 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
390 4: andl $1,%eax # suffix count
a61af66fc99e Initial load
duke
parents:
diff changeset
391 jz 5f # no suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
392 # copy suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
393 movw (%esi),%dx
a61af66fc99e Initial load
duke
parents:
diff changeset
394 movw %dx,(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
395 5: popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
396 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
397 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
398 acs_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
399 std
a61af66fc99e Initial load
duke
parents:
diff changeset
400 leal -4(%edi,%ecx,2),%edi # to + count*2 - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
401 movl %eax,%esi # from + count*2 - 2
a61af66fc99e Initial load
duke
parents:
diff changeset
402 movl %ecx,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
403 subl $2,%esi # from + count*2 - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
404 sarl %ecx # dword count
a61af66fc99e Initial load
duke
parents:
diff changeset
405 jz 4f # no dwords to move
a61af66fc99e Initial load
duke
parents:
diff changeset
406 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
407 ja 3f # > 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
408 subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
409 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
410 2: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
411 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
412 subl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
413 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
414 jnz 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
415 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
416 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
417 3: rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
418 4: andl $1,%eax # suffix count
a61af66fc99e Initial load
duke
parents:
diff changeset
419 jz 5f # no suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
420 # copy suffix
a61af66fc99e Initial load
duke
parents:
diff changeset
421 addl $2,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
422 addl $2,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
423 movw (%esi),%dx
a61af66fc99e Initial load
duke
parents:
diff changeset
424 movw %dx,(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
425 5: cld
a61af66fc99e Initial load
duke
parents:
diff changeset
426 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
427 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
428 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
429
a61af66fc99e Initial load
duke
parents:
diff changeset
430 # Support for void Copy::conjoint_jints_atomic(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
431 # void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
432 # size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
433 # Equivalent to
a61af66fc99e Initial load
duke
parents:
diff changeset
434 # arrayof_conjoint_jints
a61af66fc99e Initial load
duke
parents:
diff changeset
435 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
436 .type _Copy_conjoint_jints_atomic,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
437 .type _Copy_arrayof_conjoint_jints,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
438 _Copy_conjoint_jints_atomic:
a61af66fc99e Initial load
duke
parents:
diff changeset
439 _Copy_arrayof_conjoint_jints:
a61af66fc99e Initial load
duke
parents:
diff changeset
440 pushl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
441 movl 4+12(%esp),%ecx # count
a61af66fc99e Initial load
duke
parents:
diff changeset
442 pushl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
443 movl 8+ 4(%esp),%esi # from
a61af66fc99e Initial load
duke
parents:
diff changeset
444 movl 8+ 8(%esp),%edi # to
a61af66fc99e Initial load
duke
parents:
diff changeset
445 cmpl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
446 leal -4(%esi,%ecx,4),%eax # from + count*4 - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
447 jbe ci_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
448 cmpl %eax,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
449 jbe ci_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
450 ci_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
451 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
452 jbe 2f # <= 32 dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
453 rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
454 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
455 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
456 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
457 .=.+10
a61af66fc99e Initial load
duke
parents:
diff changeset
458 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
459 jmp 4f
0
a61af66fc99e Initial load
duke
parents:
diff changeset
460 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
461 3: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
462 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
463 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
464 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
465 jge 3b
0
a61af66fc99e Initial load
duke
parents:
diff changeset
466 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
467 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
468 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
469 ci_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
470 std
a61af66fc99e Initial load
duke
parents:
diff changeset
471 leal -4(%edi,%ecx,4),%edi # to + count*4 - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
472 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
473 ja 4f # > 32 dwords
0
a61af66fc99e Initial load
duke
parents:
diff changeset
474 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
475 jmp 3f
0
a61af66fc99e Initial load
duke
parents:
diff changeset
476 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
477 2: movl (%eax),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
478 movl %edx,(%edi,%eax,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
479 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
480 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
481 jge 2b
0
a61af66fc99e Initial load
duke
parents:
diff changeset
482 cld
a61af66fc99e Initial load
duke
parents:
diff changeset
483 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
484 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
485 ret
1603
d93949c5bdcc 6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents: 1552
diff changeset
486 4: movl %eax,%esi # from + count*4 - 4
0
a61af66fc99e Initial load
duke
parents:
diff changeset
487 rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
488 cld
a61af66fc99e Initial load
duke
parents:
diff changeset
489 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
490 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
491 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
492
a61af66fc99e Initial load
duke
parents:
diff changeset
493 # Support for void Copy::conjoint_jlongs_atomic(jlong* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
494 # jlong* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
495 # size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
496 #
a61af66fc99e Initial load
duke
parents:
diff changeset
497 # 32-bit
a61af66fc99e Initial load
duke
parents:
diff changeset
498 #
a61af66fc99e Initial load
duke
parents:
diff changeset
499 # count treated as signed
a61af66fc99e Initial load
duke
parents:
diff changeset
500 #
a61af66fc99e Initial load
duke
parents:
diff changeset
501 # if (from > to) {
a61af66fc99e Initial load
duke
parents:
diff changeset
502 # while (--count >= 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
503 # *to++ = *from++;
a61af66fc99e Initial load
duke
parents:
diff changeset
504 # }
a61af66fc99e Initial load
duke
parents:
diff changeset
505 # } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
506 # while (--count >= 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
507 # to[count] = from[count];
a61af66fc99e Initial load
duke
parents:
diff changeset
508 # }
a61af66fc99e Initial load
duke
parents:
diff changeset
509 # }
a61af66fc99e Initial load
duke
parents:
diff changeset
510 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
511 .type _Copy_conjoint_jlongs_atomic,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
512 _Copy_conjoint_jlongs_atomic:
a61af66fc99e Initial load
duke
parents:
diff changeset
513 movl 4+8(%esp),%ecx # count
a61af66fc99e Initial load
duke
parents:
diff changeset
514 movl 4+0(%esp),%eax # from
a61af66fc99e Initial load
duke
parents:
diff changeset
515 movl 4+4(%esp),%edx # to
a61af66fc99e Initial load
duke
parents:
diff changeset
516 cmpl %eax,%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
517 jae cla_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
518 cla_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
519 subl %eax,%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
520 jmp 2f
a61af66fc99e Initial load
duke
parents:
diff changeset
521 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
522 1: fildll (%eax)
a61af66fc99e Initial load
duke
parents:
diff changeset
523 fistpll (%edx,%eax,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
524 addl $8,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
525 2: subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
526 jge 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
527 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
528 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
529 3: fildll (%eax,%ecx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
530 fistpll (%edx,%ecx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
531 cla_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
532 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
533 jge 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
534 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
535
a61af66fc99e Initial load
duke
parents:
diff changeset
536 # Support for void Copy::arrayof_conjoint_jshorts(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
537 # void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
538 # size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
539 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
540 .type _mmx_Copy_arrayof_conjoint_jshorts,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
541 _mmx_Copy_arrayof_conjoint_jshorts:
a61af66fc99e Initial load
duke
parents:
diff changeset
542 pushl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
543 movl 4+12(%esp),%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
544 pushl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
545 movl 8+ 4(%esp),%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
546 movl 8+ 8(%esp),%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
547 cmpl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
548 leal -2(%esi,%ecx,2),%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
549 jbe mmx_acs_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
550 cmpl %eax,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
551 jbe mmx_acs_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
552 mmx_acs_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
553 movl %ecx,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
554 sarl %ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
555 je 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
556 cmpl $33,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
557 jae 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
558 1: subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
559 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
560 2: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
561 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
562 addl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
563 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
564 jnz 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
565 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
566 jmp 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
567 3: smovl # align to 8 bytes, we know we are 4 byte aligned to start
a61af66fc99e Initial load
duke
parents:
diff changeset
568 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
569 4: .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
570 movq 0(%esi),%mm0
a61af66fc99e Initial load
duke
parents:
diff changeset
571 addl $64,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
572 movq 8(%esi),%mm1
a61af66fc99e Initial load
duke
parents:
diff changeset
573 subl $16,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
574 movq 16(%esi),%mm2
a61af66fc99e Initial load
duke
parents:
diff changeset
575 movq %mm0,-64(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
576 movq 24(%esi),%mm0
a61af66fc99e Initial load
duke
parents:
diff changeset
577 movq %mm1,-56(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
578 movq 32(%esi),%mm1
a61af66fc99e Initial load
duke
parents:
diff changeset
579 movq %mm2,-48(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
580 movq 40(%esi),%mm2
a61af66fc99e Initial load
duke
parents:
diff changeset
581 movq %mm0,-40(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
582 movq 48(%esi),%mm0
a61af66fc99e Initial load
duke
parents:
diff changeset
583 movq %mm1,-32(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
584 movq 56(%esi),%mm1
a61af66fc99e Initial load
duke
parents:
diff changeset
585 movq %mm2,-24(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
586 movq %mm0,-16(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
587 addl $64,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
588 movq %mm1,-8(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
589 cmpl $16,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
590 jge 4b
a61af66fc99e Initial load
duke
parents:
diff changeset
591 emms
a61af66fc99e Initial load
duke
parents:
diff changeset
592 testl %ecx,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
593 ja 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
594 5: andl $1,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
595 je 7f
a61af66fc99e Initial load
duke
parents:
diff changeset
596 6: movw (%esi),%dx
a61af66fc99e Initial load
duke
parents:
diff changeset
597 movw %dx,(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
598 7: popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
599 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
600 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
601 mmx_acs_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
602 std
a61af66fc99e Initial load
duke
parents:
diff changeset
603 leal -4(%edi,%ecx,2),%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
604 movl %eax,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
605 movl %ecx,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
606 subl $2,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
607 sarl %ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
608 je 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
609 cmpl $32,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
610 ja 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
611 subl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
612 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
613 2: movl (%esi),%edx
a61af66fc99e Initial load
duke
parents:
diff changeset
614 movl %edx,(%edi,%esi,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
615 subl $4,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
616 subl $1,%ecx
a61af66fc99e Initial load
duke
parents:
diff changeset
617 jnz 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
618 addl %esi,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
619 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
620 3: rep; smovl
a61af66fc99e Initial load
duke
parents:
diff changeset
621 4: andl $1,%eax
a61af66fc99e Initial load
duke
parents:
diff changeset
622 je 6f
a61af66fc99e Initial load
duke
parents:
diff changeset
623 addl $2,%esi
a61af66fc99e Initial load
duke
parents:
diff changeset
624 addl $2,%edi
a61af66fc99e Initial load
duke
parents:
diff changeset
625 5: movw (%esi),%dx
a61af66fc99e Initial load
duke
parents:
diff changeset
626 movw %dx,(%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
627 6: cld
a61af66fc99e Initial load
duke
parents:
diff changeset
628 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
629 popl %esi
a61af66fc99e Initial load
duke
parents:
diff changeset
630 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
631
a61af66fc99e Initial load
duke
parents:
diff changeset
632
a61af66fc99e Initial load
duke
parents:
diff changeset
633 # Support for jlong Atomic::cmpxchg(jlong exchange_value,
a61af66fc99e Initial load
duke
parents:
diff changeset
634 # volatile jlong* dest,
a61af66fc99e Initial load
duke
parents:
diff changeset
635 # jlong compare_value,
a61af66fc99e Initial load
duke
parents:
diff changeset
636 # bool is_MP)
a61af66fc99e Initial load
duke
parents:
diff changeset
637 #
a61af66fc99e Initial load
duke
parents:
diff changeset
638 .p2align 4,,15
a61af66fc99e Initial load
duke
parents:
diff changeset
639 .type _Atomic_cmpxchg_long,@function
a61af66fc99e Initial load
duke
parents:
diff changeset
640 _Atomic_cmpxchg_long:
a61af66fc99e Initial load
duke
parents:
diff changeset
641 # 8(%esp) : return PC
a61af66fc99e Initial load
duke
parents:
diff changeset
642 pushl %ebx # 4(%esp) : old %ebx
a61af66fc99e Initial load
duke
parents:
diff changeset
643 pushl %edi # 0(%esp) : old %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
644 movl 12(%esp), %ebx # 12(%esp) : exchange_value (low)
a61af66fc99e Initial load
duke
parents:
diff changeset
645 movl 16(%esp), %ecx # 16(%esp) : exchange_value (high)
a61af66fc99e Initial load
duke
parents:
diff changeset
646 movl 24(%esp), %eax # 24(%esp) : compare_value (low)
a61af66fc99e Initial load
duke
parents:
diff changeset
647 movl 28(%esp), %edx # 28(%esp) : compare_value (high)
a61af66fc99e Initial load
duke
parents:
diff changeset
648 movl 20(%esp), %edi # 20(%esp) : dest
a61af66fc99e Initial load
duke
parents:
diff changeset
649 cmpl $0, 32(%esp) # 32(%esp) : is_MP
a61af66fc99e Initial load
duke
parents:
diff changeset
650 je 1f
a61af66fc99e Initial load
duke
parents:
diff changeset
651 lock
a61af66fc99e Initial load
duke
parents:
diff changeset
652 1: cmpxchg8b (%edi)
a61af66fc99e Initial load
duke
parents:
diff changeset
653 popl %edi
a61af66fc99e Initial load
duke
parents:
diff changeset
654 popl %ebx
a61af66fc99e Initial load
duke
parents:
diff changeset
655 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
656
2114
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
657
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
658 # Support for jlong Atomic::load and Atomic::store.
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
659 # void _Atomic_move_long(volatile jlong* src, volatile jlong* dst)
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
660 .p2align 4,,15
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
661 .type _Atomic_move_long,@function
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
662 _Atomic_move_long:
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
663 movl 4(%esp), %eax # src
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
664 fildll (%eax)
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
665 movl 8(%esp), %eax # dest
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
666 fistpll (%eax)
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
667 ret
4fc084dac61e 7009756: volatile variables could be broken throw reflection API
kvn
parents: 1603
diff changeset
668