Skip to content

Commit

Permalink
sh: Ensure ST40-300 BogoMIPS value is consistent
Browse files Browse the repository at this point in the history
A strange variation was seen in the BogoMIPS figure for the ST40-300.
This was eventually tracked down to sensitivity to the alignment of
the loop. So add an align directive to ensure this doesn't occur.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Stuart Menefy authored and Paul Mundt committed Feb 15, 2011
1 parent 795abaf commit a086536
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/sh/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
void __delay(unsigned long loops)
{
__asm__ __volatile__(
/*
* ST40-300 appears to have an issue with this code,
* normally taking two cycles each loop, as with all
* other SH variants. If however the branch and the
* delay slot straddle an 8 byte boundary, this increases
* to 3 cycles.
* This align directive ensures this doesn't occur.
*/
".balign 8\n\t"

"tst %0, %0\n\t"
"1:\t"
"bf/s 1b\n\t"
Expand Down

0 comments on commit a086536

Please sign in to comment.