▲ | gpderetta 2 days ago | |||||||
A few ISAs have used branch prediction hints but they have gone out of fashion (those on x86 are now ignored for example). | ||||||||
▲ | imtringued 2 days ago | parent [-] | |||||||
They are useless because the compiler can simply lay out the code so that the most likely path doesn't trigger the branch and executes the code sequentially. The pipeline has already loaded these instructions anyway, so continuing execution costs nothing. You then only need to predict the exceptional cases that do trigger the branch. This means the only use case for branch prediction hints is for use cases where the most likely branch is changing at runtime. That is such a niche use case that it is never worth it. If you do need this, then you are better off investing into JIT instead of changing the ISA. | ||||||||
|