提交 5ee82350 编写于 作者: R Ralf Baechle

[MIPS] Fix instable BogoMIPS on multi-issue processors.

Increase alignment of BogoMIPS loop to 8 bytes.  Having the delay loop
overlap cache line boundaries may cause instable delays.
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 f3bf07b9
...@@ -19,20 +19,22 @@ static inline void __delay(unsigned long loops) ...@@ -19,20 +19,22 @@ static inline void __delay(unsigned long loops)
{ {
if (sizeof(long) == 4) if (sizeof(long) == 4)
__asm__ __volatile__ ( __asm__ __volatile__ (
".set\tnoreorder\n" " .set noreorder \n"
"1:\tbnez\t%0,1b\n\t" " .align 3 \n"
"subu\t%0,1\n\t" "1: bnez %0, 1b \n"
".set\treorder" " subu %0, 1 \n"
" .set reorder \n"
: "=r" (loops) : "=r" (loops)
: "0" (loops)); : "0" (loops));
else if (sizeof(long) == 8) else if (sizeof(long) == 8)
__asm__ __volatile__ ( __asm__ __volatile__ (
".set\tnoreorder\n" " .set noreorder \n"
"1:\tbnez\t%0,1b\n\t" " .align 3 \n"
"dsubu\t%0,1\n\t" "1: bnez %0, 1b \n"
".set\treorder" " dsubu %0, 1 \n"
:"=r" (loops) " .set reorder \n"
:"0" (loops)); : "=r" (loops)
: "0" (loops));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册