home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,057 of 4,675   
   James Van Buskirk to All   
   Re: cycles   
   10 Nov 17 16:02:27   
   
   From: not_valid@nospicedham.comcast.net   
      
   wrote in message news:5a057dc8.172923984@NNTP.AIOE.ORG...   
      
   > I'm trying to find out how many cycles this subroutine takes on a   
   > Nehalem.  According to the output it's 12 cycles.   
   > The data in the comments is from Agner Fog's tables.   
   > The algorithm is from Donald Knuth's TAOCP Vol. 2.   
      
   > Thoughts, comments?   
      
   Are you really trying to directly time something that takes only   
   12 cock cycles?  There are two problems with this:   
      
   1) RDTSC can start before other instructions complete because   
   it has no dependencies.  You can perhaps fix this by using   
   RDTSCP instead of RDTSC.   
      
   2) RDTSC has granularity of the bus clock, not the processor   
   clock, so even though it outputs in units of processor clocks,   
   all result have some common small divisor such as 4 or 10 or   
   even 12 or 18. Thus if your granularity is 12 a sequence that   
   takes 13 cycles could only yield a measured output of 12 or   
   24 cycles.   
      
   Make sure that you are taking these considerations into   
   account when devising a strategy for timing short instruction   
   sequences.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca