1 /* strlen.S: Sparc optimized strlen code
2 * Hand optimized from GNU libc's strlen
3 * Copyright (C) 1991,1996 Free Software Foundation
4 * Copyright (C) 1996,2008 David S. Miller (davem@davemloft.net)
5 * Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
8 #include <linux/linkage.h>
11 #define LO_MAGIC 0x01010101
12 #define HI_MAGIC 0x80808080
19 sethi %hi(HI_MAGIC), %o4
21 BRANCH_REG_ZERO(pn, %o5, 11f)
25 or %o4, %lo(HI_MAGIC), %o3
27 BRANCH_REG_ZERO(pn, %o5, 12f)
31 sethi %hi(LO_MAGIC), %o4
33 BRANCH_REG_ZERO(pn, %o5, 13f)
36 or %o4, %lo(LO_MAGIC), %o2
38 or %o4, %lo(HI_MAGIC), %o3
40 sethi %hi(LO_MAGIC), %o4
42 or %o4, %lo(LO_MAGIC), %o2
51 /* Check every byte. */
65 BRANCH32_ANNUL(bne, pt, 2b)