annotate src/os_cpu/solaris_x86/vm/solaris_x86_32.s @ 17524:89152779163c

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