diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-01-07 19:56:09 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-01-22 18:46:45 +0100 |
commit | a035261089403de259e74ce4dd196e2715138ed2 (patch) | |
tree | 440d75109a7ebfefef2a58076b38b1bfe9db8f63 /firmware/target/arm | |
parent | 8e8e978de6b6283b66a6829fa8c5e3b94674ce7d (diff) | |
download | rockbox-a035261089403de259e74ce4dd196e2715138ed2.tar.gz rockbox-a035261089403de259e74ce4dd196e2715138ed2.zip |
Move optimized memcpy and friends and strlen to firmware/asm,
using the new automatic-asm-picking infrastructure.
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/memcpy-arm.S | 176 | ||||
-rw-r--r-- | firmware/target/arm/memmove-arm.S | 190 | ||||
-rw-r--r-- | firmware/target/arm/memset-arm.S | 98 | ||||
-rw-r--r-- | firmware/target/arm/memset16-arm.S | 82 |
4 files changed, 0 insertions, 546 deletions
diff --git a/firmware/target/arm/memcpy-arm.S b/firmware/target/arm/memcpy-arm.S deleted file mode 100644 index 2a55fb5656..0000000000 --- a/firmware/target/arm/memcpy-arm.S +++ /dev/null | |||
@@ -1,176 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Free Software Foundation, Inc. | ||
11 | * This file was originally part of the GNU C Library | ||
12 | * Contributed to glibc by MontaVista Software, Inc. (written by Nicolas Pitre) | ||
13 | * Adapted for Rockbox by Daniel Ankers | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version 2 | ||
18 | * of the License, or (at your option) any later version. | ||
19 | * | ||
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
21 | * KIND, either express or implied. | ||
22 | * | ||
23 | ****************************************************************************/ | ||
24 | |||
25 | #include "config.h" | ||
26 | |||
27 | /* | ||
28 | * Endian independent macros for shifting bytes within registers. | ||
29 | */ | ||
30 | #ifndef __ARMEB__ | ||
31 | #define pull lsr | ||
32 | #define push lsl | ||
33 | #else | ||
34 | #define pull lsl | ||
35 | #define push lsr | ||
36 | #endif | ||
37 | |||
38 | /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ | ||
39 | |||
40 | .section .icode,"ax",%progbits | ||
41 | |||
42 | .align 2 | ||
43 | .global memcpy | ||
44 | .type memcpy,%function | ||
45 | |||
46 | memcpy: | ||
47 | stmfd sp!, {r0, r4, lr} | ||
48 | |||
49 | subs r2, r2, #4 | ||
50 | blt 8f | ||
51 | ands ip, r0, #3 | ||
52 | bne 9f | ||
53 | ands ip, r1, #3 | ||
54 | bne 10f | ||
55 | |||
56 | 1: subs r2, r2, #(28) | ||
57 | stmfd sp!, {r5 - r8} | ||
58 | blt 5f | ||
59 | |||
60 | 2: | ||
61 | 3: | ||
62 | 4: ldmia r1!, {r3, r4, r5, r6, r7, r8, ip, lr} | ||
63 | subs r2, r2, #32 | ||
64 | stmia r0!, {r3, r4, r5, r6, r7, r8, ip, lr} | ||
65 | bge 3b | ||
66 | |||
67 | 5: ands ip, r2, #28 | ||
68 | rsb ip, ip, #32 | ||
69 | addne pc, pc, ip @ C is always clear here | ||
70 | b 7f | ||
71 | 6: nop | ||
72 | ldr r3, [r1], #4 | ||
73 | ldr r4, [r1], #4 | ||
74 | ldr r5, [r1], #4 | ||
75 | ldr r6, [r1], #4 | ||
76 | ldr r7, [r1], #4 | ||
77 | ldr r8, [r1], #4 | ||
78 | ldr lr, [r1], #4 | ||
79 | |||
80 | add pc, pc, ip | ||
81 | nop | ||
82 | nop | ||
83 | str r3, [r0], #4 | ||
84 | str r4, [r0], #4 | ||
85 | str r5, [r0], #4 | ||
86 | str r6, [r0], #4 | ||
87 | str r7, [r0], #4 | ||
88 | str r8, [r0], #4 | ||
89 | str lr, [r0], #4 | ||
90 | |||
91 | 7: ldmfd sp!, {r5 - r8} | ||
92 | |||
93 | 8: movs r2, r2, lsl #31 | ||
94 | ldrneb r3, [r1], #1 | ||
95 | ldrcsb r4, [r1], #1 | ||
96 | ldrcsb ip, [r1] | ||
97 | strneb r3, [r0], #1 | ||
98 | strcsb r4, [r0], #1 | ||
99 | strcsb ip, [r0] | ||
100 | |||
101 | ldmpc regs="r0, r4" | ||
102 | |||
103 | 9: rsb ip, ip, #4 | ||
104 | cmp ip, #2 | ||
105 | ldrgtb r3, [r1], #1 | ||
106 | ldrgeb r4, [r1], #1 | ||
107 | ldrb lr, [r1], #1 | ||
108 | strgtb r3, [r0], #1 | ||
109 | strgeb r4, [r0], #1 | ||
110 | subs r2, r2, ip | ||
111 | strb lr, [r0], #1 | ||
112 | blt 8b | ||
113 | ands ip, r1, #3 | ||
114 | beq 1b | ||
115 | |||
116 | 10: bic r1, r1, #3 | ||
117 | cmp ip, #2 | ||
118 | ldr lr, [r1], #4 | ||
119 | beq 17f | ||
120 | bgt 18f | ||
121 | |||
122 | |||
123 | .macro forward_copy_shift pull push | ||
124 | |||
125 | subs r2, r2, #28 | ||
126 | blt 14f | ||
127 | |||
128 | 11: stmfd sp!, {r5 - r9} | ||
129 | |||
130 | 12: | ||
131 | 13: ldmia r1!, {r4, r5, r6, r7} | ||
132 | mov r3, lr, pull #\pull | ||
133 | subs r2, r2, #32 | ||
134 | ldmia r1!, {r8, r9, ip, lr} | ||
135 | orr r3, r3, r4, push #\push | ||
136 | mov r4, r4, pull #\pull | ||
137 | orr r4, r4, r5, push #\push | ||
138 | mov r5, r5, pull #\pull | ||
139 | orr r5, r5, r6, push #\push | ||
140 | mov r6, r6, pull #\pull | ||
141 | orr r6, r6, r7, push #\push | ||
142 | mov r7, r7, pull #\pull | ||
143 | orr r7, r7, r8, push #\push | ||
144 | mov r8, r8, pull #\pull | ||
145 | orr r8, r8, r9, push #\push | ||
146 | mov r9, r9, pull #\pull | ||
147 | orr r9, r9, ip, push #\push | ||
148 | mov ip, ip, pull #\pull | ||
149 | orr ip, ip, lr, push #\push | ||
150 | stmia r0!, {r3, r4, r5, r6, r7, r8, r9, ip} | ||
151 | bge 12b | ||
152 | |||
153 | ldmfd sp!, {r5 - r9} | ||
154 | |||
155 | 14: ands ip, r2, #28 | ||
156 | beq 16f | ||
157 | |||
158 | 15: mov r3, lr, pull #\pull | ||
159 | ldr lr, [r1], #4 | ||
160 | subs ip, ip, #4 | ||
161 | orr r3, r3, lr, push #\push | ||
162 | str r3, [r0], #4 | ||
163 | bgt 15b | ||
164 | |||
165 | 16: sub r1, r1, #(\push / 8) | ||
166 | b 8b | ||
167 | |||
168 | .endm | ||
169 | |||
170 | |||
171 | forward_copy_shift pull=8 push=24 | ||
172 | |||
173 | 17: forward_copy_shift pull=16 push=16 | ||
174 | |||
175 | 18: forward_copy_shift pull=24 push=8 | ||
176 | |||
diff --git a/firmware/target/arm/memmove-arm.S b/firmware/target/arm/memmove-arm.S deleted file mode 100644 index d8cab048be..0000000000 --- a/firmware/target/arm/memmove-arm.S +++ /dev/null | |||
@@ -1,190 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 Free Software Foundation, Inc. | ||
11 | * This file was originally part of the GNU C Library | ||
12 | * Contributed to glibc by MontaVista Software, Inc. (written by Nicolas Pitre) | ||
13 | * Adapted for Rockbox by Daniel Ankers | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version 2 | ||
18 | * of the License, or (at your option) any later version. | ||
19 | * | ||
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
21 | * KIND, either express or implied. | ||
22 | * | ||
23 | ****************************************************************************/ | ||
24 | |||
25 | #include "config.h" | ||
26 | |||
27 | /* | ||
28 | * Endian independent macros for shifting bytes within registers. | ||
29 | */ | ||
30 | #ifndef __ARMEB__ | ||
31 | #define pull lsr | ||
32 | #define push lsl | ||
33 | #else | ||
34 | #define pull lsl | ||
35 | #define push lsr | ||
36 | #endif | ||
37 | |||
38 | .text | ||
39 | |||
40 | /* | ||
41 | * Prototype: void *memmove(void *dest, const void *src, size_t n); | ||
42 | * | ||
43 | * Note: | ||
44 | * | ||
45 | * If the memory regions don't overlap, we simply branch to memcpy which is | ||
46 | * normally a bit faster. Otherwise the copy is done going downwards. | ||
47 | */ | ||
48 | |||
49 | .section .icode,"ax",%progbits | ||
50 | |||
51 | .align 2 | ||
52 | .global memmove | ||
53 | .type memmove,%function | ||
54 | |||
55 | memmove: | ||
56 | |||
57 | subs ip, r0, r1 | ||
58 | cmphi r2, ip | ||
59 | bls memcpy | ||
60 | |||
61 | stmfd sp!, {r0, r4, lr} | ||
62 | add r1, r1, r2 | ||
63 | add r0, r0, r2 | ||
64 | subs r2, r2, #4 | ||
65 | blt 8f | ||
66 | ands ip, r0, #3 | ||
67 | bne 9f | ||
68 | ands ip, r1, #3 | ||
69 | bne 10f | ||
70 | |||
71 | 1: subs r2, r2, #(28) | ||
72 | stmfd sp!, {r5 - r8} | ||
73 | blt 5f | ||
74 | |||
75 | 2: | ||
76 | 3: | ||
77 | 4: ldmdb r1!, {r3, r4, r5, r6, r7, r8, ip, lr} | ||
78 | subs r2, r2, #32 | ||
79 | stmdb r0!, {r3, r4, r5, r6, r7, r8, ip, lr} | ||
80 | bge 3b | ||
81 | |||
82 | 5: ands ip, r2, #28 | ||
83 | rsb ip, ip, #32 | ||
84 | addne pc, pc, ip @ C is always clear here | ||
85 | b 7f | ||
86 | 6: nop | ||
87 | ldr r3, [r1, #-4]! | ||
88 | ldr r4, [r1, #-4]! | ||
89 | ldr r5, [r1, #-4]! | ||
90 | ldr r6, [r1, #-4]! | ||
91 | ldr r7, [r1, #-4]! | ||
92 | ldr r8, [r1, #-4]! | ||
93 | ldr lr, [r1, #-4]! | ||
94 | |||
95 | add pc, pc, ip | ||
96 | nop | ||
97 | nop | ||
98 | str r3, [r0, #-4]! | ||
99 | str r4, [r0, #-4]! | ||
100 | str r5, [r0, #-4]! | ||
101 | str r6, [r0, #-4]! | ||
102 | str r7, [r0, #-4]! | ||
103 | str r8, [r0, #-4]! | ||
104 | str lr, [r0, #-4]! | ||
105 | |||
106 | 7: ldmfd sp!, {r5 - r8} | ||
107 | |||
108 | 8: movs r2, r2, lsl #31 | ||
109 | ldrneb r3, [r1, #-1]! | ||
110 | ldrcsb r4, [r1, #-1]! | ||
111 | ldrcsb ip, [r1, #-1] | ||
112 | strneb r3, [r0, #-1]! | ||
113 | strcsb r4, [r0, #-1]! | ||
114 | strcsb ip, [r0, #-1] | ||
115 | ldmpc regs="r0, r4" | ||
116 | |||
117 | 9: cmp ip, #2 | ||
118 | ldrgtb r3, [r1, #-1]! | ||
119 | ldrgeb r4, [r1, #-1]! | ||
120 | ldrb lr, [r1, #-1]! | ||
121 | strgtb r3, [r0, #-1]! | ||
122 | strgeb r4, [r0, #-1]! | ||
123 | subs r2, r2, ip | ||
124 | strb lr, [r0, #-1]! | ||
125 | blt 8b | ||
126 | ands ip, r1, #3 | ||
127 | beq 1b | ||
128 | |||
129 | 10: bic r1, r1, #3 | ||
130 | cmp ip, #2 | ||
131 | ldr r3, [r1, #0] | ||
132 | beq 17f | ||
133 | blt 18f | ||
134 | |||
135 | |||
136 | .macro backward_copy_shift push pull | ||
137 | |||
138 | subs r2, r2, #28 | ||
139 | blt 14f | ||
140 | |||
141 | 11: stmfd sp!, {r5 - r9} | ||
142 | |||
143 | 12: | ||
144 | 13: ldmdb r1!, {r7, r8, r9, ip} | ||
145 | mov lr, r3, push #\push | ||
146 | subs r2, r2, #32 | ||
147 | ldmdb r1!, {r3, r4, r5, r6} | ||
148 | orr lr, lr, ip, pull #\pull | ||
149 | mov ip, ip, push #\push | ||
150 | orr ip, ip, r9, pull #\pull | ||
151 | mov r9, r9, push #\push | ||
152 | orr r9, r9, r8, pull #\pull | ||
153 | mov r8, r8, push #\push | ||
154 | orr r8, r8, r7, pull #\pull | ||
155 | mov r7, r7, push #\push | ||
156 | orr r7, r7, r6, pull #\pull | ||
157 | mov r6, r6, push #\push | ||
158 | orr r6, r6, r5, pull #\pull | ||
159 | mov r5, r5, push #\push | ||
160 | orr r5, r5, r4, pull #\pull | ||
161 | mov r4, r4, push #\push | ||
162 | orr r4, r4, r3, pull #\pull | ||
163 | stmdb r0!, {r4 - r9, ip, lr} | ||
164 | bge 12b | ||
165 | |||
166 | ldmfd sp!, {r5 - r9} | ||
167 | |||
168 | 14: ands ip, r2, #28 | ||
169 | beq 16f | ||
170 | |||
171 | 15: mov lr, r3, push #\push | ||
172 | ldr r3, [r1, #-4]! | ||
173 | subs ip, ip, #4 | ||
174 | orr lr, lr, r3, pull #\pull | ||
175 | str lr, [r0, #-4]! | ||
176 | bgt 15b | ||
177 | |||
178 | 16: add r1, r1, #(\pull / 8) | ||
179 | b 8b | ||
180 | |||
181 | .endm | ||
182 | |||
183 | |||
184 | backward_copy_shift push=8 pull=24 | ||
185 | |||
186 | 17: backward_copy_shift push=16 pull=16 | ||
187 | |||
188 | 18: backward_copy_shift push=24 pull=8 | ||
189 | |||
190 | |||
diff --git a/firmware/target/arm/memset-arm.S b/firmware/target/arm/memset-arm.S deleted file mode 100644 index 682da874ce..0000000000 --- a/firmware/target/arm/memset-arm.S +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Thom Johansen | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | |||
23 | .section .icode,"ax",%progbits | ||
24 | |||
25 | .align 2 | ||
26 | |||
27 | /* The following code is based on code found in Linux kernel version 2.6.15.3 | ||
28 | * linux/arch/arm/lib/memset.S | ||
29 | * | ||
30 | * Copyright (C) 1995-2000 Russell King | ||
31 | */ | ||
32 | |||
33 | /* This code will align a pointer for memset, if needed */ | ||
34 | 1: cmp r2, #4 @ 1 do we have enough | ||
35 | blt 5f @ 1 bytes to align with? | ||
36 | cmp r3, #2 @ 1 | ||
37 | strgtb r1, [r0, #-1]! @ 1 | ||
38 | strgeb r1, [r0, #-1]! @ 1 | ||
39 | strb r1, [r0, #-1]! @ 1 | ||
40 | sub r2, r2, r3 @ 1 r2 = r2 - r3 | ||
41 | b 2f | ||
42 | |||
43 | .global memset | ||
44 | .type memset,%function | ||
45 | memset: | ||
46 | add r0, r0, r2 @ we'll write backwards in memory | ||
47 | ands r3, r0, #3 @ 1 unaligned? | ||
48 | bne 1b @ 1 | ||
49 | 2: | ||
50 | /* | ||
51 | * we know that the pointer in r0 is aligned to a word boundary. | ||
52 | */ | ||
53 | orr r1, r1, r1, lsl #8 | ||
54 | orr r1, r1, r1, lsl #16 | ||
55 | mov r3, r1 | ||
56 | cmp r2, #16 | ||
57 | blt 5f | ||
58 | /* | ||
59 | * We need an extra register for this loop - save the return address and | ||
60 | * use the LR | ||
61 | */ | ||
62 | str lr, [sp, #-4]! | ||
63 | mov ip, r1 | ||
64 | mov lr, r1 | ||
65 | |||
66 | 3: subs r2, r2, #64 | ||
67 | stmgedb r0!, {r1, r3, ip, lr} @ 64 bytes at a time. | ||
68 | stmgedb r0!, {r1, r3, ip, lr} | ||
69 | stmgedb r0!, {r1, r3, ip, lr} | ||
70 | stmgedb r0!, {r1, r3, ip, lr} | ||
71 | bgt 3b | ||
72 | ldrpc cond=eq @ Now <64 bytes to go. | ||
73 | /* | ||
74 | * No need to correct the count; we're only testing bits from now on | ||
75 | */ | ||
76 | tst r2, #32 | ||
77 | stmnedb r0!, {r1, r3, ip, lr} | ||
78 | stmnedb r0!, {r1, r3, ip, lr} | ||
79 | tst r2, #16 | ||
80 | stmnedb r0!, {r1, r3, ip, lr} | ||
81 | ldr lr, [sp], #4 | ||
82 | |||
83 | 5: tst r2, #8 | ||
84 | stmnedb r0!, {r1, r3} | ||
85 | tst r2, #4 | ||
86 | strne r1, [r0, #-4]! | ||
87 | /* | ||
88 | * When we get here, we've got less than 4 bytes to zero. We | ||
89 | * may have an unaligned pointer as well. | ||
90 | */ | ||
91 | 6: tst r2, #2 | ||
92 | strneb r1, [r0, #-1]! | ||
93 | strneb r1, [r0, #-1]! | ||
94 | tst r2, #1 | ||
95 | strneb r1, [r0, #-1]! | ||
96 | bx lr | ||
97 | .end: | ||
98 | .size memset,.end-memset | ||
diff --git a/firmware/target/arm/memset16-arm.S b/firmware/target/arm/memset16-arm.S deleted file mode 100644 index 5c787b1bed..0000000000 --- a/firmware/target/arm/memset16-arm.S +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Thom Johansen | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | |||
23 | .section .icode,"ax",%progbits | ||
24 | |||
25 | .align 2 | ||
26 | |||
27 | /* The following code is based on code from the Linux kernel version 2.6.15.3, | ||
28 | * linux/arch/arm/lib/memset.S | ||
29 | * | ||
30 | * Copyright (C) 1995-2000 Russell King | ||
31 | */ | ||
32 | |||
33 | .global memset16 | ||
34 | .type memset16,%function | ||
35 | memset16: | ||
36 | tst r0, #2 @ unaligned? | ||
37 | cmpne r2, #0 | ||
38 | strneh r1, [r0], #2 @ store one halfword to align | ||
39 | subne r2, r2, #1 | ||
40 | |||
41 | /* | ||
42 | * we know that the pointer in r0 is aligned to a word boundary. | ||
43 | */ | ||
44 | orr r1, r1, r1, lsl #16 | ||
45 | mov r3, r1 | ||
46 | cmp r2, #8 | ||
47 | blt 4f | ||
48 | /* | ||
49 | * We need an extra register for this loop - save the return address and | ||
50 | * use the LR | ||
51 | */ | ||
52 | str lr, [sp, #-4]! | ||
53 | mov ip, r1 | ||
54 | mov lr, r1 | ||
55 | |||
56 | 2: subs r2, r2, #32 | ||
57 | stmgeia r0!, {r1, r3, ip, lr} @ 64 bytes at a time. | ||
58 | stmgeia r0!, {r1, r3, ip, lr} | ||
59 | stmgeia r0!, {r1, r3, ip, lr} | ||
60 | stmgeia r0!, {r1, r3, ip, lr} | ||
61 | bgt 2b | ||
62 | ldrpc cond=eq @ Now <64 bytes to go. | ||
63 | /* | ||
64 | * No need to correct the count; we're only testing bits from now on | ||
65 | */ | ||
66 | tst r2, #16 | ||
67 | stmneia r0!, {r1, r3, ip, lr} | ||
68 | stmneia r0!, {r1, r3, ip, lr} | ||
69 | tst r2, #8 | ||
70 | stmneia r0!, {r1, r3, ip, lr} | ||
71 | ldr lr, [sp], #4 | ||
72 | |||
73 | 4: tst r2, #4 | ||
74 | stmneia r0!, {r1, r3} | ||
75 | tst r2, #2 | ||
76 | strne r1, [r0], #4 | ||
77 | |||
78 | tst r2, #1 | ||
79 | strneh r1, [r0], #2 | ||
80 | bx lr | ||
81 | .end: | ||
82 | .size memset16,.end-memset16 | ||