OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [machine/] [i386/] [memset.S] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/*
/*
 * ====================================================
 * ====================================================
 * Copyright (C) 1998, 2002, 2008 by Red Hat Inc. All rights reserved.
 * Copyright (C) 1998, 2002, 2008 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 (memset)
        .global SYM (memset)
       SOTYPE_FUNCTION(memset)
       SOTYPE_FUNCTION(memset)
SYM (memset):
SYM (memset):
        pushl ebp
        pushl ebp
        movl esp,ebp
        movl esp,ebp
        pushl edi
        pushl edi
        movl 8(ebp),edi
        movl 8(ebp),edi
        movzbl 12(ebp),eax
        movzbl 12(ebp),eax
        movl 16(ebp),ecx
        movl 16(ebp),ecx
        cld
        cld
#ifndef __OPTIMIZE_SIZE__
#ifndef __OPTIMIZE_SIZE__
/* Less than 16 bytes won't benefit from the 'rep stosl' loop.  */
/* Less than 16 bytes won't benefit from the 'rep stosl' loop.  */
        cmpl $16,ecx
        cmpl $16,ecx
        jbe .L19
        jbe .L19
        testl $7,edi
        testl $7,edi
        je .L10
        je .L10
/* It turns out that 8-byte aligned 'rep stosl' outperforms
/* It turns out that 8-byte aligned 'rep stosl' outperforms
   4-byte aligned on some x86 platforms.  */
   4-byte aligned on some x86 platforms.  */
        movb al,(edi)
        movb al,(edi)
        incl edi
        incl edi
        decl ecx
        decl ecx
        testl $7,edi
        testl $7,edi
        je .L10
        je .L10
        movb al,(edi)
        movb al,(edi)
        incl edi
        incl edi
        decl ecx
        decl ecx
        testl $7,edi
        testl $7,edi
        je .L10
        je .L10
        movb al,(edi)
        movb al,(edi)
        incl edi
        incl edi
        decl ecx
        decl ecx
        testl $7,edi
        testl $7,edi
        je .L10
        je .L10
        movb al,(edi)
        movb al,(edi)
        incl edi
        incl edi
        decl ecx
        decl ecx
        testl $7,edi
        testl $7,edi
        je .L10
        je .L10
        movb al,(edi)
        movb al,(edi)
        incl edi
        incl edi
        decl ecx
        decl ecx
        testl $7,edi
        testl $7,edi
        je .L10
        je .L10
        movb al,(edi)
        movb al,(edi)
        incl edi
        incl edi
        decl ecx
        decl ecx
        testl $7,edi
        testl $7,edi
        je .L10
        je .L10
        movb al,(edi)
        movb al,(edi)
        incl edi
        incl edi
        decl ecx
        decl ecx
/* At this point, ecx>8 and edi%8==0.  */
/* At this point, ecx>8 and edi%8==0.  */
.L10:
.L10:
        movb al,ah
        movb al,ah
        movl eax,edx
        movl eax,edx
        sall $16,edx
        sall $16,edx
        orl edx,eax
        orl edx,eax
        movl ecx,edx
        movl ecx,edx
        shrl $2,ecx
        shrl $2,ecx
        andl $3,edx
        andl $3,edx
        rep
        rep
        stosl
        stosl
        movl edx,ecx
        movl edx,ecx
#endif /* not __OPTIMIZE_SIZE__ */
#endif /* not __OPTIMIZE_SIZE__ */
.L19:
.L19:
        rep
        rep
        stosb
        stosb
        movl 8(ebp),eax
        movl 8(ebp),eax
        leal -4(ebp),esp
        leal -4(ebp),esp
        popl edi
        popl edi
        leave
        leave
        ret
        ret
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.