| ▲ | metabagel 4 hours ago | |||||||
OK, but the code with the branch is easier to understand. | ||||||||
| ▲ | robby_w_g 4 hours ago | parent | next [-] | |||||||
Yeah, I don't buy the premise that branchless code is intrinsically easier to understand. Maybe OP's point is that adding unnecessary branches makes code harder to read? But that's generally the case for any unnecessary code. | ||||||||
| ||||||||
| ▲ | jamiejquinn 4 hours ago | parent | prev [-] | |||||||
Generally agree. As with many optimisations, branchless code can easily be less obvious than the branchy equivalent. | ||||||||