News for hackers. Stuff that matters.
Re:Hoare’s Rebuttal and Bubble Sort’s Comeback by userbinator on Sunday January 30, 2022 @05:04AM (#30135511)
It doesn't, but is intended to provide a strong hint to the compiler. A pre-386 one would probably turn the "comparison result in non-branching context" into a cmp/sbb/inc; 386+ could do that or use cmp/setcc depending on surrounding context, and in general a compiler could fold it even further. E.g. if pivot was in eax, it in ecx, and p in edi, that line might generate only two instructions:

    cmp [ecx], eax
    adc edi, 0
(Figuring out how the above works is left as an exercise for the reader.)

There are no comments on this comment yet.