4 ms·
By far the most interesting part of this post is the update with newer compilers. Intel's compiler, in particular, makes an awesome optimization. Edit: The up
by taeric 9y ago
By far the most interesting part of this post is the update with newer compilers. Intel's compiler, in particular, makes an awesome optimization.
Edit: The update is not new, either. Just the part that I found interesting. Apologies for any confusion.
- mikeash 9y agoThanks for pointing that out. I'd seen this before so I wasn't going to bother clicking the link, not knowing there was a cool new thing there.
- taeric 9y agoGlad it was worth clicking. I see I accidentally misled some folks that it was recently updated.
- winstonewert 9y agoThe update with the newer compilers was done back in 2012. There have only been minor changes since then. (Not to say that it isn't interesting, but so that people don't go to the post expecting new content and get disappointed)
- taeric 9y agoI updated to make this clearer at the top level. Thanks!
- jnordwick 9y agoCan you point those out please? I dont see any substantive edits in the last few years. Mostly just changing the notice, bounty award, and a roll back this year.
- taeric 9y agoUpdated my post. I merely meant the section. It was still old. :)
- augusto2112 9y agoCan someone explain how interchanging the loops make it immune to mispredictions please? I don't get it
- taeric 9y agoIf 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.
- prirun 9y agoYes, but checkout the Wikipedia page for Intel's C compiler. It points out that Intel's compiler selects optimum code if the CPU reports "GenuineIntel", but selects the least optimum code if the CPU is non-Intel. AMD sued Intel for this, and now Intel has a mumbo-jumbo disclaimer that it may not generate optimum code on a non-Intel CPU (without disclosing that it generates the least optimal code).