Intel ARCHITECTURE IA-32 User Manual Page 95

  • Download
  • Add to my manuals
  • Print
  • Page
    / 568
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 94
General Optimization Guidelines 2
2-23
Assembly/Compiler Coding Rule 6. (H impact, M generality) Do not inline
a function if doing so increases the working set size beyond what will fit in the
trace cache.
Assembly/Compiler Coding Rule 7. (ML impact, ML generality) If there
are more than 16 nested calls and returns in rapid succession; consider
transforming the program with inline to reduce the call depth.
Assembly/Compiler Coding Rule 8. (ML impact, ML generality)
Favor
inlining small functions that contain branches with poor prediction rates. If a
branch misprediction results in a RETURN being prematurely predicted as
taken, a performance penalty may be incurred.
Assembly/Compiler Coding Rule 9. (L impact, L generality)
If the last
statement in a function is a call to another function, consider converting the
call to a jump. This will save the call/ return overhead as well as an entry in the
return stack buffer.
Assembly/Compiler Coding Rule 10. (M impact, L generality) Do not put
more than four branches in a 16-byte chunk.
Assembly/Compiler Coding Rule 11. (M impact, L generality) Do not put
more than two end loop branches in a 16-byte chunk.
Branch Type Selection
The default predicted target for indirect branches and calls is the
fall-through path. The fall-through prediction is overridden if and when
a hardware prediction is available for that branch. The predicted branch
target from branch prediction hardware for an indirect branch is the
previously executed branch target.
The default prediction to the fall-through path is only a significant issue
if no branch prediction is available, due to poor code locality or
pathological branch conflict problems. For indirect calls, predicting the
fall-through path is usually not an issue, since execution will likely
return to the instruction after the associated return.
Page view 94
1 2 ... 90 91 92 93 94 95 96 97 98 99 100 ... 567 568

Comments to this Manuals

No comments