equivalent number of instruction

限于喜欢 提交于 2019-12-06 13:42:16

You don't quite understand the problem. Execution speed depends not only on instructions but on inter-instruction dependencies also. Microprocessors can execute several instructions at the same time given this instructions don't depend on each other. The ability to execute several instructions at a time differs from one processor family to another. That's why this task is really hardware-specific, it can't be solved once and for all.

All you can do is graph an execution timeline of instructions and processor cycles. Processor cycles could be y-axis, instructions could be x-axis. You'll have problems predicting cache hits and misses and execution time of many instructions will vary greatly depending on cache hits/misses. Be ready to spend a lot of time with processors manuals.

It would have to take into account pipelining and all kinds of other intricacies, many of which will vary by processor. In other words, I can't see it being particularly useful even if it's feasible.

There are also things which the algorithm wouldn't be able to tell you, like how many cache misses there'll be etc - these could be much more important than the raw instruction count.

It's not rubbish, it's just vague. To go from Algorithm to SOurce code to Object COde to core... so many details to nail down, each of which can have significant performance implications.

Have a look at Hennessey & Patterson's "Computer Architecture, A Quantitative Approach"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!