logoalt Hacker News

xxporlast Wednesday at 5:10 PM0 repliesview on HN

+1 on reading.

I hardly consider myself an expert ARM ASM programmer (or even an amateur...), but a baseline level of how to read it even if you have to look up a bunch of instructions every time can be super useful for performance work, especially if you have the abstract computer engineering know how to back it up.

For example, it turns out that gcc 7.3 (for arm64) doesn't optimize

   foo() ? bar() : baz(); 
the same as

    if (foo()) {
       bar();
    } else {
       baz();
    }
!

The former was compiled into a branchless set of instructions, while the latter had a branch!