diff options
-rw-r--r-- | sys/lib/libkern/arch/mips64/bzero.S | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/lib/libkern/arch/mips64/bzero.S b/sys/lib/libkern/arch/mips64/bzero.S index 401b0b3e4e5..695d60d4508 100644 --- a/sys/lib/libkern/arch/mips64/bzero.S +++ b/sys/lib/libkern/arch/mips64/bzero.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bzero.S,v 1.3 2004/09/09 15:41:18 pefo Exp $ */ +/* $OpenBSD: bzero.S,v 1.4 2004/09/18 09:13:57 pefo Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -36,27 +36,27 @@ /* - * bzero(s1, n) + * bzero(void *p, size_t len) */ LEAF(bzero, 0) ALEAF(blkclr) .set noreorder - blt a1, 12, smallclr # small amount to clear? + blt a1, 24, smallclr # small amount to clear? subu a3, zero, a0 # compute # bytes to word align address - and a3, a3, 3 + and a3, a3, 7 beq a3, zero, 1f # skip if word aligned subu a1, a1, a3 # subtract from remaining count - SWHI zero, 0(a0) # clear 1, 2, or 3 bytes to align + SDHI zero, 0(a0) # clear 1, 2, or 3 bytes to align addu a0, a0, a3 1: - and v0, a1, 3 # compute number of words left + and v0, a1, 7 # compute number of words left subu a3, a1, v0 move a1, v0 addu a3, a3, a0 # compute ending address 2: - addu a0, a0, 4 # clear words + addu a0, a0, 8 # clear words bne a0, a3, 2b # unrolling loop does not help - sw zero, -4(a0) # since we are limited by memory speed + sd zero, -8(a0) # since we are limited by memory speed smallclr: ble a1, zero, 2f addu a3, a1, a0 # compute ending address |