annotate src/os_cpu/solaris_x86/vm/solaris_x86_32.s @ 1972:f95d63e2154a

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