in reply to Re^3: Simple arithmetic? (And the (real) winner is ... )
in thread Simple arithmetic?

Wow. At one point I almost suspected something like that, and even tried to change the order of algorithms, but... that didn't change anything (for some reason), and why the hell the compiler would optimize away just one loop? That's really obscure (**** compilers, how do they work? :)
  • Comment on Re^4: Simple arithmetic? (And the (real) winner is ... )

Replies are listed 'Best First'.
Re^5: Simple arithmetic? (And the (real) winner is ... )
by BrowserUk (Patriarch) on Mar 09, 2015 at 01:44 UTC
    why the hell the compiler would optimize away just one loop? That's really obscure

    I have absolutely no idea. None. Zip. Nada!

    Whilst x64 asm is still fairly new to me, and the syntax and opcodes are sufficiently different from x86 to make it difficult to read at times -- especially with the interleaving of opcodes to keep the pipelines busy -- but I've been inspecting the asm output from compilers long enough now that I can usually postulate a reason why they optimise things in a particular way; but this has me stumped.

    Why for two essentially similar loops, one would get optimised away and the other not...


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked