Messages in this thread | | | Date | Wed, 30 Sep 1998 09:00:09 -0400 (EDT) | From | "Richard B. Johnson" <> | Subject | Re: BogoMIPS |
| |
On Wed, 30 Sep 1998, Jamie Lokier wrote:
> On Tue, Sep 29, 1998 at 08:54:16AM -0400, Richard B. Johnson wrote: > > That's what my patch does in the seperate subroutine. Further, it aligns > > the delay-loop, not the code leading up to it. Further, it makes sure > > I am not sitting on the end of a cache-line by taking two jumps before > > the actual loop. > > The alignment I understand, but the two jumps? I don't understand what > you mean -- i.e., how do the jumps help. I don't think I'll be alone. > > Could you include a comment with the code explaining why it has two > jumps? >
It has two jumps because one is not guaranteed to flush the cache. I want any cache-refills to have been completed before the actual loop.
What I really wanted to do was, " in Intel code"...
PUSH CS ; This is a long-word (32-bit segment) PUSH OFFSET DOIT ; This is a long-word (32-bit segment) RETF ; Far 'return' to DOIT address. DOIT: SUB EAX,1 JNC DOIT
This would have made a 'far' JMP, using a far CALL, to the loop. This guarantees a clean cache.
However, the GNU pseudo-assembler would not resolve the address of the DOIT label (it is only be known at link-time), so I would have to use some trick that I don't know about.
Therefore, I had to hack around with '486s, '586s, and '686s to find a jump combination that would work. You can easly muck with this in user-mode and test all possible combinations. Take out the second jump and you will have bobble on Pentium II (Klamath) machines. Take out all jumps and just align the function and you will have problems with everything except '486s. Don't align the function and you will have problems even with '486s.
Cheers, Dick Johnson ***** FILE SYSTEM WAS MODIFIED ***** Penguin : Linux version 2.1.123 on an i586 machine (66.15 BogoMips). Warning : It's hard to remain at the trailing edge of technology.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |