Skip to content

Commit

Permalink
[MIPS] Fix instable BogoMIPS on multi-issue processors.
Browse files Browse the repository at this point in the history
Increase alignment of BogoMIPS loop to 8 bytes.  Having the delay loop
overlap cache line boundaries may cause instable delays.
    
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Jun 5, 2006
1 parent f3bf07b commit 5ee8235
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions include/asm-mips/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ static inline void __delay(unsigned long loops)
{
if (sizeof(long) == 4)
__asm__ __volatile__ (
".set\tnoreorder\n"
"1:\tbnez\t%0,1b\n\t"
"subu\t%0,1\n\t"
".set\treorder"
" .set noreorder \n"
" .align 3 \n"
"1: bnez %0, 1b \n"
" subu %0, 1 \n"
" .set reorder \n"
: "=r" (loops)
: "0" (loops));
else if (sizeof(long) == 8)
__asm__ __volatile__ (
".set\tnoreorder\n"
"1:\tbnez\t%0,1b\n\t"
"dsubu\t%0,1\n\t"
".set\treorder"
:"=r" (loops)
:"0" (loops));
" .set noreorder \n"
" .align 3 \n"
"1: bnez %0, 1b \n"
" dsubu %0, 1 \n"
" .set reorder \n"
: "=r" (loops)
: "0" (loops));
}


Expand Down

0 comments on commit 5ee8235

Please sign in to comment.