Make sure the branch target of the delay loop is aligned to a cache

half-line (8-byte) boundary.  Inspired by a discussion w/ Scott Reynolds.
This commit is contained in:
thorpej 1999-08-01 21:43:04 +00:00
parent d721481d50
commit 6489500f0a
2 changed files with 22 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.35 1999/04/30 09:21:54 christos Exp $ */
/* $NetBSD: locore.s,v 1.36 1999/08/01 21:43:04 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -1068,6 +1068,16 @@ GLOBAL(_delay)
movl sp@(4),d0
| d1 = delay_divisor;
movl _C_LABEL(delay_divisor),d1
jra L_delay /* Jump into the loop! */
/*
* Align the branch target of the loop to a half-line (8-byte)
* boundary to minimize cache effects. This guarantees both
* that there will be no prefetch stalls due to cache line burst
* operations and that the loop will run from a single cache
* half-line.
*/
.align 8
L_delay:
subl d1,d0
jgt L_delay

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.46 1999/05/05 13:46:20 minoura Exp $ */
/* $NetBSD: locore.s,v 1.47 1999/08/01 21:45:35 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -1663,6 +1663,16 @@ ENTRY_NOPROFILE(_delay)
movl sp@(4),d0
| d1 = delay_divisor
movl _C_LABEL(delay_divisor),d1
jra L_delay /* Jump into the loop! */
/*
* Align the branch target of the loop to a half-line (8-byte)
* boundary to minimize cache effects. This guarantees both
* that there will be no prefetch stalls due to cache line burst
* operations and that the loop will run from a single cache
* half-line.
*/
.align 8
L_delay:
subl d1,d0
jgt L_delay