OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [string/] [arm/] [memset.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* Copyright (C) 1998 Free Software Foundation, Inc.
2
   This file is part of the GNU C Library.
3
   Contributed by Philip Blundell 
4
 
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Lesser General Public
7
   License as published by the Free Software Foundation; either
8
   version 2.1 of the License, or (at your option) any later version.
9
 
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Lesser General Public License for more details.
14
 
15
   You should have received a copy of the GNU Lesser General Public
16
   License along with the GNU C Library; if not, write to the Free
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
   02111-1307 USA.  */
19
 
20
#include 
21
 
22
                .text
23
                .global memset;
24
                .type memset,%function
25
                .align 4;                                                               \
26
 
27
memset:
28
        mov     a4, a1
29
        cmp     a3, $8          @ at least 8 bytes to do?
30
        blt     2f
31
        orr     a2, a2, a2, lsl $8
32
        orr     a2, a2, a2, lsl $16
33
1:
34
        tst     a4, $3          @ aligned yet?
35
        strneb  a2, [a4], $1
36
        subne   a3, a3, $1
37
        bne     1b
38
        mov     ip, a2
39
1:
40
        cmp     a3, $8          @ 8 bytes still to do?
41
        blt     2f
42
        stmia   a4!, {a2, ip}
43
        sub     a3, a3, $8
44
        cmp     a3, $8          @ 8 bytes still to do?
45
        blt     2f
46
        stmia   a4!, {a2, ip}
47
        sub     a3, a3, $8
48
        cmp     a3, $8          @ 8 bytes still to do?
49
        blt     2f
50
        stmia   a4!, {a2, ip}
51
        sub     a3, a3, $8
52
        cmp     a3, $8          @ 8 bytes still to do?
53
        stmgeia a4!, {a2, ip}
54
        subge   a3, a3, $8
55
        bge     1b
56
2:
57
        movs    a3, a3          @ anything left?
58
        moveq   pc, lr          @ nope
59
        rsb     a3, a3, $7
60
        add     pc, pc, a3, lsl $2
61
        mov     r0, r0
62
        strb    a2, [a4], $1
63
        strb    a2, [a4], $1
64
        strb    a2, [a4], $1
65
        strb    a2, [a4], $1
66
        strb    a2, [a4], $1
67
        strb    a2, [a4], $1
68
        strb    a2, [a4], $1
69
        mov     pc, lr
70
 
71
.size memset,.-memset;
72
 

powered by: WebSVN 2.1.0

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