]> git.ipfire.org Git - people/ms/linux.git/blob - arch/sparc/lib/memmove.S
Linux 4.0-rc5
[people/ms/linux.git] / arch / sparc / lib / memmove.S
1 /* memmove.S: Simple memmove implementation.
2 *
3 * Copyright (C) 1997, 2004 David S. Miller (davem@redhat.com)
4 * Copyright (C) 1996, 1997, 1998, 1999 Jakub Jelinek (jj@ultra.linux.cz)
5 */
6
7 #include <linux/linkage.h>
8
9 .text
10 ENTRY(memmove) /* o0=dst o1=src o2=len */
11 mov %o0, %g1
12 cmp %o0, %o1
13 bleu,pt %xcc, memcpy
14 add %o1, %o2, %g7
15 cmp %g7, %o0
16 bleu,pt %xcc, memcpy
17 add %o0, %o2, %o5
18 sub %g7, 1, %o1
19
20 sub %o5, 1, %o0
21 1: ldub [%o1], %g7
22 subcc %o2, 1, %o2
23 sub %o1, 1, %o1
24 stb %g7, [%o0]
25 bne,pt %icc, 1b
26 sub %o0, 1, %o0
27
28 retl
29 mov %g1, %o0
30 ENDPROC(memmove)