How can I make branchless code and how does it work?
int t = (data[c] – 128) >> 31; The trick here is that if data[c] >= 128, then data[c] – 128 is nonnegative, otherwise it is negative. The highest bit in an int, the sign bit, is 1 if and only if that number is negative. >> is a shift that extends the sign bit, … Read more