* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
* This code is derived from software contributed to Berkeley by
* %sccs.include.redist.c%
#include <machine/machAsmDefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("@(#)bzero.s 8.1 (Berkeley) %G%")
#endif /* LIBC_SCCS and not lint */
blt a1, 12, smallclr # small amount to clear?
subu a3, zero, a0 # compute # bytes to word align address
beq a3, zero, 1f # skip if word aligned
subu a1, a1, a3 # subtract from remaining count
swr zero, 0(a0) # clear 1, 2, or 3 bytes to align
and v0, a1, 3 # compute number of words left
addu a3, a3, a0 # compute ending address
addu a0, a0, 4 # clear words
bne a0, a3, 2b # unrolling loop doesnt help
sw zero, -4(a0) # since we are limited by memory speed
addu a3, a1, a0 # compute ending address
addu a0, a0, 1 # clear bytes