+ uint32 a = x ^ y;
+
+ /* --- How it works --- *
+ *
+ * Obviously, %$a$% is nonzero if and only if %$x \ne y$%. Let %$N > 0$%.
+ * Suppose that %$0 < a < N$%. Then:
+ *
+ * %$N/2 = N - N/2 \le N - (a + 1)/2 = N - a/2 - 1/2$%
+ * %${} = N - a + a/2 - 1/2 = N - a + (a - 1)/2$%
+ * %${} \le N - a + \lfloor a/2 \rfloor < N$%
+ *
+ * Consequently, if %$N = 2^{32}$% and %$a$% is nonzero, then
+ * %$a - \lfloor a/2 \rfloor$% has its top bit set. Of course, if
+ * %$a = 0$% then %$a - \lfloor a/2 \rfloor = 0$%.
+ */
+
+ a = (a >> 1) - a;
+ return (U32(~a) >> 31);