News for hackers. Stuff that matters.
Re:Beautiful branchless binary search by vkazanov on Friday April 28, 2023 @02:38AM (#35738178)
Sure, it doesn't change the PC. But it can introduce a branch indirectly, I.e. when there is a jump to an address MOVed by cmov.

Either way, it seems that the wisdom has change since the last time I wrote and read assembly. Cmov used to be slow. It seems that the current answer is "it depends".

Re:Beautiful branchless binary search by 2102922286 on Friday April 28, 2023 @02:44AM (#35738226)
If what you're saying is (roughly)

        cmovne  rax, rdx
        jmp     rax
that is, a cmov followed by an indirect jump to the address contained in rax, "jmp rax" is _always_ an indirect jump. It doesn't matter whether rax was set via a conditional move instruction or not.