Clock cycles & assembly instructions
Hi people, is there anyone who knows of where you can see how many clock cycles certain instructions or operations take. I''ve looked high and low on the net with no success... Thanks in advance.
http://www.sandpile.org/ is a good site for x86 info. That said, tho, if you''re thinking of simply counting cycles to optimize a function in assembler, you obviously never learned about processor pipelining.
Don''t listen to me. I''ve had too much coffee.
Don''t listen to me. I''ve had too much coffee.
Thanks for the reply, and no, i''m just curious about assembly. I''ve been learning C++ and DX8.1 for a year now and i''m ready to move on to assembly, and you''re right, i''ve no idea what pipelining is, but i will do in a moment.
Sneftel is very right. While know the number of clock cycles it *theortically* takes an instruction can be useful as a casual pointer, knowing how the pipeline and cache works is much more important (especially if you want your code to run anywhere near halfway decent on a P4)
Knowing the *actual* latency of an instruction is very useful - many x86 ops are much slower than equivalent code (e.g. mov eax, [esi] vs. lodsd, dec ecx/jnz label vs. loop label).
Check out AMD''s excellent optimization guide: Link (Appendix F)
Check out AMD''s excellent optimization guide: Link (Appendix F)
quote:Original post by johndunne
Thanks for the reply, and no, i''m just curious about assembly. I''ve been learning C++ and DX8.1 for a year now and i''m ready to move on to assembly, and you''re right, i''ve no idea what pipelining is, but i will do in a moment.
Executing a bunch of instructions in parallel..Sparc pipe:
|t1 |t2 |t3 |t4 |t5 |t6 |t7
----------------------------------------
fetch |f1 |f2 |f3 | | | |
decode | |d1 |d2 |d3 | | |
mem-ax | | |m1 |m2 |m3 | |
store | | | |s1 |s2 |s3 |
Ahhh... Superb, plenty of food for thought! I''m just beginning to learn assembly now so i only vaguely know of pipelining and caching. From what I gather the Athlon XP uses pipeling and caching heavily for performance increase. Another question, i''m about to upgrade my processor from a duron to an Athlon, but which one? I''ll be using it mainly for software development, i''m guessing the XP is the one to go...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement