by seedragons · 9y ago · 0 comments
other than branch_pct and non_branch_pct being reversed, this seems to be assuming that 100% of branches are guessed incorrectly. Shouldn't something like 50% be used, to assume a random guess? ie 0.8 * 1 + 0.2 * (0.5 * 20 + 0.8 * 1)=2.96
The very first branch prediction algorithm ("predict taken") is to simply enable pipelining by assuming the generally more likely branch.
>...this seems to be assuming that 100% of branches are guessed incorrectly...
Rather, it's assuming that 100% of branches are not guessed at all.