URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 158 |
Rev 816 |
/*
|
/*
|
* ====================================================
|
* ====================================================
|
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
|
* Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
|
*
|
*
|
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
* software is freely granted, provided that this notice
|
* software is freely granted, provided that this notice
|
* is preserved.
|
* is preserved.
|
* ====================================================
|
* ====================================================
|
*/
|
*/
|
|
|
#include "i386mach.h"
|
#include "i386mach.h"
|
|
|
.global SYM (memcpy)
|
.global SYM (memcpy)
|
SOTYPE_FUNCTION(memcpy)
|
SOTYPE_FUNCTION(memcpy)
|
|
|
SYM (memcpy):
|
SYM (memcpy):
|
|
|
pushl ebp
|
pushl ebp
|
movl esp,ebp
|
movl esp,ebp
|
pushl esi
|
pushl esi
|
pushl edi
|
pushl edi
|
pushl ebx
|
pushl ebx
|
movl 8(ebp),edi
|
movl 8(ebp),edi
|
movl 16(ebp),ecx
|
movl 16(ebp),ecx
|
movl 12(ebp),esi
|
movl 12(ebp),esi
|
cld
|
cld
|
|
|
#ifndef __OPTIMIZE_SIZE__
|
#ifndef __OPTIMIZE_SIZE__
|
|
|
cmpl $8,ecx
|
cmpl $8,ecx
|
jbe .L3
|
jbe .L3
|
|
|
/* move any preceding bytes until destination address is long word aligned */
|
/* move any preceding bytes until destination address is long word aligned */
|
|
|
movl edi,edx
|
movl edi,edx
|
movl ecx,ebx
|
movl ecx,ebx
|
andl $3,edx
|
andl $3,edx
|
jz .L11
|
jz .L11
|
movl $4,ecx
|
movl $4,ecx
|
subl edx,ecx
|
subl edx,ecx
|
andl $3,ecx
|
andl $3,ecx
|
subl ecx,ebx
|
subl ecx,ebx
|
rep
|
rep
|
movsb
|
movsb
|
|
|
mov ebx,ecx
|
mov ebx,ecx
|
|
|
/* move bytes a long word at a time */
|
/* move bytes a long word at a time */
|
|
|
.L11:
|
.L11:
|
shrl $2,ecx
|
shrl $2,ecx
|
.p2align 2
|
.p2align 2
|
rep
|
rep
|
movsl
|
movsl
|
|
|
movl ebx,ecx
|
movl ebx,ecx
|
andl $3,ecx
|
andl $3,ecx
|
|
|
#endif /* !__OPTIMIZE_SIZE__ */
|
#endif /* !__OPTIMIZE_SIZE__ */
|
|
|
/* handle any remaining bytes */
|
/* handle any remaining bytes */
|
|
|
.L3:
|
.L3:
|
rep
|
rep
|
movsb
|
movsb
|
.L5:
|
.L5:
|
movl 8(ebp),eax
|
movl 8(ebp),eax
|
|
|
leal -12(ebp),esp
|
leal -12(ebp),esp
|
popl ebx
|
popl ebx
|
popl edi
|
popl edi
|
popl esi
|
popl esi
|
leave
|
leave
|
ret
|
ret
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.