movstr.S revision 1.8.72.1 1 1.8.72.1 skrll /* $NetBSD: movstr.S,v 1.8.72.1 2009/01/19 13:19:56 skrll Exp $ */
2 1.1 itojun
3 1.1 itojun /*-
4 1.1 itojun * Copyright (C) 1999 Tsubai Masanari. All rights reserved.
5 1.1 itojun *
6 1.1 itojun * Redistribution and use in source and binary forms, with or without
7 1.1 itojun * modification, are permitted provided that the following conditions
8 1.1 itojun * are met:
9 1.1 itojun * 1. Redistributions of source code must retain the above copyright
10 1.1 itojun * notice, this list of conditions and the following disclaimer.
11 1.1 itojun * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 itojun * notice, this list of conditions and the following disclaimer in the
13 1.1 itojun * documentation and/or other materials provided with the distribution.
14 1.1 itojun * 3. The name of the author may not be used to endorse or promote products
15 1.1 itojun * derived from this software without specific prior written permission.
16 1.1 itojun *
17 1.1 itojun * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 1.1 itojun * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 1.1 itojun * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 1.1 itojun * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 1.1 itojun * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 1.1 itojun * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 1.1 itojun * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 1.1 itojun * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 1.1 itojun * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 1.1 itojun * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 1.1 itojun */
28 1.1 itojun
29 1.2 msaitoh #include <machine/asm.h>
30 1.1 itojun
31 1.8.72.1 skrll
32 1.8.72.1 skrll #ifdef __ELF__
33 1.8.72.1 skrll .hidden __movstr, __movmem
34 1.8.72.1 skrll #endif
35 1.8.72.1 skrll
36 1.8.72.1 skrll
37 1.6 uwe NENTRY(__movstr)
38 1.1 itojun mov #16, r0
39 1.1 itojun cmp/gt r0, r6
40 1.1 itojun bf loop2
41 1.1 itojun
42 1.6 uwe .align 2
43 1.1 itojun loop1:
44 1.1 itojun mov.l @r5+, r0
45 1.1 itojun mov.l r0, @r4
46 1.1 itojun mov.l @r5+, r0
47 1.1 itojun mov.l r0, @(4, r4)
48 1.1 itojun mov.l @r5+, r0
49 1.1 itojun mov.l r0, @(8, r4)
50 1.1 itojun mov.l @r5+, r0
51 1.1 itojun mov.l r0, @(12, r4)
52 1.1 itojun mov.l @r5+, r0
53 1.1 itojun mov.l r0, @(16, r4)
54 1.1 itojun mov.l @r5+, r0
55 1.1 itojun mov.l r0, @(20, r4)
56 1.1 itojun mov.l @r5+, r0
57 1.1 itojun mov.l r0, @(24, r4)
58 1.1 itojun mov.l @r5+, r0
59 1.1 itojun mov.l r0, @(28, r4)
60 1.1 itojun mov.l @r5+, r0
61 1.1 itojun mov.l r0, @(32, r4)
62 1.1 itojun mov.l @r5+, r0
63 1.1 itojun mov.l r0, @(36, r4)
64 1.1 itojun mov.l @r5+, r0
65 1.1 itojun mov.l r0, @(40, r4)
66 1.1 itojun mov.l @r5+, r0
67 1.1 itojun mov.l r0, @(44, r4)
68 1.1 itojun mov.l @r5+, r0
69 1.1 itojun mov.l r0, @(48, r4)
70 1.1 itojun mov.l @r5+, r0
71 1.1 itojun mov.l r0, @(52, r4)
72 1.1 itojun mov.l @r5+, r0
73 1.1 itojun mov.l r0, @(56, r4)
74 1.1 itojun mov.l @r5+, r0
75 1.1 itojun mov.l r0, @(60, r4)
76 1.1 itojun add #-16, r6
77 1.1 itojun add #64, r4
78 1.1 itojun
79 1.1 itojun mov #16, r0
80 1.1 itojun cmp/gt r0, r6
81 1.1 itojun bt loop1
82 1.1 itojun
83 1.1 itojun loop2:
84 1.1 itojun add #-32, r6
85 1.6 uwe .align 2
86 1.1 itojun 1:
87 1.1 itojun mov.l @r5+, r0
88 1.1 itojun mov.l r0, @r4
89 1.1 itojun add #4, r4
90 1.1 itojun add #1, r6
91 1.1 itojun tst r6, r6
92 1.1 itojun bf 1b
93 1.1 itojun
94 1.3 perry rts
95 1.6 uwe nop
96 1.8 uwe
97 1.8 uwe
98 1.8 uwe /* gcc4 uses movmem, older versions use movstr */
99 1.8 uwe STRONG_ALIAS(__movmem, __movstr)
100