1 /* $Id: memscan.S,v 1.4 1996/09/08 02:01:20 davem Exp $
2 * memscan.S: Optimized memscan for the Sparc.
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
7 /* In essence, this is just a fancy strlen. */
9 #define LO_MAGIC 0x01010101
10 #define HI_MAGIC 0x80808080
14 .globl __memscan_zero, __memscan_generic
17 /* %o0 = addr, %o1 = size */
27 sethi %hi(HI_MAGIC), %g2
30 mzero_still_not_word_aligned:
47 bne,a mzero_still_not_word_aligned
50 sethi %hi(HI_MAGIC), %g2
52 or %g2, %lo(HI_MAGIC), %o3
53 sethi %hi(LO_MAGIC), %g3
54 or %g3, %lo(LO_MAGIC), %o2
57 mzero_next_word_preloaded:
59 mzero_next_word_preloaded_next:
64 mzero_check_out_of_fuel:
73 b mzero_next_word_preloaded_next
76 /* Check every byte. */
89 bne,a mzero_byte_two_and_three
95 mzero_byte_two_and_three:
105 bne,a mzero_next_word_preloaded
117 /* %o0 = addr, %o1 = c, %o2 = size */