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,1999 David S. Miller (davem@redhat.com)
8 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
13 #define LO_MAGIC 0x01010101
14 #define HI_MAGIC 0x80808080
17 .global __strlen_user, __strnlen_user
25 sethi %hi(HI_MAGIC), %o4
26 10: lduba [%o0] %asi, %o5
31 or %o4, %lo(HI_MAGIC), %o3
32 11: lduba [%o0] %asi, %o5
38 12: lduba [%o0] %asi, %o5
42 15: lda [%o0] %asi, %o5
43 9: or %o4, %lo(HI_MAGIC), %o3
45 13: lda [%o0] %asi, %o5
56 /* Check every byte. */
82 .section .fixup,#alloc,#execinstr
88 .section __ex_table,"a"