Mercurial > hg > truffle
comparison src/os_cpu/linux_x86/vm/linux_x86_32.s @ 1930:2d26b0046e0d
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 30 Nov 2010 14:53:30 +0100 |
parents | d93949c5bdcc |
children | 0a8e0d4345b3 4fc084dac61e |
comparison
equal
deleted
inserted
replaced
1484:6b7001391c97 | 1930:2d26b0046e0d |
---|---|
1 # | 1 # |
2 # Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. | 2 # Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # | 4 # |
5 # This code is free software; you can redistribute it and/or modify it | 5 # This code is free software; you can redistribute it and/or modify it |
6 # under the terms of the GNU General Public License version 2 only, as | 6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. | 7 # published by the Free Software Foundation. |
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License version | 15 # You should have received a copy of the GNU General Public License version |
16 # 2 along with this work; if not, write to the Free Software Foundation, | 16 # 2 along with this work; if not, write to the Free Software Foundation, |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 # | 18 # |
19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 # CA 95054 USA or visit www.sun.com if you need additional information or | 20 # or visit www.oracle.com if you need additional information or have any |
21 # have any questions. | 21 # questions. |
22 # | 22 # |
23 | 23 |
24 | 24 |
25 # NOTE WELL! The _Copy functions are called directly | 25 # NOTE WELL! The _Copy functions are called directly |
26 # from server-compiler-generated code via CallLeafNoFP, | 26 # from server-compiler-generated code via CallLeafNoFP, |
119 addl $4,%esi | 119 addl $4,%esi |
120 subl $1,%ecx | 120 subl $1,%ecx |
121 jnz 3b | 121 jnz 3b |
122 addl %esi,%edi | 122 addl %esi,%edi |
123 4: movl %eax,%ecx # byte count less prefix | 123 4: movl %eax,%ecx # byte count less prefix |
124 andl $3,%ecx # suffix byte count | 124 5: andl $3,%ecx # suffix byte count |
125 jz 7f # no suffix | 125 jz 7f # no suffix |
126 # copy suffix | 126 # copy suffix |
127 5: xorl %eax,%eax | 127 xorl %eax,%eax |
128 6: movb (%esi,%eax,1),%dl | 128 6: movb (%esi,%eax,1),%dl |
129 movb %dl,(%edi,%eax,1) | 129 movb %dl,(%edi,%eax,1) |
130 addl $1,%eax | 130 addl $1,%eax |
131 subl $1,%ecx | 131 subl $1,%ecx |
132 jnz 6b | 132 jnz 6b |
157 addl %esi,%edi | 157 addl %esi,%edi |
158 jmp 4f | 158 jmp 4f |
159 # copy dwords, aligned or not | 159 # copy dwords, aligned or not |
160 3: rep; smovl | 160 3: rep; smovl |
161 4: movl %eax,%ecx # byte count | 161 4: movl %eax,%ecx # byte count |
162 andl $3,%ecx # suffix byte count | 162 5: andl $3,%ecx # suffix byte count |
163 jz 7f # no suffix | 163 jz 7f # no suffix |
164 # copy suffix | 164 # copy suffix |
165 5: subl %esi,%edi | 165 subl %esi,%edi |
166 addl $3,%esi | 166 addl $3,%esi |
167 6: movb (%esi),%dl | 167 6: movb (%esi),%dl |
168 movb %dl,(%edi,%esi,1) | 168 movb %dl,(%edi,%esi,1) |
169 subl $1,%esi | 169 subl $1,%esi |
170 subl $1,%ecx | 170 subl $1,%ecx |
212 addl %esi,%edi | 212 addl %esi,%edi |
213 jmp 4f | 213 jmp 4f |
214 # copy aligned dwords | 214 # copy aligned dwords |
215 3: rep; smovl | 215 3: rep; smovl |
216 4: movl %eax,%ecx | 216 4: movl %eax,%ecx |
217 andl $3,%ecx | 217 5: andl $3,%ecx |
218 jz 7f | 218 jz 7f |
219 # copy suffix | 219 # copy suffix |
220 5: xorl %eax,%eax | 220 xorl %eax,%eax |
221 6: movb (%esi,%eax,1),%dl | 221 6: movb (%esi,%eax,1),%dl |
222 movb %dl,(%edi,%eax,1) | 222 movb %dl,(%edi,%eax,1) |
223 addl $1,%eax | 223 addl $1,%eax |
224 subl $1,%ecx | 224 subl $1,%ecx |
225 jnz 6b | 225 jnz 6b |
248 subl $4,%esi | 248 subl $4,%esi |
249 subl $1,%ecx | 249 subl $1,%ecx |
250 jnz 3b | 250 jnz 3b |
251 addl %esi,%edi | 251 addl %esi,%edi |
252 4: movl %eax,%ecx | 252 4: movl %eax,%ecx |
253 andl $3,%ecx | 253 5: andl $3,%ecx |
254 jz 7f | 254 jz 7f |
255 5: subl %esi,%edi | 255 subl %esi,%edi |
256 addl $3,%esi | 256 addl $3,%esi |
257 6: movb (%esi),%dl | 257 6: movb (%esi),%dl |
258 movb %dl,(%edi,%esi,1) | 258 movb %dl,(%edi,%esi,1) |
259 subl $1,%esi | 259 subl $1,%esi |
260 subl $1,%ecx | 260 subl $1,%ecx |
285 # align source address at dword address boundary | 285 # align source address at dword address boundary |
286 movl %esi,%eax # original from | 286 movl %esi,%eax # original from |
287 andl $3,%eax # either 0 or 2 | 287 andl $3,%eax # either 0 or 2 |
288 jz 1f # no prefix | 288 jz 1f # no prefix |
289 # copy prefix | 289 # copy prefix |
290 subl $1,%ecx | |
291 jl 5f # zero count | |
290 movw (%esi),%dx | 292 movw (%esi),%dx |
291 movw %dx,(%edi) | 293 movw %dx,(%edi) |
292 addl %eax,%esi # %eax == 2 | 294 addl %eax,%esi # %eax == 2 |
293 addl %eax,%edi | 295 addl %eax,%edi |
294 subl $1,%ecx | |
295 1: movl %ecx,%eax # word count less prefix | 296 1: movl %ecx,%eax # word count less prefix |
296 sarl %ecx # dword count | 297 sarl %ecx # dword count |
297 jz 4f # no dwords to move | 298 jz 4f # no dwords to move |
298 cmpl $32,%ecx | 299 cmpl $32,%ecx |
299 jbe 2f # <= 32 dwords | 300 jbe 2f # <= 32 dwords |
452 popl %edi | 453 popl %edi |
453 popl %esi | 454 popl %esi |
454 ret | 455 ret |
455 .=.+10 | 456 .=.+10 |
456 2: subl %esi,%edi | 457 2: subl %esi,%edi |
458 jmp 4f | |
457 .p2align 4,,15 | 459 .p2align 4,,15 |
458 3: movl (%esi),%edx | 460 3: movl (%esi),%edx |
459 movl %edx,(%edi,%esi,1) | 461 movl %edx,(%edi,%esi,1) |
460 addl $4,%esi | 462 addl $4,%esi |
461 subl $1,%ecx | 463 4: subl $1,%ecx |
462 jnz 3b | 464 jge 3b |
463 popl %edi | 465 popl %edi |
464 popl %esi | 466 popl %esi |
465 ret | 467 ret |
466 ci_CopyLeft: | 468 ci_CopyLeft: |
467 std | 469 std |
468 leal -4(%edi,%ecx,4),%edi # to + count*4 - 4 | 470 leal -4(%edi,%ecx,4),%edi # to + count*4 - 4 |
469 cmpl $32,%ecx | 471 cmpl $32,%ecx |
470 ja 3f # > 32 dwords | 472 ja 4f # > 32 dwords |
471 subl %eax,%edi # eax == from + count*4 - 4 | 473 subl %eax,%edi # eax == from + count*4 - 4 |
474 jmp 3f | |
472 .p2align 4,,15 | 475 .p2align 4,,15 |
473 2: movl (%eax),%edx | 476 2: movl (%eax),%edx |
474 movl %edx,(%edi,%eax,1) | 477 movl %edx,(%edi,%eax,1) |
475 subl $4,%eax | 478 subl $4,%eax |
476 subl $1,%ecx | 479 3: subl $1,%ecx |
477 jnz 2b | 480 jge 2b |
478 cld | 481 cld |
479 popl %edi | 482 popl %edi |
480 popl %esi | 483 popl %esi |
481 ret | 484 ret |
482 3: movl %eax,%esi # from + count*4 - 4 | 485 4: movl %eax,%esi # from + count*4 - 4 |
483 rep; smovl | 486 rep; smovl |
484 cld | 487 cld |
485 popl %edi | 488 popl %edi |
486 popl %esi | 489 popl %esi |
487 ret | 490 ret |