Hacker News new | ask | show | jobs
by augusto2112 3204 days ago
Can someone explain how interchanging the loops make it immune to mispredictions please? I don't get it
1 comments

If I'm reading it right, the Intel compiler just took advantage of the outer test loop. It was supposed to loop over the data many times. Instead looped over each item of the data many times. Got the same answer, but the branch predictor had a much easier job.