John Regehr@johnregehr·Aug 18, 2021fun post showing how LLVM optimizes a very bad is-even function https://blog.matthieud.me/2020/exploring-clang-llvm-optimization-on-programming-horror/…read image descriptionALT193431,249
thaddeus e. grugq @thegrugq·Aug 18, 2021Replying to @johnregehr and @maattddQuote TweetCain Maddox@ctrlshifti·Jul 30, 2020God I wish there was an easier way to do thisShow this thread116
John Regehr@johnregehr·Aug 18, 2021Replying to @thegrugq and @maattddthat version is awesome because it has been optimized by aggressive loop unrolling15
Daniel Micay@DanielMicayReplying to @johnregehr @thegrugq and @maattddEvery program should ship with a lookup table with 1 bit for each 32-bit integer value based on whether it's odd or even. That's pretty much how Unicode works.6:49 PM · Aug 18, 2021·Twitter Web App5 Likes
thaddeus e. grugq @thegrugq·Aug 18, 2021Replying to @DanielMicay @johnregehr and @maattddCan then write a simple macro to iterate through the table until you get to the right index, then check the bit, the compiler will optimise it4
Rich Felker@RichFelker·Aug 18, 2021Replying to @DanielMicay @johnregehr and 2 othersThis tweet pretty much sums up how gratuitously bad most Unicode library implementations are...2