On the 68010, don't bother with the by-8-longwords loop, instead
only 16-bit align the region and use loop mode with longwords to do the bulk of the work. On the 68020+, fixed an optimization bug where all regions that start on odd addresses would not be properly longword aligned.
This commit is contained in:
parent
c14e80bd30
commit
129f58b424
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: memset.S,v 1.12 1999/10/25 23:48:15 thorpej Exp $ */
|
||||
/* $NetBSD: memset.S,v 1.13 2001/09/07 12:50:01 fredette Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@ -79,7 +79,7 @@
|
||||
#if 0
|
||||
RCSID("from: @(#)bzero.s 5.1 (Berkeley) 5/12/90")
|
||||
#else
|
||||
RCSID("$NetBSD: memset.S,v 1.12 1999/10/25 23:48:15 thorpej Exp $")
|
||||
RCSID("$NetBSD: memset.S,v 1.13 2001/09/07 12:50:01 fredette Exp $")
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@ -112,7 +112,9 @@ ENTRY(memset)
|
||||
jeq Lbzalgndw |
|
||||
movb %d2,%a0@+ | *(char *)dst++ = X
|
||||
subql #1,%d1 | len--
|
||||
addql #1,%d0
|
||||
Lbzalgndw:
|
||||
#ifndef __mc68010__
|
||||
/* long word align */
|
||||
btst #1,%d0 | if (dst & 2)
|
||||
jeq Lbzalgndl |
|
||||
@ -138,6 +140,7 @@ Lbz32loop:
|
||||
clrw %d0
|
||||
subql #1,%d0
|
||||
jcc Lbz32loop
|
||||
#endif /* !__mc68010__ */
|
||||
|
||||
Lbzlong:
|
||||
/* set by longwords */
|
||||
@ -148,6 +151,11 @@ Lbzlong:
|
||||
Lbzlloop:
|
||||
movl %d2,%a0@+ | clear longwords
|
||||
dbf %d0,Lbzlloop | till done
|
||||
#ifdef __mc68010__
|
||||
clrw %d0
|
||||
subql #1,%d0
|
||||
jcc Lbzlloop
|
||||
#endif /* __mc68010__ */
|
||||
andl #3,%d1 | len %= 4
|
||||
jeq Lbzdone
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user