Elektrine lite

← Feed

@ela@infosec.exchange

2025-05-15 13:48 UTC

You might not like it, but this is what peak compiler performance looks like.

Replies (6)

  • @plusmid@chaos.social 2025-05-15 14:19

    @ela@infosec.exchange no way...

    Open ##2639681

  • @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?

    Open ##2639686

  • @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

    Open ##2639702

  • @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/

    Open ##2639721

  • @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!

    Open ##2639728

  • @sergi@floss.social 2025-05-15 23:37

    @ela@infosec.exchange It seems rustc is doing the same thing:

    Open ##2639731