Expressing unsigned comparison through signed comparison of 2's complement
It's even a bit simpler, namely both:


a &lt;u b == (a ^ m) &lt;s (b ^ m), and,
a &lt;s b == (a ^ m) &lt;u (b ^ m)


Where m is the mask with the sign bit set.

I don't have a formal proof for that, but the image below shows what is happening. The top row shows the "unsigned order" of the number line, chopped in half, with the first part having a 0 in the top bit and the second half having a 1 in the top bit. The bottom row shows the same sub-ranges but in the "signed order". The bottom block in the signed case is the same block as the top block in the unsigned case. Notice that the signed and unsigned order of the two sub-ranges is swapped, but the order within the sub-ranges is the same.

XORing by m is equivalent to adding m and to subtracting m, so you may think of it as:


swapping the order of the two sub-ranges (xor)
pushing the two sub-ranges to the right (by the width of a block), with wrap-around to the left side (addition)
pushing the two sub-ranges to the left, with wrap-around to the right side (subtraction)


In any case the order of the blocks is swapped, so it swaps between the signed order and the unsigned order.