3 ms·
That necessitates executing both sides fully. Very often, those are "business logic" branches that are very long, and you would only prefer to cover branch mis
by pclmulqdq 2y ago
That necessitates executing both sides fully. Very often, those are "business logic" branches that are very long, and you would only prefer to cover branch mispredict penalty.
- vlovich123 2y agoYes you would only do this for hot loops that have short basic block branches (binary search being the canonical example). That’s why I said hand annotate vs having the CPU try to detect and distinguish these situations at runtime.
- pclmulqdq 2y agoYes, we're talking about different things. Those are able to be optimized in software doing what you mentioned. The branches I am talking about are not. They often sit in "business logic" code.
- vlovich123 2y agoYeah but business logic code like that isn’t generally bounded by the misprediction penalty so it doesn’t matter.