2025-05-15 13:48 UTC
Replies (6)
-
@plusmid@chaos.social 2025-05-15 14:19
@ela@infosec.exchange no way...
-
@viduq@mstdn.social 2025-05-15 14:38
@ela@infosec.exchange how can the compiler break down a recursive function to a mathematical statement? There is no brute force involved or is there? And does it do that only when optimizations are on?
-
@yama@tech.lgbt 2025-05-15 18:58
@ela@infosec.exchange Or maybe a raw bitshift to take the last digit and check if its 0,2,4,6 or 8 :3
-
@porglezomp@mastodon.social 2025-05-15 21:47
@ela@infosec.exchange I wrote a blog post years ago that shows all the intermediate steps of performing this optimization: https://blog.witchoflight.com/2018/llvm-hearts-peano-addition/
-
@josch@floss.social 2025-05-15 22:21
@ela@infosec.exchange This is brilliant! I'd like to put this into my uni lecture on C/C++. If you would like to be credited for this find, how would you like to be attributed? Thanks!
-
@sergi@floss.social 2025-05-15 23:37
@ela@infosec.exchange It seems rustc is doing the same thing: