3 ms·
The branch taken hint (3EH) was re-added in Redwood Cove (2023), but it's only for static prediction where the branch predictor has not yet encountered the bran
by sparkie 11mo ago
The branch taken hint (3EH) was re-added in Redwood Cove (2023), but it's only for static prediction where the branch predictor has not yet encountered the branch - ie, useful for things you would only use once or twice but would likely take the branch. Once the branch predictor has some information the static prediction hint is ignored, so it's best to omit it for anything that will eventually have dynamic branch prediction (ie, run many times), because you'll be consuming bytes in the i-cache which serve no purpose.
- tehjoker 11mo agoif the branch is only taken once how can you realize a significant performance benefit more than a few ns?
- ack_complete 11mo agoCold branch comes to mind -- something like a interrupt handler, that is run often enough but not in high enough bursts.