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