2 * Copyright 2005-2009 Analog Devices Inc.
4 * Licensed under the ADI BSD license or the GPL-2 (or later)
7 #include <linux/linkage.h>
12 * C Library function MEMMOVE
13 * R0 = To Address (leave unchanged to form result)
21 P0 = R0; /* P0 = To address */
22 P3 = R1; /* P3 = From Address */
23 P2 = R2; /* P2 = count */
24 CC = P2 == 0; /* Check zero count*/
25 IF CC JUMP .Lfinished; /* very unlikely */
27 CC = R1 < R0 (IU); /* From < To */
28 IF !CC JUMP .Lno_overlap;
30 CC = R0 <= R3 (IU); /* (From+len) >= To */
36 R3 = R1 | R0; /* OR addresses together */
37 R3 <<= 30; /* check bottom two bits */
38 CC = AZ; /* AZ set if zero.*/
39 IF !CC JUMP .Lbytes; /* Jump if addrs not aligned.*/
42 P1 = P2 >> 2; /* count = n/4 */
45 R2 = R2 & R3; /* remainder */
46 P2 = R2; /* set remainder */
49 LSETUP (.Lquad_loops, .Lquad_loope) LC0=P1;
58 MNOP || [P0++] = R1 || R1 = [I0++];
62 CC = P2 == 0; /* any remaining bytes? */
63 P3 = I0; /* Amend P3 to updated ptr. */
68 .Lbytes: LSETUP (.Lbyte2_s, .Lbyte2_e) LC0=P2;
69 .Lbyte2_s: R1 = B[P3++](Z);
70 .Lbyte2_e: B[P0++] = R1;
86 LSETUP (.Lol_s, .Lol_e) LC0 = P2;
88 .Lol_e: R1 = B[P3--] (Z);
89 .Lno_loop: B[P0] = R1;