|
From: Julian S. <js...@ac...> - 2002-11-21 00:08:20
|
This is the third of two messages about t-chaining. Get a stiff
whisky before reading further; you'll need it.
Using the attached prog, it's easy to show that on my P3, each
(pushf ; popf) pair takes 22 cycles. I assume that's 11 each,
although verifying that. Considering that the P6 pipe is alleged
to be about 10 stages, I strongly suspect they both cause a pipe
flush. Ie, each is as bad as a mispredicted jump.
#include <rude_words.h>
This is bad news. Or a big opportunity to do better.
I have to go to bed now, but from a mental back-of-the-envelope
calculation I'd guess this easily explains the cycle loss from
the inner loop of the previous message.
J
#include <stdio.h>
int main ( int argc, char** argv )
{
int i;
for (i = 0; i < 1000 * 1000 * 1000; i++) {
asm volatile ("pushfl ; popfl");
asm volatile ("pushfl ; popfl");
}
return 0;
}
|