comparison src/os_cpu/solaris_x86/vm/solaris_x86_32.s @ 1603:d93949c5bdcc

6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86 Summary: Modify assembler code to check for 0 count for all copy routines. Reviewed-by: never, ysr, jcoomes
author kvn
date Thu, 10 Jun 2010 13:04:20 -0700
parents c18cbe5936b8
children 0a8e0d4345b3
comparison
equal deleted inserted replaced
1602:136b78722a08 1603:d93949c5bdcc
152 addl $4,%esi 152 addl $4,%esi
153 subl $1,%ecx 153 subl $1,%ecx
154 jnz 3b 154 jnz 3b
155 addl %esi,%edi 155 addl %esi,%edi
156 4: movl %eax,%ecx / byte count less prefix 156 4: movl %eax,%ecx / byte count less prefix
157 andl $3,%ecx / suffix byte count 157 5: andl $3,%ecx / suffix byte count
158 jz 7f / no suffix 158 jz 7f / no suffix
159 / copy suffix 159 / copy suffix
160 5: xorl %eax,%eax 160 xorl %eax,%eax
161 6: movb (%esi,%eax,1),%dl 161 6: movb (%esi,%eax,1),%dl
162 movb %dl,(%edi,%eax,1) 162 movb %dl,(%edi,%eax,1)
163 addl $1,%eax 163 addl $1,%eax
164 subl $1,%ecx 164 subl $1,%ecx
165 jnz 6b 165 jnz 6b
190 addl %esi,%edi 190 addl %esi,%edi
191 jmp 4f 191 jmp 4f
192 / copy dwords, aligned or not 192 / copy dwords, aligned or not
193 3: rep; smovl 193 3: rep; smovl
194 4: movl %eax,%ecx / byte count 194 4: movl %eax,%ecx / byte count
195 andl $3,%ecx / suffix byte count 195 5: andl $3,%ecx / suffix byte count
196 jz 7f / no suffix 196 jz 7f / no suffix
197 / copy suffix 197 / copy suffix
198 5: subl %esi,%edi 198 subl %esi,%edi
199 addl $3,%esi 199 addl $3,%esi
200 6: movb (%esi),%dl 200 6: movb (%esi),%dl
201 movb %dl,(%edi,%esi,1) 201 movb %dl,(%edi,%esi,1)
202 subl $1,%esi 202 subl $1,%esi
203 subl $1,%ecx 203 subl $1,%ecx
244 addl %esi,%edi 244 addl %esi,%edi
245 jmp 4f 245 jmp 4f
246 / copy aligned dwords 246 / copy aligned dwords
247 3: rep; smovl 247 3: rep; smovl
248 4: movl %eax,%ecx 248 4: movl %eax,%ecx
249 andl $3,%ecx 249 5: andl $3,%ecx
250 jz 7f 250 jz 7f
251 / copy suffix 251 / copy suffix
252 5: xorl %eax,%eax 252 xorl %eax,%eax
253 6: movb (%esi,%eax,1),%dl 253 6: movb (%esi,%eax,1),%dl
254 movb %dl,(%edi,%eax,1) 254 movb %dl,(%edi,%eax,1)
255 addl $1,%eax 255 addl $1,%eax
256 subl $1,%ecx 256 subl $1,%ecx
257 jnz 6b 257 jnz 6b
280 subl $4,%esi 280 subl $4,%esi
281 subl $1,%ecx 281 subl $1,%ecx
282 jnz 3b 282 jnz 3b
283 addl %esi,%edi 283 addl %esi,%edi
284 4: movl %eax,%ecx 284 4: movl %eax,%ecx
285 andl $3,%ecx 285 5: andl $3,%ecx
286 jz 7f 286 jz 7f
287 5: subl %esi,%edi 287 subl %esi,%edi
288 addl $3,%esi 288 addl $3,%esi
289 6: movb (%esi),%dl 289 6: movb (%esi),%dl
290 movb %dl,(%edi,%esi,1) 290 movb %dl,(%edi,%esi,1)
291 subl $1,%esi 291 subl $1,%esi
292 subl $1,%ecx 292 subl $1,%ecx
316 / align source address at dword address boundary 316 / align source address at dword address boundary
317 movl %esi,%eax / original from 317 movl %esi,%eax / original from
318 andl $3,%eax / either 0 or 2 318 andl $3,%eax / either 0 or 2
319 jz 1f / no prefix 319 jz 1f / no prefix
320 / copy prefix 320 / copy prefix
321 subl $1,%ecx
322 jl 5f / zero count
321 movw (%esi),%dx 323 movw (%esi),%dx
322 movw %dx,(%edi) 324 movw %dx,(%edi)
323 addl %eax,%esi / %eax == 2 325 addl %eax,%esi / %eax == 2
324 addl %eax,%edi 326 addl %eax,%edi
325 subl $1,%ecx
326 1: movl %ecx,%eax / word count less prefix 327 1: movl %ecx,%eax / word count less prefix
327 sarl %ecx / dword count 328 sarl %ecx / dword count
328 jz 4f / no dwords to move 329 jz 4f / no dwords to move
329 cmpl $32,%ecx 330 cmpl $32,%ecx
330 jbe 2f / <= 32 dwords 331 jbe 2f / <= 32 dwords
480 popl %edi 481 popl %edi
481 popl %esi 482 popl %esi
482 ret 483 ret
483 .=.+10 484 .=.+10
484 2: subl %esi,%edi 485 2: subl %esi,%edi
486 jmp 4f
485 .align 16 487 .align 16
486 3: movl (%esi),%edx 488 3: movl (%esi),%edx
487 movl %edx,(%edi,%esi,1) 489 movl %edx,(%edi,%esi,1)
488 addl $4,%esi 490 addl $4,%esi
489 subl $1,%ecx 491 4: subl $1,%ecx
490 jnz 3b 492 jge 3b
491 popl %edi 493 popl %edi
492 popl %esi 494 popl %esi
493 ret 495 ret
494 ci_CopyLeft: 496 ci_CopyLeft:
495 std 497 std
496 leal -4(%edi,%ecx,4),%edi / to + count*4 - 4 498 leal -4(%edi,%ecx,4),%edi / to + count*4 - 4
497 cmpl $32,%ecx 499 cmpl $32,%ecx
498 ja 3f / > 32 dwords 500 ja 4f / > 32 dwords
499 subl %eax,%edi / eax == from + count*4 - 4 501 subl %eax,%edi / eax == from + count*4 - 4
502 jmp 3f
500 .align 16 503 .align 16
501 2: movl (%eax),%edx 504 2: movl (%eax),%edx
502 movl %edx,(%edi,%eax,1) 505 movl %edx,(%edi,%eax,1)
503 subl $4,%eax 506 subl $4,%eax
504 subl $1,%ecx 507 3: subl $1,%ecx
505 jnz 2b 508 jge 2b
506 cld 509 cld
507 popl %edi 510 popl %edi
508 popl %esi 511 popl %esi
509 ret 512 ret
510 3: movl %eax,%esi / from + count*4 - 4 513 4: movl %eax,%esi / from + count*4 - 4
511 rep; smovl 514 rep; smovl
512 cld 515 cld
513 popl %edi 516 popl %edi
514 popl %esi 517 popl %esi
515 ret 518 ret