Cycle times?

Started by
1 comment, last by Electron 23 years, 11 months ago
I''d like to know some information about the time it takes for the computer to do a specific command. For Example: 1+1 (i hope) take 1 processor cycle to process. But what about the other commands? *, /, %, <<, >>, etc Even some information about if, for, and while states would be grateful. Electron

"Who need more than 640kb of RAM?" -Bill gates -89


--Electron"The truth can be changed simply by the way you accept it.""'General failure trying to read from file' - who is General Failure, and why is he reading my file??"
Advertisement
I don''t know how cycles it takes once compiled, but you can compare these instructions speed with a test like this one :

#include void main(){   int time;   time = GetTickCount();   for ( int i=0; i<1000000; i++)   {      // Make your operation, for example : a = i+1   }   time = GetTickCount() - time;   cout<<"Time elapsed (milliseconds) : "<} 




Prosper / LOADED corporation
Hi Electron,

The computer cycle are not count on a operator base, but on a situation/operation base..

ie : if u do like 1 + 1 and u do 1.00 + 1.00, it's will not take the same time (same clock ticks), also its depends on the processeur u use...

I'm used to hear sometime that interger are faster than fixed-point, faster than floating point.

This is absolutly not true.. in the late 80's i agree. The x86 family from Intel the 386, 486 was only for interger math, they got Co-Math Processor on those board for floating-point.

But now, with the new Pentium family *, / are faster for floating-point. If i remember right its a difference of 2 ticks between x86 family and pentium for +, -.

That's normal on a pentium u got U,V pipeline witch are for integer only, than u got a floating-point pipeline.

U,V pentium's pipeline are only used for interger. With those, u will got a big stall if u use Fixed-Point number... (ie: its will stall both pipeline). While using floating point you can use U, V pipeline for around 3 operarions while the floating-point unit is processing the instruction. But that is pentium OPTIMIZATION.

To get back as your question, it's really depends on the processeur family (not on the speed (MHz)). A precision here, higher MHz will perform more ticks in a second so more instruction in a second, but the processing time on a given operation will stay the same. And ticks are count by asm instruction. like (mov, add, sub, mul, div, ...)

Another thing too, the same operation (mov, add, sub, ...) will not take the same time depends on the source and destination. ie: if data come from mem8, mem16, mem32, regs8, regs16, regs32.


A good source for that, is the intel book on the asm language they are using on their processor. In those book u get all instruction supported for a given processor, and their processing time for each instruction case....


Just hope that will help u

Lowrad

(and sorry if you have some problem understanding what i've wrote im french)


Edited by - LowRad on May 19, 2000 9:39:07 AM

Edited by - LowRad on May 19, 2000 9:46:50 AM

This topic is closed to new replies.

Advertisement