0

As the title says, I want to see which i686 instructions are faster, how can I see?

Example: is adding to a register faster or moving a value to a reg faster?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Cyao
  • 727
  • 4
  • 18
  • 1
    It does not make much sense to discuss performance at this level these days, especially when the two things compared do different things. – 500 - Internal Server Error Oct 05 '22 at 16:48
  • 2
    Read a microarchitectural table, such as those provided by Agner Fog. – fuz Oct 05 '22 at 16:49
  • 1
    Do you mean https://www.agner.org/optimize/ as the microarchitectural table provided my Agner Fog? – Cyao Oct 05 '22 at 17:14
  • 2
    For your example of whether `mov reg,reg` can be faster than `add reg,reg`, see [Can x86's MOV really be "free"? Why can't I reproduce this at all?](https://stackoverflow.com/a/44193770) - yes, it surprisingly can be faster (but never free). `mov` is special. In general, see also the links in https://stackoverflow.com/tags/x86/info (But yes, Agner Fog's microarch and asm guides are definitely the place to start.) – Peter Cordes Oct 06 '22 at 02:17

1 Answers1

0

So I've read the begining of the pdfs from https://www.agner.org/optimize/, it is a pretty good source, there are in total 5 pdfs including cpp and asm optimization and instruction speed

Cyao
  • 727
  • 4
  • 18