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>
10 #include <asm/export.h>
12 #define LO_MAGIC 0x01010101
13 #define HI_MAGIC 0x80808080
20 sethi %hi(HI_MAGIC), %o4
22 BRANCH_REG_ZERO(pn, %o5, 11f)
26 or %o4, %lo(HI_MAGIC), %o3
28 BRANCH_REG_ZERO(pn, %o5, 12f)
32 sethi %hi(LO_MAGIC), %o4
34 BRANCH_REG_ZERO(pn, %o5, 13f)
37 or %o4, %lo(LO_MAGIC), %o2
39 or %o4, %lo(HI_MAGIC), %o3
41 sethi %hi(LO_MAGIC), %o4
43 or %o4, %lo(LO_MAGIC), %o2
52 /* Check every byte. */
66 BRANCH32_ANNUL(bne, pt, 2b)