2 * linux/arch/arm/lib/memcpy.S
4 * Copyright (C) 1995-1999 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * ASM optimised string functions
12 #include <linux/linkage.h>
13 #include <asm/assembler.h>
19 stmfd sp!,{r0,r4-r9,fp,ip,lr,pc} ;\
23 LOADREGS(ea, fp, {r0, r4 - r9, fp, sp, pc})
26 LOADREGS(eqea, fp, {r0, r4 - r9, fp, sp, pc})
29 * Prototype: void memcpy(void *to,const void *from,unsigned long n);
49 PLD( subs r2, r2, #64 )
51 2: PLD( pld [r1, #60] )
53 ldmia r1!, {r3 - r9, ip}
55 stmgeia r0!, {r3 - r9, ip}
56 ldmgeia r1!, {r3 - r9, ip}
58 stmia r0!, {r3 - r9, ip}
60 3: PLD( ldmia r1!, {r3 - r9, ip} )
61 PLD( adds r2, r2, #32 )
62 PLD( stmgeia r0!, {r3 - r9, ip} )
63 PLD( ldmgeia r1!, {r3 - r9, ip} )
64 PLD( subges r2, r2, #32 )
65 PLD( stmia r0!, {r3 - r9, ip} )
67 ldmgeia r1!, {r3 - r6}
69 stmgeia r0!, {r3 - r6}
71 ldmgeia r1!, {r3 - r5}
73 stmgeia r0!, {r3 - r5}
116 PLD( subs r2, r2, #32 )
119 9: PLD( pld [r1, #44] )
120 10: mov r3, r7, pull #8
123 orr r3, r3, r4, push #24
125 orr r4, r4, r5, push #24
127 orr r5, r5, r6, push #24
129 orr r6, r6, r7, push #24
134 PLD( add r2, r2, #32 )
137 11: mov r3, r7, pull #8
140 orr r3, r3, r7, push #24
150 PLD( subs r2, r2, #32 )
153 14: PLD( pld [r1, #44] )
154 15: mov r3, r7, pull #16
157 orr r3, r3, r4, push #16
159 orr r4, r4, r5, push #16
161 orr r5, r5, r6, push #16
163 orr r6, r6, r7, push #16
168 PLD( add r2, r2, #32 )
171 16: mov r3, r7, pull #16
174 orr r3, r3, r7, push #16
184 PLD( subs r2, r2, #32 )
187 19: PLD( pld [r1, #44] )
188 20: mov r3, r7, pull #24
191 orr r3, r3, r4, push #8
193 orr r4, r4, r5, push #8
195 orr r5, r5, r6, push #8
197 orr r6, r6, r7, push #8
202 PLD( add r2, r2, #32 )
205 21: mov r3, r7, pull #24
208 orr r3, r3, r7, push #8
229 PLD( pld [r1, #-32] )
230 PLD( subs r2, r2, #64 )
232 25: PLD( pld [r1, #-64] )
233 PLD( pld [r1, #-96] )
234 ldmdb r1!, {r3 - r9, ip}
236 stmgedb r0!, {r3 - r9, ip}
237 ldmgedb r1!, {r3 - r9, ip}
239 stmdb r0!, {r3 - r9, ip}
241 26: PLD( ldmdb r1!, {r3 - r9, ip} )
242 PLD( adds r2, r2, #32 )
243 PLD( stmgedb r0!, {r3 - r9, ip} )
244 PLD( ldmgedb r1!, {r3 - r9, ip} )
245 PLD( subges r2, r2, #32 )
246 PLD( stmdb r0!, {r3 - r9, ip} )
248 ldmgedb r1!, {r3 - r6}
250 stmgedb r0!, {r3 - r6}
252 ldmgedb r1!, {r3 - r5}
254 stmgedb r0!, {r3 - r5}
259 ldmgedb r1!, {r4, r5}
262 stmgedb r0!, {r4, r5}
268 ldrgeb r4, [r1, #-1]!
269 ldrgtb r5, [r1, #-1]!
271 strgeb r4, [r0, #-1]!
272 strgtb r5, [r0, #-1]!
277 ldrgeb r4, [r1, #-1]!
278 ldrgtb r5, [r1, #-1]!
280 strgeb r4, [r0, #-1]!
281 strgtb r5, [r0, #-1]!
294 PLD( pld [r1, #-16] )
296 PLD( subs r2, r2, #32 )
298 PLD( pld [r1, #-32] )
299 32: PLD( pld [r1, #-48] )
300 33: mov r7, r3, push #8
301 ldmdb r1!, {r3, r4, r5, r6}
303 orr r7, r7, r6, pull #24
305 orr r6, r6, r5, pull #24
307 orr r5, r5, r4, pull #24
309 orr r4, r4, r3, pull #24
310 stmdb r0!, {r4, r5, r6, r7}
314 PLD( add r2, r2, #32 )
317 34: mov ip, r3, push #8
320 orr ip, ip, r3, pull #24
328 PLD( pld [r1, #-16] )
330 PLD( subs r2, r2, #32 )
332 PLD( pld [r1, #-32] )
333 37: PLD( pld [r1, #-48] )
334 38: mov r7, r3, push #16
335 ldmdb r1!, {r3, r4, r5, r6}
337 orr r7, r7, r6, pull #16
339 orr r6, r6, r5, pull #16
341 orr r5, r5, r4, pull #16
343 orr r4, r4, r3, pull #16
344 stmdb r0!, {r4, r5, r6, r7}
348 PLD( add r2, r2, #32 )
351 39: mov ip, r3, push #16
354 orr ip, ip, r3, pull #16
362 PLD( pld [r1, #-16] )
364 PLD( subs r2, r2, #32 )
366 PLD( pld [r1, #-32] )
367 42: PLD( pld [r1, #-48] )
368 43: mov r7, r3, push #24
369 ldmdb r1!, {r3, r4, r5, r6}
371 orr r7, r7, r6, pull #8
373 orr r6, r6, r5, pull #8
375 orr r5, r5, r4, pull #8
377 orr r4, r4, r3, pull #8
378 stmdb r0!, {r4, r5, r6, r7}
382 PLD( add r2, r2, #32 )
385 44: mov ip, r3, push #24
388 orr ip, ip, r3, pull #8