annotate src/os_cpu/linux_x86/vm/linux_x86_64.s @ 17467:55fb97c4c58d hs25-b65

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