| ▲ | fc417fc802 2 days ago | |||||||||||||||||||||||||
It seems like that would struggle with detecting how many layers of branching to pay attention to. Imagine the two nested loops surrounded by a randomized one. Wouldn't that implementation keep hitting patterns it hadn't seen before? Obviously that must be a solved problem; I'd be curious to know what the solution is. | ||||||||||||||||||||||||||
| ▲ | mcdeltat a day ago | parent | next [-] | |||||||||||||||||||||||||
Can you walk through why you think the random outer loop would interfere? If the inner loop's behaviour is predictable no matter the outer loop, then because the branch predictor is keyed by instruction address, it can be predicted. Only the inner loop's history is considered. Or maybe I'm misunderstanding what code you're imagining? | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | PunchyHamster 2 days ago | parent | prev [-] | |||||||||||||||||||||||||
might be but what real code does that ? | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||