Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
David S. Miller | 8695c37 | 2012-05-11 20:33:22 -0700 | [diff] [blame^] | 7 | #include <linux/linkage.h> |
| 8 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | .text |
David S. Miller | 8695c37 | 2012-05-11 20:33:22 -0700 | [diff] [blame^] | 10 | ENTRY(memmove) /* o0=dst o1=src o2=len */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |
David S. Miller | 8695c37 | 2012-05-11 20:33:22 -0700 | [diff] [blame^] | 30 | ENDPROC(memmove) |