1 /* strlen_user.S: Sparc64 optimized strlen_user code
3 * Return length of string in userspace including terminating 0
6 * Copyright (C) 1991,1996 Free Software Foundation
7 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
8 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
13 #define LO_MAGIC 0x01010101
14 #define HI_MAGIC 0x80808080
22 sethi %hi(HI_MAGIC), %o4
23 10: lduba [%o0] %asi, %o5
28 or %o4, %lo(HI_MAGIC), %o3
29 11: lduba [%o0] %asi, %o5
35 12: lduba [%o0] %asi, %o5
39 15: lda [%o0] %asi, %o5
40 9: or %o4, %lo(HI_MAGIC), %o3
42 13: lda [%o0] %asi, %o5
48 /* Check every byte. */
63 14: lda [%o0] %asi, %o5
74 .section .fixup,#alloc,#execinstr
80 .section __ex_table,#alloc