annotate src/os_cpu/solaris_x86/vm/solaris_x86_64.s @ 0:a61af66fc99e jdk7-b24

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /
a61af66fc99e Initial load
duke
parents:
diff changeset
2 / Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
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 /
a61af66fc99e Initial load
duke
parents:
diff changeset
19 / Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 / CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 / have any questions.
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 fs_load
a61af66fc99e Initial load
duke
parents:
diff changeset
25 .globl fs_thread
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 // NOTE WELL! The _Copy functions are called directly
a61af66fc99e Initial load
duke
parents:
diff changeset
28 // from server-compiler-generated code via CallLeafNoFP,
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // which means that they *must* either not use floating
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // point or use it in the same manner as does the server
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // compiler.
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 .globl _Copy_arrayof_conjoint_bytes
a61af66fc99e Initial load
duke
parents:
diff changeset
34 .globl _Copy_conjoint_jshorts_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
35 .globl _Copy_arrayof_conjoint_jshorts
a61af66fc99e Initial load
duke
parents:
diff changeset
36 .globl _Copy_conjoint_jints_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
37 .globl _Copy_arrayof_conjoint_jints
a61af66fc99e Initial load
duke
parents:
diff changeset
38 .globl _Copy_conjoint_jlongs_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
39 .globl _Copy_arrayof_conjoint_jlongs
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 .section .text,"ax"
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 / Fast thread accessors, used by threadLS_solaris_amd64.cpp
a61af66fc99e Initial load
duke
parents:
diff changeset
44 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
45 fs_load:
a61af66fc99e Initial load
duke
parents:
diff changeset
46 movq %fs:(%rdi),%rax
a61af66fc99e Initial load
duke
parents:
diff changeset
47 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
50 fs_thread:
a61af66fc99e Initial load
duke
parents:
diff changeset
51 movq %fs:0x0,%rax
a61af66fc99e Initial load
duke
parents:
diff changeset
52 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 .globl SafeFetch32, Fetch32PFI, Fetch32Resume
a61af66fc99e Initial load
duke
parents:
diff changeset
55 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Prototype: int SafeFetch32 (int * Adr, int ErrValue)
a61af66fc99e Initial load
duke
parents:
diff changeset
57 SafeFetch32:
a61af66fc99e Initial load
duke
parents:
diff changeset
58 movl %esi, %eax
a61af66fc99e Initial load
duke
parents:
diff changeset
59 Fetch32PFI:
a61af66fc99e Initial load
duke
parents:
diff changeset
60 movl (%rdi), %eax
a61af66fc99e Initial load
duke
parents:
diff changeset
61 Fetch32Resume:
a61af66fc99e Initial load
duke
parents:
diff changeset
62 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 .globl SafeFetchN, FetchNPFI, FetchNResume
a61af66fc99e Initial load
duke
parents:
diff changeset
65 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // Prototype: intptr_t SafeFetchN (intptr_t * Adr, intptr_t ErrValue)
a61af66fc99e Initial load
duke
parents:
diff changeset
67 SafeFetchN:
a61af66fc99e Initial load
duke
parents:
diff changeset
68 movq %rsi, %rax
a61af66fc99e Initial load
duke
parents:
diff changeset
69 FetchNPFI:
a61af66fc99e Initial load
duke
parents:
diff changeset
70 movq (%rdi), %rax
a61af66fc99e Initial load
duke
parents:
diff changeset
71 FetchNResume:
a61af66fc99e Initial load
duke
parents:
diff changeset
72 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 .globl SpinPause
a61af66fc99e Initial load
duke
parents:
diff changeset
75 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
76 SpinPause:
a61af66fc99e Initial load
duke
parents:
diff changeset
77 rep
a61af66fc99e Initial load
duke
parents:
diff changeset
78 nop
a61af66fc99e Initial load
duke
parents:
diff changeset
79 movq $1, %rax
a61af66fc99e Initial load
duke
parents:
diff changeset
80 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 / Support for void Copy::arrayof_conjoint_bytes(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
84 / void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
85 / size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
86 / rdi - from
a61af66fc99e Initial load
duke
parents:
diff changeset
87 / rsi - to
a61af66fc99e Initial load
duke
parents:
diff changeset
88 / rdx - count, treated as ssize_t
a61af66fc99e Initial load
duke
parents:
diff changeset
89 /
a61af66fc99e Initial load
duke
parents:
diff changeset
90 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
91 _Copy_arrayof_conjoint_bytes:
a61af66fc99e Initial load
duke
parents:
diff changeset
92 movq %rdx,%r8 / byte count
a61af66fc99e Initial load
duke
parents:
diff changeset
93 shrq $3,%rdx / qword count
a61af66fc99e Initial load
duke
parents:
diff changeset
94 cmpq %rdi,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
95 leaq -1(%rdi,%r8,1),%rax / from + bcount*1 - 1
a61af66fc99e Initial load
duke
parents:
diff changeset
96 jbe acb_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
97 cmpq %rax,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
98 jbe acb_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
99 acb_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
100 leaq -8(%rdi,%rdx,8),%rax / from + qcount*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
101 leaq -8(%rsi,%rdx,8),%rcx / to + qcount*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
102 negq %rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
103 jmp 7f
a61af66fc99e Initial load
duke
parents:
diff changeset
104 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
105 1: movq 8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
106 movq %rsi,8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
107 addq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
108 jnz 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
109 2: testq $4,%r8 / check for trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
110 jz 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
111 movl 8(%rax),%esi / copy trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
112 movl %esi,8(%rcx)
a61af66fc99e Initial load
duke
parents:
diff changeset
113 addq $4,%rax
a61af66fc99e Initial load
duke
parents:
diff changeset
114 addq $4,%rcx / original %rsi is trashed, so we
a61af66fc99e Initial load
duke
parents:
diff changeset
115 / can't use it as a base register
a61af66fc99e Initial load
duke
parents:
diff changeset
116 3: testq $2,%r8 / check for trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
117 jz 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
118 movw 8(%rax),%si / copy trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
119 movw %si,8(%rcx)
a61af66fc99e Initial load
duke
parents:
diff changeset
120 addq $2,%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
121 4: testq $1,%r8 / check for trailing byte
a61af66fc99e Initial load
duke
parents:
diff changeset
122 jz 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
123 movb -1(%rdi,%r8,1),%al / copy trailing byte
a61af66fc99e Initial load
duke
parents:
diff changeset
124 movb %al,8(%rcx)
a61af66fc99e Initial load
duke
parents:
diff changeset
125 5: ret
a61af66fc99e Initial load
duke
parents:
diff changeset
126 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
127 6: movq -24(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
128 movq %rsi,-24(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
129 movq -16(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
130 movq %rsi,-16(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
131 movq -8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
132 movq %rsi,-8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
133 movq (%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
134 movq %rsi,(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
135 7: addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
136 jle 6b
a61af66fc99e Initial load
duke
parents:
diff changeset
137 subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
138 jl 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
139 jmp 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
140 acb_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
141 testq $1,%r8 / check for trailing byte
a61af66fc99e Initial load
duke
parents:
diff changeset
142 jz 1f
a61af66fc99e Initial load
duke
parents:
diff changeset
143 movb -1(%rdi,%r8,1),%cl / copy trailing byte
a61af66fc99e Initial load
duke
parents:
diff changeset
144 movb %cl,-1(%rsi,%r8,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
145 subq $1,%r8 / adjust for possible trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
146 1: testq $2,%r8 / check for trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
147 jz 2f
a61af66fc99e Initial load
duke
parents:
diff changeset
148 movw -2(%rdi,%r8,1),%cx / copy trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
149 movw %cx,-2(%rsi,%r8,1)
a61af66fc99e Initial load
duke
parents:
diff changeset
150 2: testq $4,%r8 / check for trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
151 jz 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
152 movl (%rdi,%rdx,8),%ecx / copy trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
153 movl %ecx,(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
154 jmp 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
155 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
156 3: movq -8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
157 movq %rcx,-8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
158 subq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
159 jnz 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
160 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
161 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
162 4: movq 24(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
163 movq %rcx,24(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
164 movq 16(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
165 movq %rcx,16(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
166 movq 8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
167 movq %rcx,8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
168 movq (%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
169 movq %rcx,(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
170 5: subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
171 jge 4b
a61af66fc99e Initial load
duke
parents:
diff changeset
172 addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
173 jg 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
174 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 / Support for void Copy::arrayof_conjoint_jshorts(void* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
177 / void* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
178 / size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
179 / Equivalent to
a61af66fc99e Initial load
duke
parents:
diff changeset
180 / conjoint_jshorts_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
181 /
a61af66fc99e Initial load
duke
parents:
diff changeset
182 / If 'from' and/or 'to' are aligned on 4- or 2-byte boundaries, we
a61af66fc99e Initial load
duke
parents:
diff changeset
183 / let the hardware handle it. The tow or four words within dwords
a61af66fc99e Initial load
duke
parents:
diff changeset
184 / or qwords that span cache line boundaries will still be loaded
a61af66fc99e Initial load
duke
parents:
diff changeset
185 / and stored atomically.
a61af66fc99e Initial load
duke
parents:
diff changeset
186 /
a61af66fc99e Initial load
duke
parents:
diff changeset
187 / rdi - from
a61af66fc99e Initial load
duke
parents:
diff changeset
188 / rsi - to
a61af66fc99e Initial load
duke
parents:
diff changeset
189 / rdx - count, treated as ssize_t
a61af66fc99e Initial load
duke
parents:
diff changeset
190 /
a61af66fc99e Initial load
duke
parents:
diff changeset
191 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
192 _Copy_arrayof_conjoint_jshorts:
a61af66fc99e Initial load
duke
parents:
diff changeset
193 _Copy_conjoint_jshorts_atomic:
a61af66fc99e Initial load
duke
parents:
diff changeset
194 movq %rdx,%r8 / word count
a61af66fc99e Initial load
duke
parents:
diff changeset
195 shrq $2,%rdx / qword count
a61af66fc99e Initial load
duke
parents:
diff changeset
196 cmpq %rdi,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
197 leaq -2(%rdi,%r8,2),%rax / from + wcount*2 - 2
a61af66fc99e Initial load
duke
parents:
diff changeset
198 jbe acs_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
199 cmpq %rax,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
200 jbe acs_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
201 acs_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
202 leaq -8(%rdi,%rdx,8),%rax / from + qcount*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
203 leaq -8(%rsi,%rdx,8),%rcx / to + qcount*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
204 negq %rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
205 jmp 6f
a61af66fc99e Initial load
duke
parents:
diff changeset
206 1: movq 8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
207 movq %rsi,8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
208 addq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
209 jnz 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
210 2: testq $2,%r8 / check for trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
211 jz 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
212 movl 8(%rax),%esi / copy trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
213 movl %esi,8(%rcx)
a61af66fc99e Initial load
duke
parents:
diff changeset
214 addq $4,%rcx / original %rsi is trashed, so we
a61af66fc99e Initial load
duke
parents:
diff changeset
215 / can't use it as a base register
a61af66fc99e Initial load
duke
parents:
diff changeset
216 3: testq $1,%r8 / check for trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
217 jz 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
218 movw -2(%rdi,%r8,2),%si / copy trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
219 movw %si,8(%rcx)
a61af66fc99e Initial load
duke
parents:
diff changeset
220 4: ret
a61af66fc99e Initial load
duke
parents:
diff changeset
221 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
222 5: movq -24(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
223 movq %rsi,-24(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
224 movq -16(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
225 movq %rsi,-16(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
226 movq -8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
227 movq %rsi,-8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
228 movq (%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
229 movq %rsi,(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
230 6: addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
231 jle 5b
a61af66fc99e Initial load
duke
parents:
diff changeset
232 subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
233 jl 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
234 jmp 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
235 acs_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
236 testq $1,%r8 / check for trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
237 jz 1f
a61af66fc99e Initial load
duke
parents:
diff changeset
238 movw -2(%rdi,%r8,2),%cx / copy trailing word
a61af66fc99e Initial load
duke
parents:
diff changeset
239 movw %cx,-2(%rsi,%r8,2)
a61af66fc99e Initial load
duke
parents:
diff changeset
240 1: testq $2,%r8 / check for trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
241 jz 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
242 movl (%rdi,%rdx,8),%ecx / copy trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
243 movl %ecx,(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
244 jmp 4f
a61af66fc99e Initial load
duke
parents:
diff changeset
245 2: movq -8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
246 movq %rcx,-8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
247 subq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
248 jnz 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
249 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
250 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
251 3: movq 24(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
252 movq %rcx,24(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
253 movq 16(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
254 movq %rcx,16(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
255 movq 8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
256 movq %rcx,8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
257 movq (%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
258 movq %rcx,(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
259 4: subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
260 jge 3b
a61af66fc99e Initial load
duke
parents:
diff changeset
261 addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
262 jg 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
263 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
264
a61af66fc99e Initial load
duke
parents:
diff changeset
265 / Support for void Copy::arrayof_conjoint_jints(jint* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
266 / jint* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
267 / size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
268 / Equivalent to
a61af66fc99e Initial load
duke
parents:
diff changeset
269 / conjoint_jints_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
270 /
a61af66fc99e Initial load
duke
parents:
diff changeset
271 / If 'from' and/or 'to' are aligned on 4-byte boundaries, we let
a61af66fc99e Initial load
duke
parents:
diff changeset
272 / the hardware handle it. The two dwords within qwords that span
a61af66fc99e Initial load
duke
parents:
diff changeset
273 / cache line boundaries will still be loaded and stored atomically.
a61af66fc99e Initial load
duke
parents:
diff changeset
274 /
a61af66fc99e Initial load
duke
parents:
diff changeset
275 / rdi - from
a61af66fc99e Initial load
duke
parents:
diff changeset
276 / rsi - to
a61af66fc99e Initial load
duke
parents:
diff changeset
277 / rdx - count, treated as ssize_t
a61af66fc99e Initial load
duke
parents:
diff changeset
278 /
a61af66fc99e Initial load
duke
parents:
diff changeset
279 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
280 _Copy_arrayof_conjoint_jints:
a61af66fc99e Initial load
duke
parents:
diff changeset
281 _Copy_conjoint_jints_atomic:
a61af66fc99e Initial load
duke
parents:
diff changeset
282 movq %rdx,%r8 / dword count
a61af66fc99e Initial load
duke
parents:
diff changeset
283 shrq %rdx / qword count
a61af66fc99e Initial load
duke
parents:
diff changeset
284 cmpq %rdi,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
285 leaq -4(%rdi,%r8,4),%rax / from + dcount*4 - 4
a61af66fc99e Initial load
duke
parents:
diff changeset
286 jbe aci_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
287 cmpq %rax,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
288 jbe aci_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
289 aci_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
290 leaq -8(%rdi,%rdx,8),%rax / from + qcount*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
291 leaq -8(%rsi,%rdx,8),%rcx / to + qcount*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
292 negq %rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
293 jmp 5f
a61af66fc99e Initial load
duke
parents:
diff changeset
294 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
295 1: movq 8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
296 movq %rsi,8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
297 addq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
298 jnz 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
299 2: testq $1,%r8 / check for trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
300 jz 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
301 movl 8(%rax),%esi / copy trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
302 movl %esi,8(%rcx)
a61af66fc99e Initial load
duke
parents:
diff changeset
303 3: ret
a61af66fc99e Initial load
duke
parents:
diff changeset
304 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
305 4: movq -24(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
306 movq %rsi,-24(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
307 movq -16(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
308 movq %rsi,-16(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
309 movq -8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
310 movq %rsi,-8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
311 movq (%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
312 movq %rsi,(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
313 5: addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
314 jle 4b
a61af66fc99e Initial load
duke
parents:
diff changeset
315 subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
316 jl 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
317 jmp 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
318 aci_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
319 testq $1,%r8 / check for trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
320 jz 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
321 movl -4(%rdi,%r8,4),%ecx / copy trailing dword
a61af66fc99e Initial load
duke
parents:
diff changeset
322 movl %ecx,-4(%rsi,%r8,4)
a61af66fc99e Initial load
duke
parents:
diff changeset
323 jmp 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
324 1: movq -8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
325 movq %rcx,-8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
326 subq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
327 jnz 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
328 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
329 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
330 2: movq 24(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
331 movq %rcx,24(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
332 movq 16(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
333 movq %rcx,16(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
334 movq 8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
335 movq %rcx,8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
336 movq (%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
337 movq %rcx,(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
338 3: subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
339 jge 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
340 addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
341 jg 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
342 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
343
a61af66fc99e Initial load
duke
parents:
diff changeset
344 / Support for void Copy::arrayof_conjoint_jlongs(jlong* from,
a61af66fc99e Initial load
duke
parents:
diff changeset
345 / jlong* to,
a61af66fc99e Initial load
duke
parents:
diff changeset
346 / size_t count)
a61af66fc99e Initial load
duke
parents:
diff changeset
347 / Equivalent to
a61af66fc99e Initial load
duke
parents:
diff changeset
348 / conjoint_jlongs_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
349 / arrayof_conjoint_oops
a61af66fc99e Initial load
duke
parents:
diff changeset
350 / conjoint_oops_atomic
a61af66fc99e Initial load
duke
parents:
diff changeset
351 /
a61af66fc99e Initial load
duke
parents:
diff changeset
352 / rdi - from
a61af66fc99e Initial load
duke
parents:
diff changeset
353 / rsi - to
a61af66fc99e Initial load
duke
parents:
diff changeset
354 / rdx - count, treated as ssize_t
a61af66fc99e Initial load
duke
parents:
diff changeset
355 /
a61af66fc99e Initial load
duke
parents:
diff changeset
356 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
357 _Copy_arrayof_conjoint_jlongs:
a61af66fc99e Initial load
duke
parents:
diff changeset
358 _Copy_conjoint_jlongs_atomic:
a61af66fc99e Initial load
duke
parents:
diff changeset
359 cmpq %rdi,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
360 leaq -8(%rdi,%rdx,8),%rax / from + count*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
361 jbe acl_CopyRight
a61af66fc99e Initial load
duke
parents:
diff changeset
362 cmpq %rax,%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
363 jbe acl_CopyLeft
a61af66fc99e Initial load
duke
parents:
diff changeset
364 acl_CopyRight:
a61af66fc99e Initial load
duke
parents:
diff changeset
365 leaq -8(%rsi,%rdx,8),%rcx / to + count*8 - 8
a61af66fc99e Initial load
duke
parents:
diff changeset
366 negq %rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
367 jmp 3f
a61af66fc99e Initial load
duke
parents:
diff changeset
368 1: movq 8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
369 movq %rsi,8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
370 addq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
371 jnz 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
372 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
373 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
374 2: movq -24(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
375 movq %rsi,-24(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
376 movq -16(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
377 movq %rsi,-16(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
378 movq -8(%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
379 movq %rsi,-8(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
380 movq (%rax,%rdx,8),%rsi
a61af66fc99e Initial load
duke
parents:
diff changeset
381 movq %rsi,(%rcx,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
382 3: addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
383 jle 2b
a61af66fc99e Initial load
duke
parents:
diff changeset
384 subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
385 jl 1b
a61af66fc99e Initial load
duke
parents:
diff changeset
386 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
387 4: movq -8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
388 movq %rcx,-8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
389 subq $1,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
390 jnz 4b
a61af66fc99e Initial load
duke
parents:
diff changeset
391 ret
a61af66fc99e Initial load
duke
parents:
diff changeset
392 .align 16
a61af66fc99e Initial load
duke
parents:
diff changeset
393 5: movq 24(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
394 movq %rcx,24(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
395 movq 16(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
396 movq %rcx,16(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
397 movq 8(%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
398 movq %rcx,8(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
399 movq (%rdi,%rdx,8),%rcx
a61af66fc99e Initial load
duke
parents:
diff changeset
400 movq %rcx,(%rsi,%rdx,8)
a61af66fc99e Initial load
duke
parents:
diff changeset
401 acl_CopyLeft:
a61af66fc99e Initial load
duke
parents:
diff changeset
402 subq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
403 jge 5b
a61af66fc99e Initial load
duke
parents:
diff changeset
404 addq $4,%rdx
a61af66fc99e Initial load
duke
parents:
diff changeset
405 jg 4b
a61af66fc99e Initial load
duke
parents:
diff changeset
406 ret