Are loads and stores the only instructions that gets reordered?

前端 未结 2 954
醉梦人生
醉梦人生 2020-11-22 07:09

I have read many articles on memory ordering, and all of them only say that a CPU reorders loads and stores.

Does a CPU (I\'m specifically interested in an x86 CPU)

2条回答
  •  攒了一身酷
    2020-11-22 07:27

    Out of order processors can generally reorder all instruction where doing so is possible, feasible, beneficial for performance. Due to register renaming, this is transparent to the machine code except for the case of loads and stores That's why people usually only talk about load and store reordering as that's the only observable kind of reordering.


     Typically, FPU exceptions are also something where you can observe reordering. Most out of order processors have imprecise exceptions for this reason, but not x86. On x86, the processor makes sure that exceptions are reported as if floating point operations were not reordered.

提交回复
热议问题