2 * memscan.S: Optimized memscan for Sparc64.
4 * Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
5 * Copyright (C) 1998 David S. Miller (davem@redhat.com)
8 #define HI_MAGIC 0x8080808080808080
9 #define LO_MAGIC 0x0101010101010101
14 .globl __memscan_zero, __memscan_generic
18 /* %o0 = bufp, %o1 = size */
21 be,pt %icc, we_are_aligned
22 sethi %hi(HI_MAGIC), %o4
33 ldxa [%o0] ASI_PL, %o5
34 or %o4, %lo(HI_MAGIC), %o3
45 bne,pn %xcc, check_bytes
49 ldxa [%o0] ASI_PL, %o5
77 3: andcc %g7, 0xff, %g0
95 2: brgz,a,pt %o1, msloop
96 ldxa [%o0] ASI_PL, %o5
110 /* %o0 = addr, %o1 = c, %o2 = size */
120 ldub [%o3 + %o4], %o5
122 /* The delay slot is the same as the next insn, this is just to make it look more awful */